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 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
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 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose |
| 21 | # |
| 22 | # Executes tests to prove various TLS/SSL options and extensions. |
| 23 | # |
| 24 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 25 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 26 | # (session resumption from cache or ticket, renego, etc). |
| 27 | # |
| 28 | # The tests assume a build with default options, with exceptions expressed |
| 29 | # with a dependency. The tests focus on functionality and do not consider |
| 30 | # performance. |
| 31 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u |
| 34 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 36 | # where it may output seemingly unlimited length error logs. |
| 37 | ulimit -f 20971520 |
| 38 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD |
| 40 | if ! cd "$(dirname "$0")"; then |
| 41 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi |
| 43 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 46 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 48 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 49 | : ${GNUTLS_CLI:=gnutls-cli} |
| 50 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 51 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 52 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 53 | guess_config_name() { |
| 54 | if git diff --quiet ../include/mbedtls/config.h 2>/dev/null; then |
| 55 | echo "default" |
| 56 | else |
| 57 | echo "unknown" |
| 58 | fi |
| 59 | } |
| 60 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 61 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 62 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 63 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 64 | 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] | 65 | 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] | 66 | 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] | 67 | 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] | 68 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 69 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 70 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 71 | |
| 72 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 73 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 74 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 75 | else |
| 76 | O_LEGACY_SRV=false |
| 77 | O_LEGACY_CLI=false |
| 78 | fi |
| 79 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 80 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 81 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 82 | else |
| 83 | G_NEXT_SRV=false |
| 84 | fi |
| 85 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 86 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 87 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 88 | else |
| 89 | G_NEXT_CLI=false |
| 90 | fi |
| 91 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 92 | TESTS=0 |
| 93 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 94 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 95 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 96 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 97 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 98 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 99 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 100 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 101 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 102 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 103 | RUN_TEST_NUMBER='' |
| 104 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 105 | PRESERVE_LOGS=0 |
| 106 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 107 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 108 | # port which is this plus 10000. Each port number may be independently |
| 109 | # overridden by a command line option. |
| 110 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 111 | PXY_PORT=$((SRV_PORT + 10000)) |
| 112 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 113 | print_usage() { |
| 114 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 115 | printf " -h|--help\tPrint this help.\n" |
| 116 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 880f7f2 | 2020-08-26 22:50:38 +0200 | [diff] [blame] | 117 | printf " -f|--filter\tOnly matching tests are executed (BRE)\n" |
| 118 | printf " -e|--exclude\tMatching tests are excluded (BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 119 | 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] | 120 | 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] | 121 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 122 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 123 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 124 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 125 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 126 | 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] | 127 | } |
| 128 | |
| 129 | get_options() { |
| 130 | while [ $# -gt 0 ]; do |
| 131 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 132 | -f|--filter) |
| 133 | shift; FILTER=$1 |
| 134 | ;; |
| 135 | -e|--exclude) |
| 136 | shift; EXCLUDE=$1 |
| 137 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 138 | -m|--memcheck) |
| 139 | MEMCHECK=1 |
| 140 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 141 | -n|--number) |
| 142 | shift; RUN_TEST_NUMBER=$1 |
| 143 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 144 | -s|--show-numbers) |
| 145 | SHOW_TEST_NUMBER=1 |
| 146 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 147 | -p|--preserve-logs) |
| 148 | PRESERVE_LOGS=1 |
| 149 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 150 | --port) |
| 151 | shift; SRV_PORT=$1 |
| 152 | ;; |
| 153 | --proxy-port) |
| 154 | shift; PXY_PORT=$1 |
| 155 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 156 | --seed) |
| 157 | shift; SEED="$1" |
| 158 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 159 | -h|--help) |
| 160 | print_usage |
| 161 | exit 0 |
| 162 | ;; |
| 163 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 164 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 165 | print_usage |
| 166 | exit 1 |
| 167 | ;; |
| 168 | esac |
| 169 | shift |
| 170 | done |
| 171 | } |
| 172 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 173 | # Make the outcome file path relative to the original directory, not |
| 174 | # to .../tests |
| 175 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 176 | [!/]*) |
| 177 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 178 | ;; |
| 179 | esac |
| 180 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 181 | # Skip next test; use this macro to skip tests which are legitimate |
| 182 | # in theory and expected to be re-introduced at some point, but |
| 183 | # aren't expected to succeed at the moment due to problems outside |
| 184 | # our control (such as bugs in other TLS implementations). |
| 185 | skip_next_test() { |
| 186 | SKIP_NEXT="YES" |
| 187 | } |
| 188 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 189 | # skip next test if the flag is not enabled in config.h |
| 190 | requires_config_enabled() { |
| 191 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 192 | SKIP_NEXT="YES" |
| 193 | fi |
| 194 | } |
| 195 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 196 | # skip next test if the flag is enabled in config.h |
| 197 | requires_config_disabled() { |
| 198 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 199 | SKIP_NEXT="YES" |
| 200 | fi |
| 201 | } |
| 202 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 203 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 204 | # This function uses the query_config command line option to query the |
| 205 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 206 | # program. The command will always return a success value if the |
| 207 | # configuration is defined and the value will be printed to stdout. |
| 208 | # |
| 209 | # Note that if the configuration is not defined or is defined to nothing, |
| 210 | # the output of this function will be an empty string. |
| 211 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 215 | VAL="$( get_config_value_or_default "$1" )" |
| 216 | if [ -z "$VAL" ]; then |
| 217 | # Should never happen |
| 218 | echo "Mbed TLS configuration $1 is not defined" |
| 219 | exit 1 |
| 220 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 221 | SKIP_NEXT="YES" |
| 222 | fi |
| 223 | } |
| 224 | |
| 225 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 226 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 227 | if [ -z "$VAL" ]; then |
| 228 | # Should never happen |
| 229 | echo "Mbed TLS configuration $1 is not defined" |
| 230 | exit 1 |
| 231 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 232 | SKIP_NEXT="YES" |
| 233 | fi |
| 234 | } |
| 235 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 236 | requires_ciphersuite_enabled() { |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 237 | if [ -z "$($P_CLI --help 2>/dev/null | grep $1)" ]; then |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 238 | SKIP_NEXT="YES" |
| 239 | fi |
| 240 | } |
| 241 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 242 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 243 | # If CMD (call to a TLS client or server program) requires a specific |
| 244 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
| 245 | # enabled. As an exception, do run the test case if it expects a ciphersuite |
| 246 | # mismatch. |
| 247 | maybe_requires_ciphersuite_enabled() { |
| 248 | case "$1" in |
| 249 | *\ force_ciphersuite=*) :;; |
| 250 | *) return;; # No specific required ciphersuite |
| 251 | esac |
| 252 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 253 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 254 | shift |
| 255 | |
| 256 | case "$*" in |
| 257 | *"-s SSL - The server has no ciphersuites in common"*) |
| 258 | # This test case expects a ciphersuite mismatch, so it doesn't |
| 259 | # require the ciphersuite to be enabled. |
| 260 | ;; |
| 261 | *) |
| 262 | requires_ciphersuite_enabled "$ciphersuite" |
| 263 | ;; |
| 264 | esac |
| 265 | |
| 266 | unset ciphersuite |
| 267 | } |
| 268 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 269 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 270 | requires_openssl_with_fallback_scsv() { |
| 271 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 272 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 273 | then |
| 274 | OPENSSL_HAS_FBSCSV="YES" |
| 275 | else |
| 276 | OPENSSL_HAS_FBSCSV="NO" |
| 277 | fi |
| 278 | fi |
| 279 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 280 | SKIP_NEXT="YES" |
| 281 | fi |
| 282 | } |
| 283 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 284 | # skip next test if GnuTLS isn't available |
| 285 | requires_gnutls() { |
| 286 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 287 | 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] | 288 | GNUTLS_AVAILABLE="YES" |
| 289 | else |
| 290 | GNUTLS_AVAILABLE="NO" |
| 291 | fi |
| 292 | fi |
| 293 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 294 | SKIP_NEXT="YES" |
| 295 | fi |
| 296 | } |
| 297 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 298 | # skip next test if GnuTLS-next isn't available |
| 299 | requires_gnutls_next() { |
| 300 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 301 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 302 | GNUTLS_NEXT_AVAILABLE="YES" |
| 303 | else |
| 304 | GNUTLS_NEXT_AVAILABLE="NO" |
| 305 | fi |
| 306 | fi |
| 307 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 308 | SKIP_NEXT="YES" |
| 309 | fi |
| 310 | } |
| 311 | |
| 312 | # skip next test if OpenSSL-legacy isn't available |
| 313 | requires_openssl_legacy() { |
| 314 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 315 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 316 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 317 | else |
| 318 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 319 | fi |
| 320 | fi |
| 321 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 322 | SKIP_NEXT="YES" |
| 323 | fi |
| 324 | } |
| 325 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 326 | # skip next test if IPv6 isn't available on this host |
| 327 | requires_ipv6() { |
| 328 | if [ -z "${HAS_IPV6:-}" ]; then |
| 329 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 330 | SRV_PID=$! |
| 331 | sleep 1 |
| 332 | kill $SRV_PID >/dev/null 2>&1 |
| 333 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 334 | HAS_IPV6="NO" |
| 335 | else |
| 336 | HAS_IPV6="YES" |
| 337 | fi |
| 338 | rm -r $SRV_OUT |
| 339 | fi |
| 340 | |
| 341 | if [ "$HAS_IPV6" = "NO" ]; then |
| 342 | SKIP_NEXT="YES" |
| 343 | fi |
| 344 | } |
| 345 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 346 | # skip next test if it's i686 or uname is not available |
| 347 | requires_not_i686() { |
| 348 | if [ -z "${IS_I686:-}" ]; then |
| 349 | IS_I686="YES" |
| 350 | if which "uname" >/dev/null 2>&1; then |
| 351 | if [ -z "$(uname -a | grep i686)" ]; then |
| 352 | IS_I686="NO" |
| 353 | fi |
| 354 | fi |
| 355 | fi |
| 356 | if [ "$IS_I686" = "YES" ]; then |
| 357 | SKIP_NEXT="YES" |
| 358 | fi |
| 359 | } |
| 360 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 361 | # Calculate the input & output maximum content lengths set in the config |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 362 | MAX_CONTENT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 363 | MAX_IN_LEN=$( ../scripts/config.py get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 364 | 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] | 365 | |
| 366 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 367 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 368 | fi |
| 369 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 370 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 371 | fi |
| 372 | |
| 373 | # skip the next test if the SSL output buffer is less than 16KB |
| 374 | requires_full_size_output_buffer() { |
| 375 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 376 | SKIP_NEXT="YES" |
| 377 | fi |
| 378 | } |
| 379 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 380 | # skip the next test if valgrind is in use |
| 381 | not_with_valgrind() { |
| 382 | if [ "$MEMCHECK" -gt 0 ]; then |
| 383 | SKIP_NEXT="YES" |
| 384 | fi |
| 385 | } |
| 386 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 387 | # skip the next test if valgrind is NOT in use |
| 388 | only_with_valgrind() { |
| 389 | if [ "$MEMCHECK" -eq 0 ]; then |
| 390 | SKIP_NEXT="YES" |
| 391 | fi |
| 392 | } |
| 393 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 394 | # 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] | 395 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 396 | CLI_DELAY_FACTOR=$1 |
| 397 | } |
| 398 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 399 | # wait for the given seconds after the client finished in the next test |
| 400 | server_needs_more_time() { |
| 401 | SRV_DELAY_SECONDS=$1 |
| 402 | } |
| 403 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 404 | # print_name <name> |
| 405 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 406 | TESTS=$(( $TESTS + 1 )) |
| 407 | LINE="" |
| 408 | |
| 409 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 410 | LINE="$TESTS " |
| 411 | fi |
| 412 | |
| 413 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 414 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 415 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 416 | for i in `seq 1 $LEN`; do printf '.'; done |
| 417 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 418 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 419 | } |
| 420 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 421 | # record_outcome <outcome> [<failure-reason>] |
| 422 | # The test name must be in $NAME. |
| 423 | record_outcome() { |
| 424 | echo "$1" |
| 425 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 426 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 427 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 428 | "ssl-opt" "$NAME" \ |
| 429 | "$1" "${2-}" \ |
| 430 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 431 | fi |
| 432 | } |
| 433 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 434 | # fail <message> |
| 435 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 436 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 437 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 438 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 439 | mv $SRV_OUT o-srv-${TESTS}.log |
| 440 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 441 | if [ -n "$PXY_CMD" ]; then |
| 442 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 443 | fi |
| 444 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 445 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 446 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 447 | echo " ! server output:" |
| 448 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 449 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 450 | echo " ! client output:" |
| 451 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 452 | if [ -n "$PXY_CMD" ]; then |
| 453 | echo " ! ========================================================" |
| 454 | echo " ! proxy output:" |
| 455 | cat o-pxy-${TESTS}.log |
| 456 | fi |
| 457 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 458 | fi |
| 459 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 460 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 461 | } |
| 462 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 463 | # is_polar <cmd_line> |
| 464 | is_polar() { |
| 465 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 466 | } |
| 467 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 468 | # openssl s_server doesn't have -www with DTLS |
| 469 | check_osrv_dtls() { |
| 470 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 471 | NEEDS_INPUT=1 |
| 472 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 473 | else |
| 474 | NEEDS_INPUT=0 |
| 475 | fi |
| 476 | } |
| 477 | |
| 478 | # provide input to commands that need it |
| 479 | provide_input() { |
| 480 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 481 | return |
| 482 | fi |
| 483 | |
| 484 | while true; do |
| 485 | echo "HTTP/1.0 200 OK" |
| 486 | sleep 1 |
| 487 | done |
| 488 | } |
| 489 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 490 | # has_mem_err <log_file_name> |
| 491 | has_mem_err() { |
| 492 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 493 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 494 | then |
| 495 | return 1 # false: does not have errors |
| 496 | else |
| 497 | return 0 # true: has errors |
| 498 | fi |
| 499 | } |
| 500 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 501 | # 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] | 502 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 503 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 504 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 505 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 506 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 507 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 508 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 509 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 510 | # Make a tight loop, server normally takes less than 1s to start. |
| 511 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 512 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 513 | echo "$3 START TIMEOUT" |
| 514 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 515 | break |
| 516 | fi |
| 517 | # Linux and *BSD support decimal arguments to sleep. On other |
| 518 | # OSes this may be a tight loop. |
| 519 | sleep 0.1 2>/dev/null || true |
| 520 | done |
| 521 | } |
| 522 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 523 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 524 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 525 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 526 | } |
| 527 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 528 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 529 | # Wait for server process $2 to be listening on port $1. |
| 530 | wait_server_start() { |
| 531 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 532 | } |
| 533 | |
| 534 | # Wait for proxy process $2 to be listening on port $1. |
| 535 | wait_proxy_start() { |
| 536 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 537 | } |
| 538 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 539 | # 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] | 540 | # 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] | 541 | # acceptable bounds |
| 542 | check_server_hello_time() { |
| 543 | # 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] | 544 | 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] | 545 | # Get the Unix timestamp for now |
| 546 | CUR_TIME=$(date +'%s') |
| 547 | THRESHOLD_IN_SECS=300 |
| 548 | |
| 549 | # Check if the ServerHello time was printed |
| 550 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 551 | return 1 |
| 552 | fi |
| 553 | |
| 554 | # Check the time in ServerHello is within acceptable bounds |
| 555 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 556 | # The time in ServerHello is at least 5 minutes before now |
| 557 | return 1 |
| 558 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 559 | # 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] | 560 | return 1 |
| 561 | else |
| 562 | return 0 |
| 563 | fi |
| 564 | } |
| 565 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 566 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 567 | handshake_memory_get() { |
| 568 | OUTPUT_VARIABLE="$1" |
| 569 | OUTPUT_FILE="$2" |
| 570 | |
| 571 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 572 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 573 | |
| 574 | # Check if memory usage was read |
| 575 | if [ -z "$MEM_USAGE" ]; then |
| 576 | echo "Error: Can not read the value of handshake memory usage" |
| 577 | return 1 |
| 578 | else |
| 579 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 580 | return 0 |
| 581 | fi |
| 582 | } |
| 583 | |
| 584 | # Get handshake memory usage from server or client output and check if this value |
| 585 | # is not higher than the maximum given by the first argument |
| 586 | handshake_memory_check() { |
| 587 | MAX_MEMORY="$1" |
| 588 | OUTPUT_FILE="$2" |
| 589 | |
| 590 | # Get memory usage |
| 591 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 592 | return 1 |
| 593 | fi |
| 594 | |
| 595 | # Check if memory usage is below max value |
| 596 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 597 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 598 | "but should be below $MAX_MEMORY bytes" |
| 599 | return 1 |
| 600 | else |
| 601 | return 0 |
| 602 | fi |
| 603 | } |
| 604 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 605 | # wait for client to terminate and set CLI_EXIT |
| 606 | # must be called right after starting the client |
| 607 | wait_client_done() { |
| 608 | CLI_PID=$! |
| 609 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 610 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 611 | CLI_DELAY_FACTOR=1 |
| 612 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 613 | ( 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] | 614 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 615 | |
| 616 | wait $CLI_PID |
| 617 | CLI_EXIT=$? |
| 618 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 619 | kill $DOG_PID >/dev/null 2>&1 |
| 620 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 621 | |
| 622 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 623 | |
| 624 | sleep $SRV_DELAY_SECONDS |
| 625 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 626 | } |
| 627 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 628 | # check if the given command uses dtls and sets global variable DTLS |
| 629 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 630 | 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] | 631 | DTLS=1 |
| 632 | else |
| 633 | DTLS=0 |
| 634 | fi |
| 635 | } |
| 636 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 637 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 638 | is_gnutls() { |
| 639 | case "$1" in |
| 640 | *gnutls-cli*) |
| 641 | CMD_IS_GNUTLS=1 |
| 642 | ;; |
| 643 | *gnutls-serv*) |
| 644 | CMD_IS_GNUTLS=1 |
| 645 | ;; |
| 646 | *) |
| 647 | CMD_IS_GNUTLS=0 |
| 648 | ;; |
| 649 | esac |
| 650 | } |
| 651 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 652 | # Compare file content |
| 653 | # Usage: find_in_both pattern file1 file2 |
| 654 | # extract from file1 the first line matching the pattern |
| 655 | # check in file2 that the same line can be found |
| 656 | find_in_both() { |
| 657 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 658 | if [ -z "$srv_pattern" ]; then |
| 659 | return 1; |
| 660 | fi |
| 661 | |
| 662 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 663 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 664 | else |
| 665 | return 1; |
| 666 | fi |
| 667 | } |
| 668 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 669 | # 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] | 670 | # Options: -s pattern pattern that must be present in server output |
| 671 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 672 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 673 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 674 | # -S pattern pattern that must be absent in server output |
| 675 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 676 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 677 | # -F call shell function on server output |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 678 | # -g call shell function on server and client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 679 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 680 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 681 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 682 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 683 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 684 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 685 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 686 | # 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] | 687 | return |
| 688 | fi |
| 689 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 690 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 691 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 692 | # Do we only run numbered tests? |
| 693 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 694 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 695 | else |
| 696 | SKIP_NEXT="YES" |
| 697 | fi |
| 698 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 699 | # does this test use a proxy? |
| 700 | if [ "X$1" = "X-p" ]; then |
| 701 | PXY_CMD="$2" |
| 702 | shift 2 |
| 703 | else |
| 704 | PXY_CMD="" |
| 705 | fi |
| 706 | |
| 707 | # get commands and client output |
| 708 | SRV_CMD="$1" |
| 709 | CLI_CMD="$2" |
| 710 | CLI_EXPECT="$3" |
| 711 | shift 3 |
| 712 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 713 | # Check if test uses files |
| 714 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 715 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 716 | requires_config_enabled MBEDTLS_FS_IO |
| 717 | fi |
| 718 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 719 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 720 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 721 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 722 | |
| 723 | # should we skip? |
| 724 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 725 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 726 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 727 | SKIPS=$(( $SKIPS + 1 )) |
| 728 | return |
| 729 | fi |
| 730 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 731 | # update DTLS variable |
| 732 | detect_dtls "$SRV_CMD" |
| 733 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 734 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 735 | # as it provides timing info that's useful to debug failures |
Manuel Pégourié-Gonnard | 70fce98 | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 736 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 737 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 738 | case " $SRV_CMD " in |
| 739 | *' server_addr=::1 '*) |
| 740 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 741 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 742 | fi |
| 743 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 744 | # update CMD_IS_GNUTLS variable |
| 745 | is_gnutls "$SRV_CMD" |
| 746 | |
| 747 | # if the server uses gnutls but doesn't set priority, explicitly |
| 748 | # set the default priority |
| 749 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 750 | case "$SRV_CMD" in |
| 751 | *--priority*) :;; |
| 752 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 753 | esac |
| 754 | fi |
| 755 | |
| 756 | # update CMD_IS_GNUTLS variable |
| 757 | is_gnutls "$CLI_CMD" |
| 758 | |
| 759 | # if the client uses gnutls but doesn't set priority, explicitly |
| 760 | # set the default priority |
| 761 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 762 | case "$CLI_CMD" in |
| 763 | *--priority*) :;; |
| 764 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 765 | esac |
| 766 | fi |
| 767 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 768 | # fix client port |
| 769 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 770 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 771 | else |
| 772 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 773 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 774 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 775 | # prepend valgrind to our commands if active |
| 776 | if [ "$MEMCHECK" -gt 0 ]; then |
| 777 | if is_polar "$SRV_CMD"; then |
| 778 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 779 | fi |
| 780 | if is_polar "$CLI_CMD"; then |
| 781 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 782 | fi |
| 783 | fi |
| 784 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 785 | TIMES_LEFT=2 |
| 786 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 787 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 788 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 789 | # run the commands |
| 790 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 791 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 792 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 793 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 794 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 795 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 796 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 797 | check_osrv_dtls |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 798 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 799 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 800 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 801 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 802 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 803 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 804 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 805 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 806 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 807 | sleep 0.05 |
| 808 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 809 | # terminate the server (and the proxy) |
| 810 | kill $SRV_PID |
| 811 | wait $SRV_PID |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 812 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 813 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 814 | if [ -n "$PXY_CMD" ]; then |
| 815 | kill $PXY_PID >/dev/null 2>&1 |
| 816 | wait $PXY_PID |
| 817 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 818 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 819 | # retry only on timeouts |
| 820 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 821 | printf "RETRY " |
| 822 | else |
| 823 | TIMES_LEFT=0 |
| 824 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 825 | done |
| 826 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 827 | # 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] | 828 | # (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] | 829 | # expected client exit to incorrectly succeed in case of catastrophic |
| 830 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 831 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 832 | 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] | 833 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 834 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 835 | return |
| 836 | fi |
| 837 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 838 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 839 | 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] | 840 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 841 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 842 | return |
| 843 | fi |
| 844 | fi |
| 845 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 846 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 847 | # exit with status 0 when interrupted by a signal, and we don't really |
| 848 | # care anyway), in case e.g. the server reports a memory leak. |
| 849 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 850 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 851 | return |
| 852 | fi |
| 853 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 854 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 855 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 856 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 857 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 858 | 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] | 859 | return |
| 860 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 861 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 862 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 863 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 864 | # 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] | 865 | while [ $# -gt 0 ] |
| 866 | do |
| 867 | case $1 in |
| 868 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 869 | 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] | 870 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 871 | return |
| 872 | fi |
| 873 | ;; |
| 874 | |
| 875 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 876 | 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] | 877 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 878 | return |
| 879 | fi |
| 880 | ;; |
| 881 | |
| 882 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 883 | 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] | 884 | 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] | 885 | return |
| 886 | fi |
| 887 | ;; |
| 888 | |
| 889 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 890 | 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] | 891 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 892 | return |
| 893 | fi |
| 894 | ;; |
| 895 | |
| 896 | # The filtering in the following two options (-u and -U) do the following |
| 897 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 898 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 899 | # - keep one of each non-unique line |
| 900 | # - count how many lines remain |
| 901 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 902 | # if there were no duplicates. |
| 903 | "-U") |
| 904 | 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 |
| 905 | fail "lines following pattern '$2' must be unique in Server output" |
| 906 | return |
| 907 | fi |
| 908 | ;; |
| 909 | |
| 910 | "-u") |
| 911 | 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 |
| 912 | 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] | 913 | return |
| 914 | fi |
| 915 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 916 | "-F") |
| 917 | if ! $2 "$SRV_OUT"; then |
| 918 | fail "function call to '$2' failed on Server output" |
| 919 | return |
| 920 | fi |
| 921 | ;; |
| 922 | "-f") |
| 923 | if ! $2 "$CLI_OUT"; then |
| 924 | fail "function call to '$2' failed on Client output" |
| 925 | return |
| 926 | fi |
| 927 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 928 | "-g") |
| 929 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 930 | fail "function call to '$2' failed on Server and Client output" |
| 931 | return |
| 932 | fi |
| 933 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 934 | |
| 935 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 936 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 937 | exit 1 |
| 938 | esac |
| 939 | shift 2 |
| 940 | done |
| 941 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 942 | # check valgrind's results |
| 943 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 944 | 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] | 945 | fail "Server has memory errors" |
| 946 | return |
| 947 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 948 | 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] | 949 | fail "Client has memory errors" |
| 950 | return |
| 951 | fi |
| 952 | fi |
| 953 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 954 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 955 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 956 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 957 | mv $SRV_OUT o-srv-${TESTS}.log |
| 958 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 959 | if [ -n "$PXY_CMD" ]; then |
| 960 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 961 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 962 | fi |
| 963 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 964 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 965 | } |
| 966 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 967 | run_test_psa() { |
| 968 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 969 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 970 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 971 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 972 | 0 \ |
| 973 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 974 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 975 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 976 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 977 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 978 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 979 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 980 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 981 | -C "Failed to setup PSA-based cipher context"\ |
| 982 | -S "Failed to setup PSA-based cipher context"\ |
| 983 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 984 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 985 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 986 | -S "error" \ |
| 987 | -C "error" |
| 988 | } |
| 989 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 990 | run_test_psa_force_curve() { |
| 991 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 992 | run_test "PSA - ECDH with $1" \ |
| 993 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 994 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 995 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 996 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 997 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 998 | -c "PSA calc verify" \ |
| 999 | -c "calc PSA finished" \ |
| 1000 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1001 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1002 | -s "PSA calc verify" \ |
| 1003 | -s "calc PSA finished" \ |
| 1004 | -C "Failed to setup PSA-based cipher context"\ |
| 1005 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1006 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1007 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1008 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1009 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1010 | -C "error" |
| 1011 | } |
| 1012 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1013 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1014 | # a maximum fragment length. |
| 1015 | # first argument ($1) is MFL for SSL client |
| 1016 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1017 | run_test_memory_after_hanshake_with_mfl() |
| 1018 | { |
| 1019 | # The test passes if the difference is around 2*(16k-MFL) |
| 1020 | local MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
| 1021 | |
| 1022 | # Leave some margin for robustness |
| 1023 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1024 | |
| 1025 | run_test "Handshake memory usage (MFL $1)" \ |
| 1026 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1027 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1028 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1029 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1030 | 0 \ |
| 1031 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1032 | } |
| 1033 | |
| 1034 | |
| 1035 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1036 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1037 | run_tests_memory_after_hanshake() |
| 1038 | { |
| 1039 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1040 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1041 | |
| 1042 | # first test with default MFU is to get reference memory usage |
| 1043 | MEMORY_USAGE_MFL_16K=0 |
| 1044 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1045 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1046 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1047 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1048 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1049 | 0 \ |
| 1050 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1051 | |
| 1052 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1053 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1054 | |
| 1055 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1056 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1057 | |
| 1058 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1059 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1060 | |
| 1061 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1062 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1063 | } |
| 1064 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1065 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1066 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1067 | rm -f context_srv.txt |
| 1068 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1069 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1070 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1071 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1072 | 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] | 1073 | exit 1 |
| 1074 | } |
| 1075 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1076 | # |
| 1077 | # MAIN |
| 1078 | # |
| 1079 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1080 | get_options "$@" |
| 1081 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1082 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1083 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1084 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1085 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1086 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1087 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1088 | exit 1 |
| 1089 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1090 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1091 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1092 | exit 1 |
| 1093 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1094 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1095 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1096 | exit 1 |
| 1097 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1098 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1099 | if which valgrind >/dev/null 2>&1; then :; else |
| 1100 | echo "Memcheck not possible. Valgrind not found" |
| 1101 | exit 1 |
| 1102 | fi |
| 1103 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1104 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1105 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1106 | exit 1 |
| 1107 | fi |
| 1108 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1109 | # used by watchdog |
| 1110 | MAIN_PID="$$" |
| 1111 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1112 | # We use somewhat arbitrary delays for tests: |
| 1113 | # - how long do we wait for the server to start (when lsof not available)? |
| 1114 | # - how long do we allow for the client to finish? |
| 1115 | # (not to check performance, just to avoid waiting indefinitely) |
| 1116 | # Things are slower with valgrind, so give extra time here. |
| 1117 | # |
| 1118 | # Note: without lsof, there is a trade-off between the running time of this |
| 1119 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1120 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1121 | # 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] | 1122 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1123 | START_DELAY=6 |
| 1124 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1125 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1126 | START_DELAY=2 |
| 1127 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1128 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1129 | |
| 1130 | # some particular tests need more time: |
| 1131 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1132 | # - for the server, we sleep for a number of seconds after the client exits |
| 1133 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1134 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1135 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1136 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1137 | # 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] | 1138 | # +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] | 1139 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1140 | 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] | 1141 | 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] | 1142 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1143 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1144 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1145 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1146 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1147 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1148 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1149 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1150 | fi |
| 1151 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1152 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1153 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1154 | fi |
| 1155 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1156 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1157 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1158 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1159 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1160 | # Allow SHA-1, because many of our test certificates use it |
| 1161 | P_SRV="$P_SRV allow_sha1=1" |
| 1162 | P_CLI="$P_CLI allow_sha1=1" |
| 1163 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1164 | # Also pick a unique name for intermediate files |
| 1165 | SRV_OUT="srv_out.$$" |
| 1166 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1167 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1168 | SESSION="session.$$" |
| 1169 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1170 | SKIP_NEXT="NO" |
| 1171 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1172 | trap cleanup INT TERM HUP |
| 1173 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1174 | # Basic test |
| 1175 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1176 | # Checks that: |
| 1177 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1178 | # - the expected (highest security) parameters are selected |
| 1179 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1180 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1181 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1182 | "$P_CLI" \ |
| 1183 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1184 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1185 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1186 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1187 | -s "ECDHE curve: secp521r1" \ |
| 1188 | -S "error" \ |
| 1189 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1190 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1191 | run_test "Default, DTLS" \ |
| 1192 | "$P_SRV dtls=1" \ |
| 1193 | "$P_CLI dtls=1" \ |
| 1194 | 0 \ |
| 1195 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1196 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1197 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1198 | run_test "TLS client auth: required" \ |
| 1199 | "$P_SRV auth_mode=required" \ |
| 1200 | "$P_CLI" \ |
| 1201 | 0 \ |
| 1202 | -s "Verifying peer X.509 certificate... ok" |
| 1203 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1204 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1205 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1206 | requires_config_enabled MBEDTLS_SHA256_C |
| 1207 | run_test "TLS: password protected client key" \ |
| 1208 | "$P_SRV auth_mode=required" \ |
| 1209 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1210 | 0 |
| 1211 | |
| 1212 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1213 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1214 | requires_config_enabled MBEDTLS_SHA256_C |
| 1215 | run_test "TLS: password protected server key" \ |
| 1216 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1217 | "$P_CLI" \ |
| 1218 | 0 |
| 1219 | |
| 1220 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1221 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1222 | requires_config_enabled MBEDTLS_RSA_C |
| 1223 | requires_config_enabled MBEDTLS_SHA256_C |
| 1224 | run_test "TLS: password protected server key, two certificates" \ |
| 1225 | "$P_SRV \ |
| 1226 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1227 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1228 | "$P_CLI" \ |
| 1229 | 0 |
| 1230 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1231 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1232 | run_test "Default (compression enabled)" \ |
| 1233 | "$P_SRV debug_level=3" \ |
| 1234 | "$P_CLI debug_level=3" \ |
| 1235 | 0 \ |
| 1236 | -s "Allocating compression buffer" \ |
| 1237 | -c "Allocating compression buffer" \ |
| 1238 | -s "Record expansion is unknown (compression)" \ |
| 1239 | -c "Record expansion is unknown (compression)" \ |
| 1240 | -S "error" \ |
| 1241 | -C "error" |
| 1242 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1243 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1244 | run_test "CA callback on client" \ |
| 1245 | "$P_SRV debug_level=3" \ |
| 1246 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1247 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1248 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1249 | -S "error" \ |
| 1250 | -C "error" |
| 1251 | |
| 1252 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1253 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1254 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1255 | requires_config_enabled MBEDTLS_SHA256_C |
| 1256 | run_test "CA callback on server" \ |
| 1257 | "$P_SRV auth_mode=required" \ |
| 1258 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1259 | key_file=data_files/server5.key" \ |
| 1260 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1261 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1262 | -s "Verifying peer X.509 certificate... ok" \ |
| 1263 | -S "error" \ |
| 1264 | -C "error" |
| 1265 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1266 | # Test using an opaque private key for client authentication |
| 1267 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1268 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1269 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1270 | requires_config_enabled MBEDTLS_SHA256_C |
| 1271 | run_test "Opaque key for client authentication" \ |
| 1272 | "$P_SRV auth_mode=required" \ |
| 1273 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1274 | key_file=data_files/server5.key" \ |
| 1275 | 0 \ |
| 1276 | -c "key type: Opaque" \ |
| 1277 | -s "Verifying peer X.509 certificate... ok" \ |
| 1278 | -S "error" \ |
| 1279 | -C "error" |
| 1280 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1281 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1282 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1283 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1284 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1285 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1286 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1287 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1288 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1289 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1290 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1291 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1292 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1293 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1294 | run_test_psa_force_curve "secp521r1" |
| 1295 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1296 | run_test_psa_force_curve "brainpoolP512r1" |
| 1297 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1298 | run_test_psa_force_curve "secp384r1" |
| 1299 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1300 | run_test_psa_force_curve "brainpoolP384r1" |
| 1301 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1302 | run_test_psa_force_curve "secp256r1" |
| 1303 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1304 | run_test_psa_force_curve "secp256k1" |
| 1305 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1306 | run_test_psa_force_curve "brainpoolP256r1" |
| 1307 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1308 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1309 | ## SECP224K1 is buggy via the PSA API |
| 1310 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1311 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1312 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1313 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1314 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1315 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1316 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1317 | run_test_psa_force_curve "secp192r1" |
| 1318 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1319 | run_test_psa_force_curve "secp192k1" |
| 1320 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1321 | # Test current time in ServerHello |
| 1322 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1323 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1324 | "$P_SRV debug_level=3" \ |
| 1325 | "$P_CLI debug_level=3" \ |
| 1326 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1327 | -f "check_server_hello_time" \ |
| 1328 | -F "check_server_hello_time" |
| 1329 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1330 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1331 | run_test "Unique IV in GCM" \ |
| 1332 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1333 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1334 | 0 \ |
| 1335 | -u "IV used" \ |
| 1336 | -U "IV used" |
| 1337 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1338 | # Tests for certificate verification callback |
| 1339 | run_test "Configuration-specific CRT verification callback" \ |
| 1340 | "$P_SRV debug_level=3" \ |
| 1341 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1342 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1343 | -S "error" \ |
| 1344 | -c "Verify requested for " \ |
| 1345 | -c "Use configuration-specific verification callback" \ |
| 1346 | -C "Use context-specific verification callback" \ |
| 1347 | -C "error" |
| 1348 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1349 | run_test "Context-specific CRT verification callback" \ |
| 1350 | "$P_SRV debug_level=3" \ |
| 1351 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1352 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1353 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1354 | -c "Verify requested for " \ |
| 1355 | -c "Use context-specific verification callback" \ |
| 1356 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1357 | -C "error" |
| 1358 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1359 | # Tests for rc4 option |
| 1360 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1361 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1362 | run_test "RC4: server disabled, client enabled" \ |
| 1363 | "$P_SRV" \ |
| 1364 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1365 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1366 | -s "SSL - The server has no ciphersuites in common" |
| 1367 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1368 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1369 | run_test "RC4: server half, client enabled" \ |
| 1370 | "$P_SRV arc4=1" \ |
| 1371 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1372 | 1 \ |
| 1373 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1374 | |
| 1375 | run_test "RC4: server enabled, client disabled" \ |
| 1376 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1377 | "$P_CLI" \ |
| 1378 | 1 \ |
| 1379 | -s "SSL - The server has no ciphersuites in common" |
| 1380 | |
| 1381 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1382 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1383 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1384 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1385 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1386 | -S "SSL - The server has no ciphersuites in common" |
| 1387 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1388 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1389 | |
| 1390 | requires_gnutls |
| 1391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1392 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1393 | "$G_SRV"\ |
| 1394 | "$P_CLI force_version=tls1_1" \ |
| 1395 | 0 |
| 1396 | |
| 1397 | requires_gnutls |
| 1398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1399 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1400 | "$G_SRV"\ |
| 1401 | "$P_CLI force_version=tls1" \ |
| 1402 | 0 |
| 1403 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1404 | # Tests for SHA-1 support |
| 1405 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1406 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1407 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1408 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1409 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1410 | 1 \ |
| 1411 | -c "The certificate is signed with an unacceptable hash" |
| 1412 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1413 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1414 | run_test "SHA-1 allowed by default in server certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1415 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1416 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1417 | 0 |
| 1418 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1419 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1420 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1421 | "$P_CLI allow_sha1=1" \ |
| 1422 | 0 |
| 1423 | |
| 1424 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1425 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1426 | "$P_CLI allow_sha1=0" \ |
| 1427 | 0 |
| 1428 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1429 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1430 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1431 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1432 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1433 | 1 \ |
| 1434 | -s "The certificate is signed with an unacceptable hash" |
| 1435 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1436 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1437 | run_test "SHA-1 allowed by default in client certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1438 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1439 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1440 | 0 |
| 1441 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1442 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1443 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1444 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1445 | 0 |
| 1446 | |
| 1447 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1448 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1449 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1450 | 0 |
| 1451 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1452 | # Tests for datagram packing |
| 1453 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1454 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1455 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1456 | 0 \ |
| 1457 | -c "next record in same datagram" \ |
| 1458 | -s "next record in same datagram" |
| 1459 | |
| 1460 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1461 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1462 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1463 | 0 \ |
| 1464 | -s "next record in same datagram" \ |
| 1465 | -C "next record in same datagram" |
| 1466 | |
| 1467 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1468 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1469 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1470 | 0 \ |
| 1471 | -S "next record in same datagram" \ |
| 1472 | -c "next record in same datagram" |
| 1473 | |
| 1474 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1475 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1476 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1477 | 0 \ |
| 1478 | -S "next record in same datagram" \ |
| 1479 | -C "next record in same datagram" |
| 1480 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1481 | # Tests for Truncated HMAC extension |
| 1482 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1483 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1484 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1485 | "$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] | 1486 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1487 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1488 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1489 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1490 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1491 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1492 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1493 | "$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] | 1494 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1495 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1496 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1497 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1498 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1499 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1500 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1501 | "$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] | 1502 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1503 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1504 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1505 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1506 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1507 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1508 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1509 | "$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] | 1510 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1511 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1512 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1513 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1514 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1515 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1516 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1517 | "$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] | 1518 | 0 \ |
| 1519 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1520 | -S "dumping 'expected mac' (10 bytes)" |
| 1521 | |
| 1522 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1523 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1524 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1525 | "$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] | 1526 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1527 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1528 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1529 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1530 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1531 | "$P_SRV dtls=1 debug_level=4" \ |
| 1532 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1533 | 0 \ |
| 1534 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1535 | -S "dumping 'expected mac' (10 bytes)" |
| 1536 | |
| 1537 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1538 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1539 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1540 | "$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] | 1541 | 0 \ |
| 1542 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1543 | -S "dumping 'expected mac' (10 bytes)" |
| 1544 | |
| 1545 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1546 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1547 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1548 | "$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] | 1549 | 0 \ |
| 1550 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1551 | -S "dumping 'expected mac' (10 bytes)" |
| 1552 | |
| 1553 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1554 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1555 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1556 | "$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] | 1557 | 0 \ |
| 1558 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1559 | -S "dumping 'expected mac' (10 bytes)" |
| 1560 | |
| 1561 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1562 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1563 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1564 | "$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] | 1565 | 0 \ |
| 1566 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1567 | -S "dumping 'expected mac' (10 bytes)" |
| 1568 | |
| 1569 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1570 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1571 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1572 | "$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] | 1573 | 0 \ |
| 1574 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1575 | -s "dumping 'expected mac' (10 bytes)" |
| 1576 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1577 | # Tests for Context serialization |
| 1578 | |
| 1579 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1580 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1581 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1582 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1583 | 0 \ |
| 1584 | -c "Deserializing connection..." \ |
| 1585 | -S "Deserializing connection..." |
| 1586 | |
| 1587 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1588 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1589 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1590 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1591 | 0 \ |
| 1592 | -c "Deserializing connection..." \ |
| 1593 | -S "Deserializing connection..." |
| 1594 | |
| 1595 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1596 | run_test "Context serialization, client serializes, GCM" \ |
| 1597 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1598 | "$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] | 1599 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1600 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1601 | -S "Deserializing connection..." |
| 1602 | |
| 1603 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1604 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1605 | run_test "Context serialization, client serializes, with CID" \ |
| 1606 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1607 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1608 | 0 \ |
| 1609 | -c "Deserializing connection..." \ |
| 1610 | -S "Deserializing connection..." |
| 1611 | |
| 1612 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1613 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1614 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1615 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1616 | 0 \ |
| 1617 | -C "Deserializing connection..." \ |
| 1618 | -s "Deserializing connection..." |
| 1619 | |
| 1620 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1621 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1622 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1623 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1624 | 0 \ |
| 1625 | -C "Deserializing connection..." \ |
| 1626 | -s "Deserializing connection..." |
| 1627 | |
| 1628 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1629 | run_test "Context serialization, server serializes, GCM" \ |
| 1630 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1631 | "$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] | 1632 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1633 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1634 | -s "Deserializing connection..." |
| 1635 | |
| 1636 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1637 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1638 | run_test "Context serialization, server serializes, with CID" \ |
| 1639 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1640 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1641 | 0 \ |
| 1642 | -C "Deserializing connection..." \ |
| 1643 | -s "Deserializing connection..." |
| 1644 | |
| 1645 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1646 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1647 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1648 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1649 | 0 \ |
| 1650 | -c "Deserializing connection..." \ |
| 1651 | -s "Deserializing connection..." |
| 1652 | |
| 1653 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1654 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1655 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1656 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1657 | 0 \ |
| 1658 | -c "Deserializing connection..." \ |
| 1659 | -s "Deserializing connection..." |
| 1660 | |
| 1661 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1662 | run_test "Context serialization, both serialize, GCM" \ |
| 1663 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1664 | "$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] | 1665 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1666 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1667 | -s "Deserializing connection..." |
| 1668 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1669 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1670 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1671 | run_test "Context serialization, both serialize, with CID" \ |
| 1672 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1673 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1674 | 0 \ |
| 1675 | -c "Deserializing connection..." \ |
| 1676 | -s "Deserializing connection..." |
| 1677 | |
| 1678 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1679 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1680 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1681 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1682 | 0 \ |
| 1683 | -c "Deserializing connection..." \ |
| 1684 | -S "Deserializing connection..." |
| 1685 | |
| 1686 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1687 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1688 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1689 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1690 | 0 \ |
| 1691 | -c "Deserializing connection..." \ |
| 1692 | -S "Deserializing connection..." |
| 1693 | |
| 1694 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1695 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1696 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1697 | "$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] | 1698 | 0 \ |
| 1699 | -c "Deserializing connection..." \ |
| 1700 | -S "Deserializing connection..." |
| 1701 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1702 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1703 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1704 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1705 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1706 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1707 | 0 \ |
| 1708 | -c "Deserializing connection..." \ |
| 1709 | -S "Deserializing connection..." |
| 1710 | |
| 1711 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1712 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1713 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1714 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1715 | 0 \ |
| 1716 | -C "Deserializing connection..." \ |
| 1717 | -s "Deserializing connection..." |
| 1718 | |
| 1719 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1720 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1721 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1722 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1723 | 0 \ |
| 1724 | -C "Deserializing connection..." \ |
| 1725 | -s "Deserializing connection..." |
| 1726 | |
| 1727 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1728 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1729 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1730 | "$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] | 1731 | 0 \ |
| 1732 | -C "Deserializing connection..." \ |
| 1733 | -s "Deserializing connection..." |
| 1734 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1735 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1736 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1737 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1738 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1739 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1740 | 0 \ |
| 1741 | -C "Deserializing connection..." \ |
| 1742 | -s "Deserializing connection..." |
| 1743 | |
| 1744 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1745 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1746 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1747 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1748 | 0 \ |
| 1749 | -c "Deserializing connection..." \ |
| 1750 | -s "Deserializing connection..." |
| 1751 | |
| 1752 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1753 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1754 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1755 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1756 | 0 \ |
| 1757 | -c "Deserializing connection..." \ |
| 1758 | -s "Deserializing connection..." |
| 1759 | |
| 1760 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1761 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1762 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1763 | "$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] | 1764 | 0 \ |
| 1765 | -c "Deserializing connection..." \ |
| 1766 | -s "Deserializing connection..." |
| 1767 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1768 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1769 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1770 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1771 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1772 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1773 | 0 \ |
| 1774 | -c "Deserializing connection..." \ |
| 1775 | -s "Deserializing connection..." |
| 1776 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1777 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1778 | run_test "Saving the serialized context to a file" \ |
| 1779 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1780 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1781 | 0 \ |
| 1782 | -s "Save serialized context to a file... ok" \ |
| 1783 | -c "Save serialized context to a file... ok" |
| 1784 | rm -f context_srv.txt |
| 1785 | rm -f context_cli.txt |
| 1786 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1787 | # Tests for DTLS Connection ID extension |
| 1788 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1789 | # So far, the CID API isn't implemented, so we can't |
| 1790 | # grep for output witnessing its use. This needs to be |
| 1791 | # changed once the CID extension is implemented. |
| 1792 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1794 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1795 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1796 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1797 | 0 \ |
| 1798 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1799 | -s "found CID extension" \ |
| 1800 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1801 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1802 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1803 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1804 | -C "found CID extension" \ |
| 1805 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1806 | -C "Copy CIDs into SSL transform" \ |
| 1807 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 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: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1811 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1812 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1813 | 0 \ |
| 1814 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1815 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1816 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1817 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1818 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1819 | -C "found CID extension" \ |
| 1820 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1821 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1822 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1823 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1824 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1825 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1826 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1827 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1828 | 0 \ |
| 1829 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1830 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1831 | -c "client hello, adding CID extension" \ |
| 1832 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1833 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1834 | -s "server hello, adding CID extension" \ |
| 1835 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1836 | -c "Use of CID extension negotiated" \ |
| 1837 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1838 | -c "Copy CIDs into SSL transform" \ |
| 1839 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1840 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1841 | -s "Use of Connection ID has been negotiated" \ |
| 1842 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1843 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1844 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1845 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1846 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1847 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1848 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1849 | 0 \ |
| 1850 | -c "Enable use of CID extension." \ |
| 1851 | -s "Enable use of CID extension." \ |
| 1852 | -c "client hello, adding CID extension" \ |
| 1853 | -s "found CID extension" \ |
| 1854 | -s "Use of CID extension negotiated" \ |
| 1855 | -s "server hello, adding CID extension" \ |
| 1856 | -c "found CID extension" \ |
| 1857 | -c "Use of CID extension negotiated" \ |
| 1858 | -s "Copy CIDs into SSL transform" \ |
| 1859 | -c "Copy CIDs into SSL transform" \ |
| 1860 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1861 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1862 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1863 | -c "Use of Connection ID has been negotiated" \ |
| 1864 | -c "ignoring unexpected CID" \ |
| 1865 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1866 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1867 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1868 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1869 | -p "$P_PXY mtu=800" \ |
| 1870 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1871 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1872 | 0 \ |
| 1873 | -c "Enable use of CID extension." \ |
| 1874 | -s "Enable use of CID extension." \ |
| 1875 | -c "client hello, adding CID extension" \ |
| 1876 | -s "found CID extension" \ |
| 1877 | -s "Use of CID extension negotiated" \ |
| 1878 | -s "server hello, adding CID extension" \ |
| 1879 | -c "found CID extension" \ |
| 1880 | -c "Use of CID extension negotiated" \ |
| 1881 | -s "Copy CIDs into SSL transform" \ |
| 1882 | -c "Copy CIDs into SSL transform" \ |
| 1883 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1884 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1885 | -s "Use of Connection ID has been negotiated" \ |
| 1886 | -c "Use of Connection ID has been negotiated" |
| 1887 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1888 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1889 | 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] | 1890 | -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] | 1891 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1892 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1893 | 0 \ |
| 1894 | -c "Enable use of CID extension." \ |
| 1895 | -s "Enable use of CID extension." \ |
| 1896 | -c "client hello, adding CID extension" \ |
| 1897 | -s "found CID extension" \ |
| 1898 | -s "Use of CID extension negotiated" \ |
| 1899 | -s "server hello, adding CID extension" \ |
| 1900 | -c "found CID extension" \ |
| 1901 | -c "Use of CID extension negotiated" \ |
| 1902 | -s "Copy CIDs into SSL transform" \ |
| 1903 | -c "Copy CIDs into SSL transform" \ |
| 1904 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1905 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1906 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1907 | -c "Use of Connection ID has been negotiated" \ |
| 1908 | -c "ignoring unexpected CID" \ |
| 1909 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1910 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1911 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1912 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1913 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1914 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1915 | 0 \ |
| 1916 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1917 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1918 | -c "client hello, adding CID extension" \ |
| 1919 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1920 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1921 | -s "server hello, adding CID extension" \ |
| 1922 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1923 | -c "Use of CID extension negotiated" \ |
| 1924 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1925 | -c "Copy CIDs into SSL transform" \ |
| 1926 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1927 | -s "Peer CID (length 0 Bytes):" \ |
| 1928 | -s "Use of Connection ID has been negotiated" \ |
| 1929 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1930 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1931 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1932 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1933 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1934 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1935 | 0 \ |
| 1936 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1937 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1938 | -c "client hello, adding CID extension" \ |
| 1939 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1940 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1941 | -s "server hello, adding CID extension" \ |
| 1942 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1943 | -c "Use of CID extension negotiated" \ |
| 1944 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1945 | -c "Copy CIDs into SSL transform" \ |
| 1946 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1947 | -c "Peer CID (length 0 Bytes):" \ |
| 1948 | -s "Use of Connection ID has been negotiated" \ |
| 1949 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1950 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1951 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1952 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1953 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1954 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1955 | 0 \ |
| 1956 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1957 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1958 | -c "client hello, adding CID extension" \ |
| 1959 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1960 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1961 | -s "server hello, adding CID extension" \ |
| 1962 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1963 | -c "Use of CID extension negotiated" \ |
| 1964 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1965 | -c "Copy CIDs into SSL transform" \ |
| 1966 | -S "Use of Connection ID has been negotiated" \ |
| 1967 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1968 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1970 | 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] | 1971 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1972 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1973 | 0 \ |
| 1974 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1975 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1976 | -c "client hello, adding CID extension" \ |
| 1977 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1978 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1979 | -s "server hello, adding CID extension" \ |
| 1980 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1981 | -c "Use of CID extension negotiated" \ |
| 1982 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1983 | -c "Copy CIDs into SSL transform" \ |
| 1984 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1985 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1986 | -s "Use of Connection ID has been negotiated" \ |
| 1987 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1988 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1989 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1990 | 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] | 1991 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1992 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1993 | 0 \ |
| 1994 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1995 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1996 | -c "client hello, adding CID extension" \ |
| 1997 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1998 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1999 | -s "server hello, adding CID extension" \ |
| 2000 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2001 | -c "Use of CID extension negotiated" \ |
| 2002 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2003 | -c "Copy CIDs into SSL transform" \ |
| 2004 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2005 | -s "Peer CID (length 0 Bytes):" \ |
| 2006 | -s "Use of Connection ID has been negotiated" \ |
| 2007 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2008 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2009 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2010 | 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] | 2011 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2012 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2013 | 0 \ |
| 2014 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2015 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2016 | -c "client hello, adding CID extension" \ |
| 2017 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2018 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2019 | -s "server hello, adding CID extension" \ |
| 2020 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2021 | -c "Use of CID extension negotiated" \ |
| 2022 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2023 | -c "Copy CIDs into SSL transform" \ |
| 2024 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2025 | -c "Peer CID (length 0 Bytes):" \ |
| 2026 | -s "Use of Connection ID has been negotiated" \ |
| 2027 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2028 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2029 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2030 | 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] | 2031 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2032 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2033 | 0 \ |
| 2034 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2035 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2036 | -c "client hello, adding CID extension" \ |
| 2037 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2038 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2039 | -s "server hello, adding CID extension" \ |
| 2040 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2041 | -c "Use of CID extension negotiated" \ |
| 2042 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2043 | -c "Copy CIDs into SSL transform" \ |
| 2044 | -S "Use of Connection ID has been negotiated" \ |
| 2045 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2046 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2047 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2048 | 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] | 2049 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2050 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2051 | 0 \ |
| 2052 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2053 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2054 | -c "client hello, adding CID extension" \ |
| 2055 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2056 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2057 | -s "server hello, adding CID extension" \ |
| 2058 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2059 | -c "Use of CID extension negotiated" \ |
| 2060 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2061 | -c "Copy CIDs into SSL transform" \ |
| 2062 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2063 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2064 | -s "Use of Connection ID has been negotiated" \ |
| 2065 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2066 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2067 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2068 | 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] | 2069 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2070 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2071 | 0 \ |
| 2072 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2073 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2074 | -c "client hello, adding CID extension" \ |
| 2075 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2076 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2077 | -s "server hello, adding CID extension" \ |
| 2078 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2079 | -c "Use of CID extension negotiated" \ |
| 2080 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2081 | -c "Copy CIDs into SSL transform" \ |
| 2082 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2083 | -s "Peer CID (length 0 Bytes):" \ |
| 2084 | -s "Use of Connection ID has been negotiated" \ |
| 2085 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2086 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2087 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2088 | 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] | 2089 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2090 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2091 | 0 \ |
| 2092 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2093 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2094 | -c "client hello, adding CID extension" \ |
| 2095 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2096 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2097 | -s "server hello, adding CID extension" \ |
| 2098 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2099 | -c "Use of CID extension negotiated" \ |
| 2100 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2101 | -c "Copy CIDs into SSL transform" \ |
| 2102 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2103 | -c "Peer CID (length 0 Bytes):" \ |
| 2104 | -s "Use of Connection ID has been negotiated" \ |
| 2105 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2106 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2107 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2108 | 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] | 2109 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2110 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2111 | 0 \ |
| 2112 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2113 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2114 | -c "client hello, adding CID extension" \ |
| 2115 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2116 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2117 | -s "server hello, adding CID extension" \ |
| 2118 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2119 | -c "Use of CID extension negotiated" \ |
| 2120 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2121 | -c "Copy CIDs into SSL transform" \ |
| 2122 | -S "Use of Connection ID has been negotiated" \ |
| 2123 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2124 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2125 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2126 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2127 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2128 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2129 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2130 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2131 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2132 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2133 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2134 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2135 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2136 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2137 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2138 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2139 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2140 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2141 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2142 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2143 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2144 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead 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): be ef" \ |
| 2151 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2152 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2153 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2154 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2155 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2156 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2157 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2158 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2159 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2160 | 0 \ |
| 2161 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2162 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 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): be ef" \ |
| 2166 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2167 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2168 | -c "(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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2171 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2172 | 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] | 2173 | -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] | 2174 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2175 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2176 | 0 \ |
| 2177 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2178 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2179 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2180 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2181 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2182 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2183 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2184 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2185 | -c "ignoring unexpected CID" \ |
| 2186 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2187 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2188 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2189 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2190 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2191 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2192 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2193 | 0 \ |
| 2194 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2195 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2196 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2197 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2198 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2199 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2200 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2201 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2202 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2203 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2204 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2205 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2206 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2207 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2208 | 0 \ |
| 2209 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2210 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2211 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2212 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2213 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2214 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2215 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2216 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2217 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2218 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2219 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2220 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2221 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2222 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2223 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2224 | 0 \ |
| 2225 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2226 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2227 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2228 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2229 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2230 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2231 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2232 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2233 | -c "ignoring unexpected CID" \ |
| 2234 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2235 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2237 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2238 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2239 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2240 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2241 | 0 \ |
| 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 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2249 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2250 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2251 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2252 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2253 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2254 | 0 \ |
| 2255 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2256 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2257 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2258 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2259 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2260 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2261 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2262 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2263 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2264 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2265 | -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] | 2266 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2267 | "$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" \ |
| 2268 | 0 \ |
| 2269 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2270 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2271 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2272 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2273 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2274 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2275 | -c "ignoring unexpected CID" \ |
| 2276 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2277 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2278 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2279 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2280 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2281 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2282 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2283 | 0 \ |
| 2284 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2285 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2286 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2287 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2288 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2289 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2290 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2291 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2292 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2293 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2294 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2296 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2297 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2298 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2299 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2300 | 0 \ |
| 2301 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2302 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2303 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2304 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2305 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2306 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2307 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2308 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2309 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2310 | -c "ignoring unexpected CID" \ |
| 2311 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2312 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2313 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2314 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2315 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2316 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2317 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2318 | 0 \ |
| 2319 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2320 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2321 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2322 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2323 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2324 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2325 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2326 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2327 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2328 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2329 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2331 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2332 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2333 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2334 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2335 | 0 \ |
| 2336 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2337 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2338 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2339 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2340 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2341 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2342 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2343 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2344 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2345 | -c "ignoring unexpected CID" \ |
| 2346 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2347 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2348 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2349 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2350 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2351 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2352 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2353 | 0 \ |
| 2354 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2355 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2356 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2357 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2358 | -s "Reallocating in_buf" \ |
| 2359 | -s "Reallocating out_buf" |
| 2360 | |
| 2361 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2362 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2363 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2364 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2365 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2366 | 0 \ |
| 2367 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2368 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2369 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2370 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2371 | -s "Reallocating in_buf" \ |
| 2372 | -s "Reallocating out_buf" |
| 2373 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2374 | # Tests for Encrypt-then-MAC extension |
| 2375 | |
| 2376 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2377 | "$P_SRV debug_level=3 \ |
| 2378 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2379 | "$P_CLI debug_level=3" \ |
| 2380 | 0 \ |
| 2381 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2382 | -s "found encrypt then mac extension" \ |
| 2383 | -s "server hello, adding encrypt then mac extension" \ |
| 2384 | -c "found encrypt_then_mac extension" \ |
| 2385 | -c "using encrypt then mac" \ |
| 2386 | -s "using encrypt then mac" |
| 2387 | |
| 2388 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2389 | "$P_SRV debug_level=3 etm=0 \ |
| 2390 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2391 | "$P_CLI debug_level=3 etm=1" \ |
| 2392 | 0 \ |
| 2393 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2394 | -s "found encrypt then mac extension" \ |
| 2395 | -S "server hello, adding encrypt then mac extension" \ |
| 2396 | -C "found encrypt_then_mac extension" \ |
| 2397 | -C "using encrypt then mac" \ |
| 2398 | -S "using encrypt then mac" |
| 2399 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2400 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2401 | "$P_SRV debug_level=3 etm=1 \ |
| 2402 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2403 | "$P_CLI debug_level=3 etm=1" \ |
| 2404 | 0 \ |
| 2405 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2406 | -s "found encrypt then mac extension" \ |
| 2407 | -S "server hello, adding encrypt then mac extension" \ |
| 2408 | -C "found encrypt_then_mac extension" \ |
| 2409 | -C "using encrypt then mac" \ |
| 2410 | -S "using encrypt then mac" |
| 2411 | |
| 2412 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2413 | "$P_SRV debug_level=3 etm=1 \ |
| 2414 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2415 | "$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] | 2416 | 0 \ |
| 2417 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2418 | -s "found encrypt then mac extension" \ |
| 2419 | -S "server hello, adding encrypt then mac extension" \ |
| 2420 | -C "found encrypt_then_mac extension" \ |
| 2421 | -C "using encrypt then mac" \ |
| 2422 | -S "using encrypt then mac" |
| 2423 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2424 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2425 | "$P_SRV debug_level=3 etm=1 \ |
| 2426 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2427 | "$P_CLI debug_level=3 etm=0" \ |
| 2428 | 0 \ |
| 2429 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2430 | -S "found encrypt then mac extension" \ |
| 2431 | -S "server hello, adding encrypt then mac extension" \ |
| 2432 | -C "found encrypt_then_mac extension" \ |
| 2433 | -C "using encrypt then mac" \ |
| 2434 | -S "using encrypt then mac" |
| 2435 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2436 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2437 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2438 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2439 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2440 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2441 | 0 \ |
| 2442 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2443 | -S "found encrypt then mac extension" \ |
| 2444 | -S "server hello, adding encrypt then mac extension" \ |
| 2445 | -C "found encrypt_then_mac extension" \ |
| 2446 | -C "using encrypt then mac" \ |
| 2447 | -S "using encrypt then mac" |
| 2448 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2449 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2450 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2451 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2452 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2453 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2454 | 0 \ |
| 2455 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2456 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2457 | -S "server hello, adding encrypt then mac extension" \ |
| 2458 | -C "found encrypt_then_mac extension" \ |
| 2459 | -C "using encrypt then mac" \ |
| 2460 | -S "using encrypt then mac" |
| 2461 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2462 | # Tests for Extended Master Secret extension |
| 2463 | |
| 2464 | run_test "Extended Master Secret: default" \ |
| 2465 | "$P_SRV debug_level=3" \ |
| 2466 | "$P_CLI debug_level=3" \ |
| 2467 | 0 \ |
| 2468 | -c "client hello, adding extended_master_secret extension" \ |
| 2469 | -s "found extended master secret extension" \ |
| 2470 | -s "server hello, adding extended master secret extension" \ |
| 2471 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2472 | -c "session hash for extended master secret" \ |
| 2473 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2474 | |
| 2475 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2476 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2477 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2478 | 0 \ |
| 2479 | -c "client hello, adding extended_master_secret extension" \ |
| 2480 | -s "found extended master secret extension" \ |
| 2481 | -S "server hello, adding extended master secret extension" \ |
| 2482 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2483 | -C "session hash for extended master secret" \ |
| 2484 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2485 | |
| 2486 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2487 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2488 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2489 | 0 \ |
| 2490 | -C "client hello, adding extended_master_secret extension" \ |
| 2491 | -S "found extended master secret extension" \ |
| 2492 | -S "server hello, adding extended master secret extension" \ |
| 2493 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2494 | -C "session hash for extended master secret" \ |
| 2495 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2496 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2497 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2498 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2499 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2500 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2501 | 0 \ |
| 2502 | -C "client hello, adding extended_master_secret extension" \ |
| 2503 | -S "found extended master secret extension" \ |
| 2504 | -S "server hello, adding extended master secret extension" \ |
| 2505 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2506 | -C "session hash for extended master secret" \ |
| 2507 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2508 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2510 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2511 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2512 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2513 | 0 \ |
| 2514 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2515 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2516 | -S "server hello, adding extended master secret extension" \ |
| 2517 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2518 | -C "session hash for extended master secret" \ |
| 2519 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2520 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2521 | # Tests for FALLBACK_SCSV |
| 2522 | |
| 2523 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2524 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2525 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2526 | 0 \ |
| 2527 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2528 | -S "received FALLBACK_SCSV" \ |
| 2529 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2530 | -C "is a fatal alert message (msg 86)" |
| 2531 | |
| 2532 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2533 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2534 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2535 | 0 \ |
| 2536 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2537 | -S "received FALLBACK_SCSV" \ |
| 2538 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2539 | -C "is a fatal alert message (msg 86)" |
| 2540 | |
| 2541 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2542 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2543 | "$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] | 2544 | 1 \ |
| 2545 | -c "adding FALLBACK_SCSV" \ |
| 2546 | -s "received FALLBACK_SCSV" \ |
| 2547 | -s "inapropriate fallback" \ |
| 2548 | -c "is a fatal alert message (msg 86)" |
| 2549 | |
| 2550 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2551 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2552 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2553 | 0 \ |
| 2554 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2555 | -s "received FALLBACK_SCSV" \ |
| 2556 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2557 | -C "is a fatal alert message (msg 86)" |
| 2558 | |
| 2559 | requires_openssl_with_fallback_scsv |
| 2560 | run_test "Fallback SCSV: default, openssl server" \ |
| 2561 | "$O_SRV" \ |
| 2562 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2563 | 0 \ |
| 2564 | -C "adding FALLBACK_SCSV" \ |
| 2565 | -C "is a fatal alert message (msg 86)" |
| 2566 | |
| 2567 | requires_openssl_with_fallback_scsv |
| 2568 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2569 | "$O_SRV" \ |
| 2570 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2571 | 1 \ |
| 2572 | -c "adding FALLBACK_SCSV" \ |
| 2573 | -c "is a fatal alert message (msg 86)" |
| 2574 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2575 | requires_openssl_with_fallback_scsv |
| 2576 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2577 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2578 | "$O_CLI -tls1_1" \ |
| 2579 | 0 \ |
| 2580 | -S "received FALLBACK_SCSV" \ |
| 2581 | -S "inapropriate fallback" |
| 2582 | |
| 2583 | requires_openssl_with_fallback_scsv |
| 2584 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2585 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2586 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2587 | 1 \ |
| 2588 | -s "received FALLBACK_SCSV" \ |
| 2589 | -s "inapropriate fallback" |
| 2590 | |
| 2591 | requires_openssl_with_fallback_scsv |
| 2592 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2593 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2594 | "$O_CLI -fallback_scsv" \ |
| 2595 | 0 \ |
| 2596 | -s "received FALLBACK_SCSV" \ |
| 2597 | -S "inapropriate fallback" |
| 2598 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2599 | # Test sending and receiving empty application data records |
| 2600 | |
| 2601 | run_test "Encrypt then MAC: empty application data record" \ |
| 2602 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2603 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2604 | 0 \ |
| 2605 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2606 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2607 | -c "0 bytes written in 1 fragments" |
| 2608 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2609 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2610 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2611 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2612 | 0 \ |
| 2613 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2614 | -c "0 bytes written in 1 fragments" |
| 2615 | |
| 2616 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2617 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2618 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2619 | 0 \ |
| 2620 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2621 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2622 | -c "0 bytes written in 1 fragments" |
| 2623 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2624 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2625 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2626 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2627 | 0 \ |
| 2628 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2629 | -c "0 bytes written in 1 fragments" |
| 2630 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2631 | ## ClientHello generated with |
| 2632 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2633 | ## then manually twiddling the ciphersuite list. |
| 2634 | ## The ClientHello content is spelled out below as a hex string as |
| 2635 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2636 | ## The expected response is an inappropriate_fallback alert. |
| 2637 | requires_openssl_with_fallback_scsv |
| 2638 | run_test "Fallback SCSV: beginning of list" \ |
| 2639 | "$P_SRV debug_level=2" \ |
| 2640 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2641 | 0 \ |
| 2642 | -s "received FALLBACK_SCSV" \ |
| 2643 | -s "inapropriate fallback" |
| 2644 | |
| 2645 | requires_openssl_with_fallback_scsv |
| 2646 | run_test "Fallback SCSV: end of list" \ |
| 2647 | "$P_SRV debug_level=2" \ |
| 2648 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2649 | 0 \ |
| 2650 | -s "received FALLBACK_SCSV" \ |
| 2651 | -s "inapropriate fallback" |
| 2652 | |
| 2653 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2654 | requires_openssl_with_fallback_scsv |
| 2655 | run_test "Fallback SCSV: not in list" \ |
| 2656 | "$P_SRV debug_level=2" \ |
| 2657 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2658 | 0 \ |
| 2659 | -S "received FALLBACK_SCSV" \ |
| 2660 | -S "inapropriate fallback" |
| 2661 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2662 | # Tests for CBC 1/n-1 record splitting |
| 2663 | |
| 2664 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2665 | "$P_SRV" \ |
| 2666 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2667 | request_size=123 force_version=tls1_2" \ |
| 2668 | 0 \ |
| 2669 | -s "Read from client: 123 bytes read" \ |
| 2670 | -S "Read from client: 1 bytes read" \ |
| 2671 | -S "122 bytes read" |
| 2672 | |
| 2673 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2674 | "$P_SRV" \ |
| 2675 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2676 | request_size=123 force_version=tls1_1" \ |
| 2677 | 0 \ |
| 2678 | -s "Read from client: 123 bytes read" \ |
| 2679 | -S "Read from client: 1 bytes read" \ |
| 2680 | -S "122 bytes read" |
| 2681 | |
| 2682 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2683 | "$P_SRV" \ |
| 2684 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2685 | request_size=123 force_version=tls1" \ |
| 2686 | 0 \ |
| 2687 | -S "Read from client: 123 bytes read" \ |
| 2688 | -s "Read from client: 1 bytes read" \ |
| 2689 | -s "122 bytes read" |
| 2690 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2691 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2692 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2693 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2694 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2695 | request_size=123 force_version=ssl3" \ |
| 2696 | 0 \ |
| 2697 | -S "Read from client: 123 bytes read" \ |
| 2698 | -s "Read from client: 1 bytes read" \ |
| 2699 | -s "122 bytes read" |
| 2700 | |
| 2701 | 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] | 2702 | "$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] | 2703 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2704 | request_size=123 force_version=tls1" \ |
| 2705 | 0 \ |
| 2706 | -s "Read from client: 123 bytes read" \ |
| 2707 | -S "Read from client: 1 bytes read" \ |
| 2708 | -S "122 bytes read" |
| 2709 | |
| 2710 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2711 | "$P_SRV" \ |
| 2712 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2713 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2714 | 0 \ |
| 2715 | -s "Read from client: 123 bytes read" \ |
| 2716 | -S "Read from client: 1 bytes read" \ |
| 2717 | -S "122 bytes read" |
| 2718 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2719 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2720 | "$P_SRV nbio=2" \ |
| 2721 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2722 | request_size=123 force_version=tls1" \ |
| 2723 | 0 \ |
| 2724 | -S "Read from client: 123 bytes read" \ |
| 2725 | -s "Read from client: 1 bytes read" \ |
| 2726 | -s "122 bytes read" |
| 2727 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2728 | # Tests for Session Tickets |
| 2729 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2730 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2731 | "$P_SRV debug_level=3 tickets=1" \ |
| 2732 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2733 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 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" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 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 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2744 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2745 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2746 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +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 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2758 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2759 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2760 | "$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] | 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: session copy" \ |
| 2773 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2774 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 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 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2786 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2787 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2788 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 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 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2795 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2796 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2797 | "( $O_CLI -sess_out $SESSION; \ |
| 2798 | $O_CLI -sess_in $SESSION; \ |
| 2799 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 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 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2807 | # Tests for Session Tickets with DTLS |
| 2808 | |
| 2809 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2810 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2811 | "$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] | 2812 | 0 \ |
| 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" \ |
| 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 | |
| 2823 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2824 | "$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] | 2825 | "$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] | 2826 | 0 \ |
| 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" \ |
| 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" |
| 2836 | |
| 2837 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2838 | "$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] | 2839 | "$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] | 2840 | 0 \ |
| 2841 | -c "client hello, adding session ticket extension" \ |
| 2842 | -s "found session ticket extension" \ |
| 2843 | -s "server hello, adding session ticket extension" \ |
| 2844 | -c "found session_ticket extension" \ |
| 2845 | -c "parse new session ticket" \ |
| 2846 | -S "session successfully restored from cache" \ |
| 2847 | -S "session successfully restored from ticket" \ |
| 2848 | -S "a session has been resumed" \ |
| 2849 | -C "a session has been resumed" |
| 2850 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2851 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2852 | "$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] | 2853 | "$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] | 2854 | 0 \ |
| 2855 | -c "client hello, adding session ticket extension" \ |
| 2856 | -s "found session ticket extension" \ |
| 2857 | -s "server hello, adding session ticket extension" \ |
| 2858 | -c "found session_ticket extension" \ |
| 2859 | -c "parse new session ticket" \ |
| 2860 | -S "session successfully restored from cache" \ |
| 2861 | -s "session successfully restored from ticket" \ |
| 2862 | -s "a session has been resumed" \ |
| 2863 | -c "a session has been resumed" |
| 2864 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2865 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2866 | "$O_SRV -dtls1" \ |
| 2867 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2868 | 0 \ |
| 2869 | -c "client hello, adding session ticket extension" \ |
| 2870 | -c "found session_ticket extension" \ |
| 2871 | -c "parse new session ticket" \ |
| 2872 | -c "a session has been resumed" |
| 2873 | |
| 2874 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2875 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2876 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2877 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2878 | rm -f $SESSION )" \ |
| 2879 | 0 \ |
| 2880 | -s "found session ticket extension" \ |
| 2881 | -s "server hello, adding session ticket extension" \ |
| 2882 | -S "session successfully restored from cache" \ |
| 2883 | -s "session successfully restored from ticket" \ |
| 2884 | -s "a session has been resumed" |
| 2885 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2886 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2887 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2888 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2889 | "$P_SRV debug_level=3 tickets=0" \ |
| 2890 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2891 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2892 | -c "client hello, adding session ticket extension" \ |
| 2893 | -s "found session ticket extension" \ |
| 2894 | -S "server hello, adding session ticket extension" \ |
| 2895 | -C "found session_ticket extension" \ |
| 2896 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2897 | -s "session successfully restored from cache" \ |
| 2898 | -S "session successfully restored from ticket" \ |
| 2899 | -s "a session has been resumed" \ |
| 2900 | -c "a session has been resumed" |
| 2901 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2902 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2903 | "$P_SRV debug_level=3 tickets=1" \ |
| 2904 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2905 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2906 | -C "client hello, adding session ticket extension" \ |
| 2907 | -S "found session ticket extension" \ |
| 2908 | -S "server hello, adding session ticket extension" \ |
| 2909 | -C "found session_ticket extension" \ |
| 2910 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2911 | -s "session successfully restored from cache" \ |
| 2912 | -S "session successfully restored from ticket" \ |
| 2913 | -s "a session has been resumed" \ |
| 2914 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2916 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2917 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2918 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2919 | 0 \ |
| 2920 | -S "session successfully restored from cache" \ |
| 2921 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2922 | -S "a session has been resumed" \ |
| 2923 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2925 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2926 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2927 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2928 | 0 \ |
| 2929 | -s "session successfully restored from cache" \ |
| 2930 | -S "session successfully restored from ticket" \ |
| 2931 | -s "a session has been resumed" \ |
| 2932 | -c "a session has been resumed" |
| 2933 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2934 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2935 | "$P_SRV debug_level=3 tickets=0" \ |
| 2936 | "$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] | 2937 | 0 \ |
| 2938 | -s "session successfully restored from cache" \ |
| 2939 | -S "session successfully restored from ticket" \ |
| 2940 | -s "a session has been resumed" \ |
| 2941 | -c "a session has been resumed" |
| 2942 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2943 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2944 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2945 | "$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] | 2946 | 0 \ |
| 2947 | -S "session successfully restored from cache" \ |
| 2948 | -S "session successfully restored from ticket" \ |
| 2949 | -S "a session has been resumed" \ |
| 2950 | -C "a session has been resumed" |
| 2951 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2952 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2953 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2954 | "$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] | 2955 | 0 \ |
| 2956 | -s "session successfully restored from cache" \ |
| 2957 | -S "session successfully restored from ticket" \ |
| 2958 | -s "a session has been resumed" \ |
| 2959 | -c "a session has been resumed" |
| 2960 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2961 | run_test "Session resume using cache: session copy" \ |
| 2962 | "$P_SRV debug_level=3 tickets=0" \ |
| 2963 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2964 | 0 \ |
| 2965 | -s "session successfully restored from cache" \ |
| 2966 | -S "session successfully restored from ticket" \ |
| 2967 | -s "a session has been resumed" \ |
| 2968 | -c "a session has been resumed" |
| 2969 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2970 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2971 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2972 | "( $O_CLI -sess_out $SESSION; \ |
| 2973 | $O_CLI -sess_in $SESSION; \ |
| 2974 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2975 | 0 \ |
| 2976 | -s "found session ticket extension" \ |
| 2977 | -S "server hello, adding session ticket extension" \ |
| 2978 | -s "session successfully restored from cache" \ |
| 2979 | -S "session successfully restored from ticket" \ |
| 2980 | -s "a session has been resumed" |
| 2981 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2982 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2983 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2984 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2985 | 0 \ |
| 2986 | -C "found session_ticket extension" \ |
| 2987 | -C "parse new session ticket" \ |
| 2988 | -c "a session has been resumed" |
| 2989 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2990 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2991 | |
| 2992 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2993 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2994 | "$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] | 2995 | 0 \ |
| 2996 | -c "client hello, adding session ticket extension" \ |
| 2997 | -s "found session ticket extension" \ |
| 2998 | -S "server hello, adding session ticket extension" \ |
| 2999 | -C "found session_ticket extension" \ |
| 3000 | -C "parse new session ticket" \ |
| 3001 | -s "session successfully restored from cache" \ |
| 3002 | -S "session successfully restored from ticket" \ |
| 3003 | -s "a session has been resumed" \ |
| 3004 | -c "a session has been resumed" |
| 3005 | |
| 3006 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3007 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3008 | "$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] | 3009 | 0 \ |
| 3010 | -C "client hello, adding session ticket extension" \ |
| 3011 | -S "found session ticket extension" \ |
| 3012 | -S "server hello, adding session ticket extension" \ |
| 3013 | -C "found session_ticket extension" \ |
| 3014 | -C "parse new session ticket" \ |
| 3015 | -s "session successfully restored from cache" \ |
| 3016 | -S "session successfully restored from ticket" \ |
| 3017 | -s "a session has been resumed" \ |
| 3018 | -c "a session has been resumed" |
| 3019 | |
| 3020 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3021 | "$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] | 3022 | "$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] | 3023 | 0 \ |
| 3024 | -S "session successfully restored from cache" \ |
| 3025 | -S "session successfully restored from ticket" \ |
| 3026 | -S "a session has been resumed" \ |
| 3027 | -C "a session has been resumed" |
| 3028 | |
| 3029 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3030 | "$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] | 3031 | "$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] | 3032 | 0 \ |
| 3033 | -s "session successfully restored from cache" \ |
| 3034 | -S "session successfully restored from ticket" \ |
| 3035 | -s "a session has been resumed" \ |
| 3036 | -c "a session has been resumed" |
| 3037 | |
| 3038 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3039 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3040 | "$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] | 3041 | 0 \ |
| 3042 | -s "session successfully restored from cache" \ |
| 3043 | -S "session successfully restored from ticket" \ |
| 3044 | -s "a session has been resumed" \ |
| 3045 | -c "a session has been resumed" |
| 3046 | |
| 3047 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3048 | "$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] | 3049 | "$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] | 3050 | 0 \ |
| 3051 | -S "session successfully restored from cache" \ |
| 3052 | -S "session successfully restored from ticket" \ |
| 3053 | -S "a session has been resumed" \ |
| 3054 | -C "a session has been resumed" |
| 3055 | |
| 3056 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3057 | "$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] | 3058 | "$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] | 3059 | 0 \ |
| 3060 | -s "session successfully restored from cache" \ |
| 3061 | -S "session successfully restored from ticket" \ |
| 3062 | -s "a session has been resumed" \ |
| 3063 | -c "a session has been resumed" |
| 3064 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3065 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3066 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3067 | "$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] | 3068 | 0 \ |
| 3069 | -s "session successfully restored from cache" \ |
| 3070 | -S "session successfully restored from ticket" \ |
| 3071 | -s "a session has been resumed" \ |
| 3072 | -c "a session has been resumed" |
| 3073 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3074 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3075 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 3076 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 3077 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 3078 | rm -f $SESSION )" \ |
| 3079 | 0 \ |
| 3080 | -s "found session ticket extension" \ |
| 3081 | -S "server hello, adding session ticket extension" \ |
| 3082 | -s "session successfully restored from cache" \ |
| 3083 | -S "session successfully restored from ticket" \ |
| 3084 | -s "a session has been resumed" |
| 3085 | |
| 3086 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3087 | "$O_SRV -dtls1" \ |
| 3088 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3089 | 0 \ |
| 3090 | -C "found session_ticket extension" \ |
| 3091 | -C "parse new session ticket" \ |
| 3092 | -c "a session has been resumed" |
| 3093 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3094 | # Tests for Max Fragment Length extension |
| 3095 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3096 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3097 | printf '%s defines MBEDTLS_SSL_MAX_CONTENT_LEN to be less than 4096. Fragment length tests will fail.\n' "${CONFIG_H}" |
Hanno Becker | 6428f8d | 2017-09-22 16:58:50 +0100 | [diff] [blame] | 3098 | exit 1 |
| 3099 | fi |
| 3100 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3101 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3102 | echo "Using non-default maximum content length $MAX_CONTENT_LEN" |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3103 | fi |
| 3104 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3105 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3106 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3107 | "$P_SRV debug_level=3" \ |
| 3108 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3109 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3110 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3111 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3112 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3113 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3114 | -C "client hello, adding max_fragment_length extension" \ |
| 3115 | -S "found max fragment length extension" \ |
| 3116 | -S "server hello, max_fragment_length extension" \ |
| 3117 | -C "found max_fragment_length extension" |
| 3118 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3119 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3120 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3121 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3122 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3123 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3124 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3125 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3126 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3127 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3128 | -C "client hello, adding max_fragment_length extension" \ |
| 3129 | -S "found max fragment length extension" \ |
| 3130 | -S "server hello, max_fragment_length extension" \ |
| 3131 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3132 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3133 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3134 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3135 | |
| 3136 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3137 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3138 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3139 | "$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] | 3140 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3141 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3142 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3143 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3144 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3145 | -C "client hello, adding max_fragment_length extension" \ |
| 3146 | -S "found max fragment length extension" \ |
| 3147 | -S "server hello, max_fragment_length extension" \ |
| 3148 | -C "found max_fragment_length extension" \ |
| 3149 | -c "fragment larger than.*maximum " |
| 3150 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3151 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3152 | # (session fragment length will be 16384 regardless of mbedtls |
| 3153 | # content length configuration.) |
| 3154 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3155 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3156 | run_test "Max fragment length: disabled, larger message" \ |
| 3157 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3158 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3159 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3160 | -C "Maximum input fragment length is 16384" \ |
| 3161 | -C "Maximum output fragment length is 16384" \ |
| 3162 | -S "Maximum input fragment length is 16384" \ |
| 3163 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3164 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3165 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3166 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3167 | |
| 3168 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3169 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 3170 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3171 | "$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] | 3172 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3173 | -C "Maximum input fragment length is 16384" \ |
| 3174 | -C "Maximum output fragment length is 16384" \ |
| 3175 | -S "Maximum input fragment length is 16384" \ |
| 3176 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3177 | -c "fragment larger than.*maximum " |
| 3178 | |
| 3179 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3180 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3181 | "$P_SRV debug_level=3" \ |
| 3182 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3183 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3184 | -c "Maximum input fragment length is 4096" \ |
| 3185 | -c "Maximum output fragment length is 4096" \ |
| 3186 | -s "Maximum input fragment length is 4096" \ |
| 3187 | -s "Maximum output fragment length is 4096" \ |
| 3188 | -c "client hello, adding max_fragment_length extension" \ |
| 3189 | -s "found max fragment length extension" \ |
| 3190 | -s "server hello, max_fragment_length extension" \ |
| 3191 | -c "found max_fragment_length extension" |
| 3192 | |
| 3193 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3194 | run_test "Max fragment length: client 512, server 1024" \ |
| 3195 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3196 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3197 | 0 \ |
| 3198 | -c "Maximum input fragment length is 512" \ |
| 3199 | -c "Maximum output fragment length is 512" \ |
| 3200 | -s "Maximum input fragment length is 512" \ |
| 3201 | -s "Maximum output fragment length is 512" \ |
| 3202 | -c "client hello, adding max_fragment_length extension" \ |
| 3203 | -s "found max fragment length extension" \ |
| 3204 | -s "server hello, max_fragment_length extension" \ |
| 3205 | -c "found max_fragment_length extension" |
| 3206 | |
| 3207 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3208 | run_test "Max fragment length: client 512, server 2048" \ |
| 3209 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3210 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3211 | 0 \ |
| 3212 | -c "Maximum input fragment length is 512" \ |
| 3213 | -c "Maximum output fragment length is 512" \ |
| 3214 | -s "Maximum input fragment length is 512" \ |
| 3215 | -s "Maximum output fragment length is 512" \ |
| 3216 | -c "client hello, adding max_fragment_length extension" \ |
| 3217 | -s "found max fragment length extension" \ |
| 3218 | -s "server hello, max_fragment_length extension" \ |
| 3219 | -c "found max_fragment_length extension" |
| 3220 | |
| 3221 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3222 | run_test "Max fragment length: client 512, server 4096" \ |
| 3223 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3224 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3225 | 0 \ |
| 3226 | -c "Maximum input fragment length is 512" \ |
| 3227 | -c "Maximum output fragment length is 512" \ |
| 3228 | -s "Maximum input fragment length is 512" \ |
| 3229 | -s "Maximum output fragment length is 512" \ |
| 3230 | -c "client hello, adding max_fragment_length extension" \ |
| 3231 | -s "found max fragment length extension" \ |
| 3232 | -s "server hello, max_fragment_length extension" \ |
| 3233 | -c "found max_fragment_length extension" |
| 3234 | |
| 3235 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3236 | run_test "Max fragment length: client 1024, server 512" \ |
| 3237 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3238 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3239 | 0 \ |
| 3240 | -c "Maximum input fragment length is 1024" \ |
| 3241 | -c "Maximum output fragment length is 1024" \ |
| 3242 | -s "Maximum input fragment length is 1024" \ |
| 3243 | -s "Maximum output fragment length is 512" \ |
| 3244 | -c "client hello, adding max_fragment_length extension" \ |
| 3245 | -s "found max fragment length extension" \ |
| 3246 | -s "server hello, max_fragment_length extension" \ |
| 3247 | -c "found max_fragment_length extension" |
| 3248 | |
| 3249 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3250 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3251 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3252 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3253 | 0 \ |
| 3254 | -c "Maximum input fragment length is 1024" \ |
| 3255 | -c "Maximum output fragment length is 1024" \ |
| 3256 | -s "Maximum input fragment length is 1024" \ |
| 3257 | -s "Maximum output fragment length is 1024" \ |
| 3258 | -c "client hello, adding max_fragment_length extension" \ |
| 3259 | -s "found max fragment length extension" \ |
| 3260 | -s "server hello, max_fragment_length extension" \ |
| 3261 | -c "found max_fragment_length extension" |
| 3262 | |
| 3263 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3264 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3265 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3266 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3267 | 0 \ |
| 3268 | -c "Maximum input fragment length is 1024" \ |
| 3269 | -c "Maximum output fragment length is 1024" \ |
| 3270 | -s "Maximum input fragment length is 1024" \ |
| 3271 | -s "Maximum output fragment length is 1024" \ |
| 3272 | -c "client hello, adding max_fragment_length extension" \ |
| 3273 | -s "found max fragment length extension" \ |
| 3274 | -s "server hello, max_fragment_length extension" \ |
| 3275 | -c "found max_fragment_length extension" |
| 3276 | |
| 3277 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3278 | run_test "Max fragment length: client 2048, server 512" \ |
| 3279 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3280 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3281 | 0 \ |
| 3282 | -c "Maximum input fragment length is 2048" \ |
| 3283 | -c "Maximum output fragment length is 2048" \ |
| 3284 | -s "Maximum input fragment length is 2048" \ |
| 3285 | -s "Maximum output fragment length is 512" \ |
| 3286 | -c "client hello, adding max_fragment_length extension" \ |
| 3287 | -s "found max fragment length extension" \ |
| 3288 | -s "server hello, max_fragment_length extension" \ |
| 3289 | -c "found max_fragment_length extension" |
| 3290 | |
| 3291 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3292 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3293 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3294 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3295 | 0 \ |
| 3296 | -c "Maximum input fragment length is 2048" \ |
| 3297 | -c "Maximum output fragment length is 2048" \ |
| 3298 | -s "Maximum input fragment length is 2048" \ |
| 3299 | -s "Maximum output fragment length is 1024" \ |
| 3300 | -c "client hello, adding max_fragment_length extension" \ |
| 3301 | -s "found max fragment length extension" \ |
| 3302 | -s "server hello, max_fragment_length extension" \ |
| 3303 | -c "found max_fragment_length extension" |
| 3304 | |
| 3305 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3306 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3307 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3308 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3309 | 0 \ |
| 3310 | -c "Maximum input fragment length is 2048" \ |
| 3311 | -c "Maximum output fragment length is 2048" \ |
| 3312 | -s "Maximum input fragment length is 2048" \ |
| 3313 | -s "Maximum output fragment length is 2048" \ |
| 3314 | -c "client hello, adding max_fragment_length extension" \ |
| 3315 | -s "found max fragment length extension" \ |
| 3316 | -s "server hello, max_fragment_length extension" \ |
| 3317 | -c "found max_fragment_length extension" |
| 3318 | |
| 3319 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3320 | run_test "Max fragment length: client 4096, server 512" \ |
| 3321 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3322 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3323 | 0 \ |
| 3324 | -c "Maximum input fragment length is 4096" \ |
| 3325 | -c "Maximum output fragment length is 4096" \ |
| 3326 | -s "Maximum input fragment length is 4096" \ |
| 3327 | -s "Maximum output fragment length is 512" \ |
| 3328 | -c "client hello, adding max_fragment_length extension" \ |
| 3329 | -s "found max fragment length extension" \ |
| 3330 | -s "server hello, max_fragment_length extension" \ |
| 3331 | -c "found max_fragment_length extension" |
| 3332 | |
| 3333 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3334 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3335 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3336 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3337 | 0 \ |
| 3338 | -c "Maximum input fragment length is 4096" \ |
| 3339 | -c "Maximum output fragment length is 4096" \ |
| 3340 | -s "Maximum input fragment length is 4096" \ |
| 3341 | -s "Maximum output fragment length is 1024" \ |
| 3342 | -c "client hello, adding max_fragment_length extension" \ |
| 3343 | -s "found max fragment length extension" \ |
| 3344 | -s "server hello, max_fragment_length extension" \ |
| 3345 | -c "found max_fragment_length extension" |
| 3346 | |
| 3347 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3348 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3349 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3350 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3351 | 0 \ |
| 3352 | -c "Maximum input fragment length is 4096" \ |
| 3353 | -c "Maximum output fragment length is 4096" \ |
| 3354 | -s "Maximum input fragment length is 4096" \ |
| 3355 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3356 | -c "client hello, adding max_fragment_length extension" \ |
| 3357 | -s "found max fragment length extension" \ |
| 3358 | -s "server hello, max_fragment_length extension" \ |
| 3359 | -c "found max_fragment_length extension" |
| 3360 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3362 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3363 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3364 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3365 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3366 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3367 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3368 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3369 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3370 | -C "client hello, adding max_fragment_length extension" \ |
| 3371 | -S "found max fragment length extension" \ |
| 3372 | -S "server hello, max_fragment_length extension" \ |
| 3373 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3374 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3375 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3376 | requires_gnutls |
| 3377 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3378 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3379 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3380 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3381 | -c "Maximum input fragment length is 4096" \ |
| 3382 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3383 | -c "client hello, adding max_fragment_length extension" \ |
| 3384 | -c "found max_fragment_length extension" |
| 3385 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3387 | run_test "Max fragment length: client, message just fits" \ |
| 3388 | "$P_SRV debug_level=3" \ |
| 3389 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3390 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3391 | -c "Maximum input fragment length is 2048" \ |
| 3392 | -c "Maximum output fragment length is 2048" \ |
| 3393 | -s "Maximum input fragment length is 2048" \ |
| 3394 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3395 | -c "client hello, adding max_fragment_length extension" \ |
| 3396 | -s "found max fragment length extension" \ |
| 3397 | -s "server hello, max_fragment_length extension" \ |
| 3398 | -c "found max_fragment_length extension" \ |
| 3399 | -c "2048 bytes written in 1 fragments" \ |
| 3400 | -s "2048 bytes read" |
| 3401 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3402 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3403 | run_test "Max fragment length: client, larger message" \ |
| 3404 | "$P_SRV debug_level=3" \ |
| 3405 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3406 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3407 | -c "Maximum input fragment length is 2048" \ |
| 3408 | -c "Maximum output fragment length is 2048" \ |
| 3409 | -s "Maximum input fragment length is 2048" \ |
| 3410 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3411 | -c "client hello, adding max_fragment_length extension" \ |
| 3412 | -s "found max fragment length extension" \ |
| 3413 | -s "server hello, max_fragment_length extension" \ |
| 3414 | -c "found max_fragment_length extension" \ |
| 3415 | -c "2345 bytes written in 2 fragments" \ |
| 3416 | -s "2048 bytes read" \ |
| 3417 | -s "297 bytes read" |
| 3418 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3419 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3420 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3421 | "$P_SRV debug_level=3 dtls=1" \ |
| 3422 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3423 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3424 | -c "Maximum input fragment length is 2048" \ |
| 3425 | -c "Maximum output fragment length is 2048" \ |
| 3426 | -s "Maximum input fragment length is 2048" \ |
| 3427 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3428 | -c "client hello, adding max_fragment_length extension" \ |
| 3429 | -s "found max fragment length extension" \ |
| 3430 | -s "server hello, max_fragment_length extension" \ |
| 3431 | -c "found max_fragment_length extension" \ |
| 3432 | -c "fragment larger than.*maximum" |
| 3433 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3434 | # Tests for renegotiation |
| 3435 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3436 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3437 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3438 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3439 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3440 | 0 \ |
| 3441 | -C "client hello, adding renegotiation extension" \ |
| 3442 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3443 | -S "found renegotiation extension" \ |
| 3444 | -s "server hello, secure renegotiation extension" \ |
| 3445 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3446 | -C "=> renegotiate" \ |
| 3447 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3448 | -S "write hello request" |
| 3449 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3450 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3451 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3452 | "$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] | 3453 | "$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] | 3454 | 0 \ |
| 3455 | -c "client hello, adding renegotiation extension" \ |
| 3456 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3457 | -s "found renegotiation extension" \ |
| 3458 | -s "server hello, secure renegotiation extension" \ |
| 3459 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3460 | -c "=> renegotiate" \ |
| 3461 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3462 | -S "write hello request" |
| 3463 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3464 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3465 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3466 | "$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] | 3467 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3468 | 0 \ |
| 3469 | -c "client hello, adding renegotiation extension" \ |
| 3470 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3471 | -s "found renegotiation extension" \ |
| 3472 | -s "server hello, secure renegotiation extension" \ |
| 3473 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3474 | -c "=> renegotiate" \ |
| 3475 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3476 | -s "write hello request" |
| 3477 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3478 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3479 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3480 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3481 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3482 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3483 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3484 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3485 | 0 \ |
| 3486 | -c "client hello, adding renegotiation extension" \ |
| 3487 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3488 | -s "found renegotiation extension" \ |
| 3489 | -s "server hello, secure renegotiation extension" \ |
| 3490 | -c "found renegotiation extension" \ |
| 3491 | -c "=> renegotiate" \ |
| 3492 | -s "=> renegotiate" \ |
| 3493 | -S "write hello request" \ |
| 3494 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3495 | |
| 3496 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3497 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3498 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3500 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3501 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3502 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3503 | 0 \ |
| 3504 | -c "client hello, adding renegotiation extension" \ |
| 3505 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3506 | -s "found renegotiation extension" \ |
| 3507 | -s "server hello, secure renegotiation extension" \ |
| 3508 | -c "found renegotiation extension" \ |
| 3509 | -c "=> renegotiate" \ |
| 3510 | -s "=> renegotiate" \ |
| 3511 | -s "write hello request" \ |
| 3512 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3513 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3514 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3515 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3516 | "$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] | 3517 | "$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] | 3518 | 0 \ |
| 3519 | -c "client hello, adding renegotiation extension" \ |
| 3520 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3521 | -s "found renegotiation extension" \ |
| 3522 | -s "server hello, secure renegotiation extension" \ |
| 3523 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3524 | -c "=> renegotiate" \ |
| 3525 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3526 | -s "write hello request" |
| 3527 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3528 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3529 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3530 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3531 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3532 | "$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" \ |
| 3533 | 0 \ |
| 3534 | -c "Maximum input fragment length is 2048" \ |
| 3535 | -c "Maximum output fragment length is 2048" \ |
| 3536 | -s "Maximum input fragment length is 2048" \ |
| 3537 | -s "Maximum output fragment length is 512" \ |
| 3538 | -c "client hello, adding max_fragment_length extension" \ |
| 3539 | -s "found max fragment length extension" \ |
| 3540 | -s "server hello, max_fragment_length extension" \ |
| 3541 | -c "found max_fragment_length extension" \ |
| 3542 | -c "client hello, adding renegotiation extension" \ |
| 3543 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3544 | -s "found renegotiation extension" \ |
| 3545 | -s "server hello, secure renegotiation extension" \ |
| 3546 | -c "found renegotiation extension" \ |
| 3547 | -c "=> renegotiate" \ |
| 3548 | -s "=> renegotiate" \ |
| 3549 | -s "write hello request" |
| 3550 | |
| 3551 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3552 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3553 | "$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] | 3554 | "$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] | 3555 | 1 \ |
| 3556 | -c "client hello, adding renegotiation extension" \ |
| 3557 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3558 | -S "found renegotiation extension" \ |
| 3559 | -s "server hello, secure renegotiation extension" \ |
| 3560 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3561 | -c "=> renegotiate" \ |
| 3562 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3563 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3564 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3565 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3566 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3567 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3568 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3569 | "$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] | 3570 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3571 | 0 \ |
| 3572 | -C "client hello, adding renegotiation extension" \ |
| 3573 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3574 | -S "found renegotiation extension" \ |
| 3575 | -s "server hello, secure renegotiation extension" \ |
| 3576 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3577 | -C "=> renegotiate" \ |
| 3578 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3579 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3580 | -S "SSL - An unexpected message was received from our peer" \ |
| 3581 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3582 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3583 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3584 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3585 | "$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] | 3586 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3587 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3588 | 0 \ |
| 3589 | -C "client hello, adding renegotiation extension" \ |
| 3590 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3591 | -S "found renegotiation extension" \ |
| 3592 | -s "server hello, secure renegotiation extension" \ |
| 3593 | -c "found renegotiation extension" \ |
| 3594 | -C "=> renegotiate" \ |
| 3595 | -S "=> renegotiate" \ |
| 3596 | -s "write hello request" \ |
| 3597 | -S "SSL - An unexpected message was received from our peer" \ |
| 3598 | -S "failed" |
| 3599 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3600 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3601 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3602 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3603 | "$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] | 3604 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3605 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3606 | 0 \ |
| 3607 | -C "client hello, adding renegotiation extension" \ |
| 3608 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3609 | -S "found renegotiation extension" \ |
| 3610 | -s "server hello, secure renegotiation extension" \ |
| 3611 | -c "found renegotiation extension" \ |
| 3612 | -C "=> renegotiate" \ |
| 3613 | -S "=> renegotiate" \ |
| 3614 | -s "write hello request" \ |
| 3615 | -S "SSL - An unexpected message was received from our peer" \ |
| 3616 | -S "failed" |
| 3617 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3618 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3619 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3620 | "$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] | 3621 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3622 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3623 | 0 \ |
| 3624 | -C "client hello, adding renegotiation extension" \ |
| 3625 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3626 | -S "found renegotiation extension" \ |
| 3627 | -s "server hello, secure renegotiation extension" \ |
| 3628 | -c "found renegotiation extension" \ |
| 3629 | -C "=> renegotiate" \ |
| 3630 | -S "=> renegotiate" \ |
| 3631 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3632 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3633 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3634 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3635 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3636 | "$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] | 3637 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3638 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3639 | 0 \ |
| 3640 | -c "client hello, adding renegotiation extension" \ |
| 3641 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3642 | -s "found renegotiation extension" \ |
| 3643 | -s "server hello, secure renegotiation extension" \ |
| 3644 | -c "found renegotiation extension" \ |
| 3645 | -c "=> renegotiate" \ |
| 3646 | -s "=> renegotiate" \ |
| 3647 | -s "write hello request" \ |
| 3648 | -S "SSL - An unexpected message was received from our peer" \ |
| 3649 | -S "failed" |
| 3650 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3651 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3652 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3653 | "$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] | 3654 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3655 | 0 \ |
| 3656 | -C "client hello, adding renegotiation extension" \ |
| 3657 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3658 | -S "found renegotiation extension" \ |
| 3659 | -s "server hello, secure renegotiation extension" \ |
| 3660 | -c "found renegotiation extension" \ |
| 3661 | -S "record counter limit reached: renegotiate" \ |
| 3662 | -C "=> renegotiate" \ |
| 3663 | -S "=> renegotiate" \ |
| 3664 | -S "write hello request" \ |
| 3665 | -S "SSL - An unexpected message was received from our peer" \ |
| 3666 | -S "failed" |
| 3667 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3668 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3669 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3670 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3671 | "$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] | 3672 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3673 | 0 \ |
| 3674 | -c "client hello, adding renegotiation extension" \ |
| 3675 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3676 | -s "found renegotiation extension" \ |
| 3677 | -s "server hello, secure renegotiation extension" \ |
| 3678 | -c "found renegotiation extension" \ |
| 3679 | -s "record counter limit reached: renegotiate" \ |
| 3680 | -c "=> renegotiate" \ |
| 3681 | -s "=> renegotiate" \ |
| 3682 | -s "write hello request" \ |
| 3683 | -S "SSL - An unexpected message was received from our peer" \ |
| 3684 | -S "failed" |
| 3685 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3686 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3687 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3688 | "$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] | 3689 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3690 | 0 \ |
| 3691 | -c "client hello, adding renegotiation extension" \ |
| 3692 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3693 | -s "found renegotiation extension" \ |
| 3694 | -s "server hello, secure renegotiation extension" \ |
| 3695 | -c "found renegotiation extension" \ |
| 3696 | -s "record counter limit reached: renegotiate" \ |
| 3697 | -c "=> renegotiate" \ |
| 3698 | -s "=> renegotiate" \ |
| 3699 | -s "write hello request" \ |
| 3700 | -S "SSL - An unexpected message was received from our peer" \ |
| 3701 | -S "failed" |
| 3702 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3703 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3704 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3705 | "$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] | 3706 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3707 | 0 \ |
| 3708 | -C "client hello, adding renegotiation extension" \ |
| 3709 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3710 | -S "found renegotiation extension" \ |
| 3711 | -s "server hello, secure renegotiation extension" \ |
| 3712 | -c "found renegotiation extension" \ |
| 3713 | -S "record counter limit reached: renegotiate" \ |
| 3714 | -C "=> renegotiate" \ |
| 3715 | -S "=> renegotiate" \ |
| 3716 | -S "write hello request" \ |
| 3717 | -S "SSL - An unexpected message was received from our peer" \ |
| 3718 | -S "failed" |
| 3719 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3720 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3721 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3722 | "$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] | 3723 | "$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] | 3724 | 0 \ |
| 3725 | -c "client hello, adding renegotiation extension" \ |
| 3726 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3727 | -s "found renegotiation extension" \ |
| 3728 | -s "server hello, secure renegotiation extension" \ |
| 3729 | -c "found renegotiation extension" \ |
| 3730 | -c "=> renegotiate" \ |
| 3731 | -s "=> renegotiate" \ |
| 3732 | -S "write hello request" |
| 3733 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3734 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3735 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3736 | "$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] | 3737 | "$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] | 3738 | 0 \ |
| 3739 | -c "client hello, adding renegotiation extension" \ |
| 3740 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3741 | -s "found renegotiation extension" \ |
| 3742 | -s "server hello, secure renegotiation extension" \ |
| 3743 | -c "found renegotiation extension" \ |
| 3744 | -c "=> renegotiate" \ |
| 3745 | -s "=> renegotiate" \ |
| 3746 | -s "write hello request" |
| 3747 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3748 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3749 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3750 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3751 | "$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] | 3752 | 0 \ |
| 3753 | -c "client hello, adding renegotiation extension" \ |
| 3754 | -c "found renegotiation extension" \ |
| 3755 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3756 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3757 | -C "error" \ |
| 3758 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3759 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3760 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3761 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3762 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3763 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3764 | "$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] | 3765 | 0 \ |
| 3766 | -c "client hello, adding renegotiation extension" \ |
| 3767 | -c "found renegotiation extension" \ |
| 3768 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3769 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3770 | -C "error" \ |
| 3771 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3772 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3773 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3774 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3775 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3776 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3777 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3778 | 1 \ |
| 3779 | -c "client hello, adding renegotiation extension" \ |
| 3780 | -C "found renegotiation extension" \ |
| 3781 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3782 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3783 | -c "error" \ |
| 3784 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3785 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3786 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3787 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3788 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3789 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3790 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3791 | allow_legacy=0" \ |
| 3792 | 1 \ |
| 3793 | -c "client hello, adding renegotiation extension" \ |
| 3794 | -C "found renegotiation extension" \ |
| 3795 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3796 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3797 | -c "error" \ |
| 3798 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3799 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3800 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3801 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3802 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3803 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3804 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3805 | allow_legacy=1" \ |
| 3806 | 0 \ |
| 3807 | -c "client hello, adding renegotiation extension" \ |
| 3808 | -C "found renegotiation extension" \ |
| 3809 | -c "=> renegotiate" \ |
| 3810 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3811 | -C "error" \ |
| 3812 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3813 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3814 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3815 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3816 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3817 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3818 | 0 \ |
| 3819 | -c "client hello, adding renegotiation extension" \ |
| 3820 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3821 | -s "found renegotiation extension" \ |
| 3822 | -s "server hello, secure renegotiation extension" \ |
| 3823 | -c "found renegotiation extension" \ |
| 3824 | -c "=> renegotiate" \ |
| 3825 | -s "=> renegotiate" \ |
| 3826 | -S "write hello request" |
| 3827 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3828 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3829 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3830 | "$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] | 3831 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3832 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3833 | 0 \ |
| 3834 | -c "client hello, adding renegotiation extension" \ |
| 3835 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3836 | -s "found renegotiation extension" \ |
| 3837 | -s "server hello, secure renegotiation extension" \ |
| 3838 | -c "found renegotiation extension" \ |
| 3839 | -c "=> renegotiate" \ |
| 3840 | -s "=> renegotiate" \ |
| 3841 | -s "write hello request" |
| 3842 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3843 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3844 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3845 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3846 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3847 | 0 \ |
| 3848 | -c "client hello, adding renegotiation extension" \ |
| 3849 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3850 | -s "found renegotiation extension" \ |
| 3851 | -s "server hello, secure renegotiation extension" \ |
| 3852 | -s "record counter limit reached: renegotiate" \ |
| 3853 | -c "=> renegotiate" \ |
| 3854 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3855 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3856 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3857 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3858 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3859 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3860 | "$G_SRV -u --mtu 4096" \ |
| 3861 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3862 | 0 \ |
| 3863 | -c "client hello, adding renegotiation extension" \ |
| 3864 | -c "found renegotiation extension" \ |
| 3865 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3866 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3867 | -C "error" \ |
| 3868 | -s "Extra-header:" |
| 3869 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3870 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3871 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3872 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3873 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3874 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3875 | "$P_CLI debug_level=3" \ |
| 3876 | 0 \ |
| 3877 | -c "found renegotiation extension" \ |
| 3878 | -C "error" \ |
| 3879 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3880 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3881 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3882 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3883 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3884 | "$P_CLI debug_level=3" \ |
| 3885 | 0 \ |
| 3886 | -C "found renegotiation extension" \ |
| 3887 | -C "error" \ |
| 3888 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3889 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3890 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3891 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3892 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3893 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3894 | 1 \ |
| 3895 | -C "found renegotiation extension" \ |
| 3896 | -c "error" \ |
| 3897 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3898 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3899 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3900 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3901 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3902 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3903 | 0 \ |
| 3904 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3905 | -s "server hello, secure renegotiation extension" |
| 3906 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3907 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3908 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3909 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3910 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3911 | 0 \ |
| 3912 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3913 | -S "server hello, secure renegotiation extension" |
| 3914 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3915 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3916 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3917 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3918 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3919 | 1 \ |
| 3920 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3921 | -S "server hello, secure renegotiation extension" |
| 3922 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3923 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3924 | |
| 3925 | requires_gnutls |
| 3926 | run_test "DER format: no trailing bytes" \ |
| 3927 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3928 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3929 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3930 | 0 \ |
| 3931 | -c "Handshake was completed" \ |
| 3932 | |
| 3933 | requires_gnutls |
| 3934 | run_test "DER format: with a trailing zero byte" \ |
| 3935 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3936 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3937 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3938 | 0 \ |
| 3939 | -c "Handshake was completed" \ |
| 3940 | |
| 3941 | requires_gnutls |
| 3942 | run_test "DER format: with a trailing random byte" \ |
| 3943 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3944 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3945 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3946 | 0 \ |
| 3947 | -c "Handshake was completed" \ |
| 3948 | |
| 3949 | requires_gnutls |
| 3950 | run_test "DER format: with 2 trailing random bytes" \ |
| 3951 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3952 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3953 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3954 | 0 \ |
| 3955 | -c "Handshake was completed" \ |
| 3956 | |
| 3957 | requires_gnutls |
| 3958 | run_test "DER format: with 4 trailing random bytes" \ |
| 3959 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3960 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3961 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3962 | 0 \ |
| 3963 | -c "Handshake was completed" \ |
| 3964 | |
| 3965 | requires_gnutls |
| 3966 | run_test "DER format: with 8 trailing random bytes" \ |
| 3967 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3968 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3969 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3970 | 0 \ |
| 3971 | -c "Handshake was completed" \ |
| 3972 | |
| 3973 | requires_gnutls |
| 3974 | run_test "DER format: with 9 trailing random bytes" \ |
| 3975 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3976 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3977 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3978 | 0 \ |
| 3979 | -c "Handshake was completed" \ |
| 3980 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3981 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3982 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3983 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3984 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3985 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3986 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3987 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3988 | 1 \ |
| 3989 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3990 | -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] | 3991 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3992 | -c "X509 - Certificate verification failed" |
| 3993 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3994 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3995 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3996 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3997 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3998 | 0 \ |
| 3999 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4000 | -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] | 4001 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4002 | -C "X509 - Certificate verification failed" |
| 4003 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4004 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4005 | "$P_SRV" \ |
| 4006 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4007 | 0 \ |
| 4008 | -c "x509_verify_cert() returned" \ |
| 4009 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4010 | -c "! Certificate verification flags"\ |
| 4011 | -C "! mbedtls_ssl_handshake returned" \ |
| 4012 | -C "X509 - Certificate verification failed" \ |
| 4013 | -C "SSL - No CA Chain is set, but required to operate" |
| 4014 | |
| 4015 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4016 | "$P_SRV" \ |
| 4017 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4018 | 1 \ |
| 4019 | -c "x509_verify_cert() returned" \ |
| 4020 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4021 | -c "! Certificate verification flags"\ |
| 4022 | -c "! mbedtls_ssl_handshake returned" \ |
| 4023 | -c "SSL - No CA Chain is set, but required to operate" |
| 4024 | |
| 4025 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4026 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4027 | # the client informs the server about the supported curves - it does, though, in the |
| 4028 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4029 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4030 | # different means to have the server ignoring the client's supported curve list. |
| 4031 | |
| 4032 | requires_config_enabled MBEDTLS_ECP_C |
| 4033 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4034 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4035 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4036 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4037 | 1 \ |
| 4038 | -c "bad certificate (EC key curve)"\ |
| 4039 | -c "! Certificate verification flags"\ |
| 4040 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4041 | |
| 4042 | requires_config_enabled MBEDTLS_ECP_C |
| 4043 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4044 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4045 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4046 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4047 | 1 \ |
| 4048 | -c "bad certificate (EC key curve)"\ |
| 4049 | -c "! Certificate verification flags"\ |
| 4050 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4051 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4052 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4053 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4054 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4055 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4056 | 0 \ |
| 4057 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4058 | -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] | 4059 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4060 | -C "X509 - Certificate verification failed" |
| 4061 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4062 | run_test "Authentication: client SHA256, server required" \ |
| 4063 | "$P_SRV auth_mode=required" \ |
| 4064 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4065 | key_file=data_files/server6.key \ |
| 4066 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4067 | 0 \ |
| 4068 | -c "Supported Signature Algorithm found: 4," \ |
| 4069 | -c "Supported Signature Algorithm found: 5," |
| 4070 | |
| 4071 | run_test "Authentication: client SHA384, server required" \ |
| 4072 | "$P_SRV auth_mode=required" \ |
| 4073 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4074 | key_file=data_files/server6.key \ |
| 4075 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4076 | 0 \ |
| 4077 | -c "Supported Signature Algorithm found: 4," \ |
| 4078 | -c "Supported Signature Algorithm found: 5," |
| 4079 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4080 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4081 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4082 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4083 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4084 | key_file=data_files/server5.key" \ |
| 4085 | 1 \ |
| 4086 | -S "skip write certificate request" \ |
| 4087 | -C "skip parse certificate request" \ |
| 4088 | -c "got a certificate request" \ |
| 4089 | -c "got no certificate to send" \ |
| 4090 | -S "x509_verify_cert() returned" \ |
| 4091 | -s "client has no certificate" \ |
| 4092 | -s "! mbedtls_ssl_handshake returned" \ |
| 4093 | -c "! mbedtls_ssl_handshake returned" \ |
| 4094 | -s "No client certification received from the client, but required by the authentication mode" |
| 4095 | |
| 4096 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4097 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4098 | "$P_CLI debug_level=3 crt_file=none \ |
| 4099 | key_file=data_files/server5.key" \ |
| 4100 | 1 \ |
| 4101 | -S "skip write certificate request" \ |
| 4102 | -C "skip parse certificate request" \ |
| 4103 | -c "got a certificate request" \ |
| 4104 | -c "= write certificate$" \ |
| 4105 | -C "skip write certificate$" \ |
| 4106 | -S "x509_verify_cert() returned" \ |
| 4107 | -s "client has no certificate" \ |
| 4108 | -s "! mbedtls_ssl_handshake returned" \ |
| 4109 | -c "! mbedtls_ssl_handshake returned" \ |
| 4110 | -s "No client certification received from the client, but required by the authentication mode" |
| 4111 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4112 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4113 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4114 | "$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] | 4115 | key_file=data_files/server5.key" \ |
| 4116 | 1 \ |
| 4117 | -S "skip write certificate request" \ |
| 4118 | -C "skip parse certificate request" \ |
| 4119 | -c "got a certificate request" \ |
| 4120 | -C "skip write certificate" \ |
| 4121 | -C "skip write certificate verify" \ |
| 4122 | -S "skip parse certificate verify" \ |
| 4123 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4124 | -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] | 4125 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4126 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4127 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4128 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4129 | # We don't check that the client receives the alert because it might |
| 4130 | # detect that its write end of the connection is closed and abort |
| 4131 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4132 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4133 | run_test "Authentication: client cert not trusted, server required" \ |
| 4134 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4135 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4136 | key_file=data_files/server5.key" \ |
| 4137 | 1 \ |
| 4138 | -S "skip write certificate request" \ |
| 4139 | -C "skip parse certificate request" \ |
| 4140 | -c "got a certificate request" \ |
| 4141 | -C "skip write certificate" \ |
| 4142 | -C "skip write certificate verify" \ |
| 4143 | -S "skip parse certificate verify" \ |
| 4144 | -s "x509_verify_cert() returned" \ |
| 4145 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4146 | -s "! mbedtls_ssl_handshake returned" \ |
| 4147 | -c "! mbedtls_ssl_handshake returned" \ |
| 4148 | -s "X509 - Certificate verification failed" |
| 4149 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4150 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4151 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4152 | "$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] | 4153 | key_file=data_files/server5.key" \ |
| 4154 | 0 \ |
| 4155 | -S "skip write certificate request" \ |
| 4156 | -C "skip parse certificate request" \ |
| 4157 | -c "got a certificate request" \ |
| 4158 | -C "skip write certificate" \ |
| 4159 | -C "skip write certificate verify" \ |
| 4160 | -S "skip parse certificate verify" \ |
| 4161 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4162 | -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] | 4163 | -S "! mbedtls_ssl_handshake returned" \ |
| 4164 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4165 | -S "X509 - Certificate verification failed" |
| 4166 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4167 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4168 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4169 | "$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] | 4170 | key_file=data_files/server5.key" \ |
| 4171 | 0 \ |
| 4172 | -s "skip write certificate request" \ |
| 4173 | -C "skip parse certificate request" \ |
| 4174 | -c "got no certificate request" \ |
| 4175 | -c "skip write certificate" \ |
| 4176 | -c "skip write certificate verify" \ |
| 4177 | -s "skip parse certificate verify" \ |
| 4178 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4179 | -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] | 4180 | -S "! mbedtls_ssl_handshake returned" \ |
| 4181 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4182 | -S "X509 - Certificate verification failed" |
| 4183 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4184 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4185 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4186 | "$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] | 4187 | 0 \ |
| 4188 | -S "skip write certificate request" \ |
| 4189 | -C "skip parse certificate request" \ |
| 4190 | -c "got a certificate request" \ |
| 4191 | -C "skip write certificate$" \ |
| 4192 | -C "got no certificate to send" \ |
| 4193 | -S "SSLv3 client has no certificate" \ |
| 4194 | -c "skip write certificate verify" \ |
| 4195 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4196 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4197 | -S "! mbedtls_ssl_handshake returned" \ |
| 4198 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4199 | -S "X509 - Certificate verification failed" |
| 4200 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4201 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4202 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4203 | "$O_CLI" \ |
| 4204 | 0 \ |
| 4205 | -S "skip write certificate request" \ |
| 4206 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4207 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4208 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4209 | -S "X509 - Certificate verification failed" |
| 4210 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4211 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4212 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4213 | "$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] | 4214 | 0 \ |
| 4215 | -C "skip parse certificate request" \ |
| 4216 | -c "got a certificate request" \ |
| 4217 | -C "skip write certificate$" \ |
| 4218 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4219 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4220 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4221 | run_test "Authentication: client no cert, openssl server required" \ |
| 4222 | "$O_SRV -Verify 10" \ |
| 4223 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4224 | 1 \ |
| 4225 | -C "skip parse certificate request" \ |
| 4226 | -c "got a certificate request" \ |
| 4227 | -C "skip write certificate$" \ |
| 4228 | -c "skip write certificate verify" \ |
| 4229 | -c "! mbedtls_ssl_handshake returned" |
| 4230 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4231 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4232 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4233 | "$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] | 4234 | "$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] | 4235 | 0 \ |
| 4236 | -S "skip write certificate request" \ |
| 4237 | -C "skip parse certificate request" \ |
| 4238 | -c "got a certificate request" \ |
| 4239 | -C "skip write certificate$" \ |
| 4240 | -c "skip write certificate verify" \ |
| 4241 | -c "got no certificate to send" \ |
| 4242 | -s "SSLv3 client has no certificate" \ |
| 4243 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4244 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4245 | -S "! mbedtls_ssl_handshake returned" \ |
| 4246 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4247 | -S "X509 - Certificate verification failed" |
| 4248 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 4249 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 4250 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4251 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4252 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 4253 | 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] | 4254 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4255 | if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 4256 | cat <<EOF |
| 4257 | ${CONFIG_H} contains a value for the configuration of |
| 4258 | MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script's |
| 4259 | test value of ${MAX_IM_CA}. |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4260 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 4261 | The tests assume this value and if it changes, the tests in this |
| 4262 | script should also be adjusted. |
| 4263 | EOF |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4264 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4265 | fi |
| 4266 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4267 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4268 | run_test "Authentication: server max_int chain, client default" \ |
| 4269 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4270 | key_file=data_files/dir-maxpath/09.key" \ |
| 4271 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4272 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4273 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4274 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4275 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4276 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4277 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4278 | key_file=data_files/dir-maxpath/10.key" \ |
| 4279 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4280 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4281 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4282 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4283 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4284 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4285 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4286 | key_file=data_files/dir-maxpath/10.key" \ |
| 4287 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4288 | auth_mode=optional" \ |
| 4289 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4290 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4291 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4292 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4293 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4294 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4295 | key_file=data_files/dir-maxpath/10.key" \ |
| 4296 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4297 | auth_mode=none" \ |
| 4298 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4299 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4300 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4301 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4302 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4303 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4304 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4305 | key_file=data_files/dir-maxpath/10.key" \ |
| 4306 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4307 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4308 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4309 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4310 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4311 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4312 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4313 | key_file=data_files/dir-maxpath/10.key" \ |
| 4314 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4315 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4316 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4317 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4318 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4319 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4320 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4321 | key_file=data_files/dir-maxpath/10.key" \ |
| 4322 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4323 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4324 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4325 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4326 | run_test "Authentication: client max_int chain, server required" \ |
| 4327 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4328 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4329 | key_file=data_files/dir-maxpath/09.key" \ |
| 4330 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4331 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4332 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4333 | # Tests for CA list in CertificateRequest messages |
| 4334 | |
| 4335 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4336 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4337 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4338 | key_file=data_files/server6.key" \ |
| 4339 | 0 \ |
| 4340 | -s "requested DN" |
| 4341 | |
| 4342 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4343 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4344 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4345 | key_file=data_files/server6.key" \ |
| 4346 | 0 \ |
| 4347 | -S "requested DN" |
| 4348 | |
| 4349 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4350 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4351 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4352 | key_file=data_files/server5.key" \ |
| 4353 | 1 \ |
| 4354 | -S "requested DN" \ |
| 4355 | -s "x509_verify_cert() returned" \ |
| 4356 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4357 | -s "! mbedtls_ssl_handshake returned" \ |
| 4358 | -c "! mbedtls_ssl_handshake returned" \ |
| 4359 | -s "X509 - Certificate verification failed" |
| 4360 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4361 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4362 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4363 | |
| 4364 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4365 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4366 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4367 | key_file=data_files/server5.key" \ |
| 4368 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4369 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4370 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4371 | -c "x509_verify_cert() returned" \ |
| 4372 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4373 | -c "! mbedtls_ssl_handshake returned" \ |
| 4374 | -c "X509 - Certificate verification failed" |
| 4375 | |
| 4376 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4377 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4378 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4379 | key_file=data_files/server5.key" \ |
| 4380 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4381 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4382 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4383 | -c "x509_verify_cert() returned" \ |
| 4384 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4385 | -C "! mbedtls_ssl_handshake returned" \ |
| 4386 | -C "X509 - Certificate verification failed" |
| 4387 | |
| 4388 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4389 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4390 | # the client informs the server about the supported curves - it does, though, in the |
| 4391 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4392 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4393 | # different means to have the server ignoring the client's supported curve list. |
| 4394 | |
| 4395 | requires_config_enabled MBEDTLS_ECP_C |
| 4396 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4397 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4398 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4399 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4400 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4401 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4402 | -c "use CA callback for X.509 CRT verification" \ |
| 4403 | -c "bad certificate (EC key curve)" \ |
| 4404 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4405 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4406 | |
| 4407 | requires_config_enabled MBEDTLS_ECP_C |
| 4408 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4409 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4410 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4411 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4412 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4413 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4414 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4415 | -c "bad certificate (EC key curve)"\ |
| 4416 | -c "! Certificate verification flags"\ |
| 4417 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4418 | |
| 4419 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4420 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4421 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4422 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4423 | key_file=data_files/server6.key \ |
| 4424 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4425 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4426 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4427 | -c "Supported Signature Algorithm found: 4," \ |
| 4428 | -c "Supported Signature Algorithm found: 5," |
| 4429 | |
| 4430 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4431 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4432 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4433 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4434 | key_file=data_files/server6.key \ |
| 4435 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4436 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4437 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4438 | -c "Supported Signature Algorithm found: 4," \ |
| 4439 | -c "Supported Signature Algorithm found: 5," |
| 4440 | |
| 4441 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4442 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4443 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4444 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4445 | key_file=data_files/server5.key" \ |
| 4446 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4447 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4448 | -S "skip write certificate request" \ |
| 4449 | -C "skip parse certificate request" \ |
| 4450 | -c "got a certificate request" \ |
| 4451 | -C "skip write certificate" \ |
| 4452 | -C "skip write certificate verify" \ |
| 4453 | -S "skip parse certificate verify" \ |
| 4454 | -s "x509_verify_cert() returned" \ |
| 4455 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4456 | -s "! mbedtls_ssl_handshake returned" \ |
| 4457 | -s "send alert level=2 message=48" \ |
| 4458 | -c "! mbedtls_ssl_handshake returned" \ |
| 4459 | -s "X509 - Certificate verification failed" |
| 4460 | # We don't check that the client receives the alert because it might |
| 4461 | # detect that its write end of the connection is closed and abort |
| 4462 | # before reading the alert message. |
| 4463 | |
| 4464 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4465 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4466 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4467 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4468 | key_file=data_files/server5.key" \ |
| 4469 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4470 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4471 | -S "skip write certificate request" \ |
| 4472 | -C "skip parse certificate request" \ |
| 4473 | -c "got a certificate request" \ |
| 4474 | -C "skip write certificate" \ |
| 4475 | -C "skip write certificate verify" \ |
| 4476 | -S "skip parse certificate verify" \ |
| 4477 | -s "x509_verify_cert() returned" \ |
| 4478 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4479 | -s "! mbedtls_ssl_handshake returned" \ |
| 4480 | -c "! mbedtls_ssl_handshake returned" \ |
| 4481 | -s "X509 - Certificate verification failed" |
| 4482 | |
| 4483 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4484 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4485 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4486 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4487 | key_file=data_files/server5.key" \ |
| 4488 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4489 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4490 | -S "skip write certificate request" \ |
| 4491 | -C "skip parse certificate request" \ |
| 4492 | -c "got a certificate request" \ |
| 4493 | -C "skip write certificate" \ |
| 4494 | -C "skip write certificate verify" \ |
| 4495 | -S "skip parse certificate verify" \ |
| 4496 | -s "x509_verify_cert() returned" \ |
| 4497 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4498 | -S "! mbedtls_ssl_handshake returned" \ |
| 4499 | -C "! mbedtls_ssl_handshake returned" \ |
| 4500 | -S "X509 - Certificate verification failed" |
| 4501 | |
| 4502 | requires_full_size_output_buffer |
| 4503 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4504 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4505 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4506 | key_file=data_files/dir-maxpath/09.key" \ |
| 4507 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4508 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4509 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4510 | -C "X509 - A fatal error occurred" |
| 4511 | |
| 4512 | requires_full_size_output_buffer |
| 4513 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4514 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4515 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4516 | key_file=data_files/dir-maxpath/10.key" \ |
| 4517 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4518 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4519 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4520 | -c "X509 - A fatal error occurred" |
| 4521 | |
| 4522 | requires_full_size_output_buffer |
| 4523 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4524 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4525 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4526 | key_file=data_files/dir-maxpath/10.key" \ |
| 4527 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4528 | debug_level=3 auth_mode=optional" \ |
| 4529 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4530 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4531 | -c "X509 - A fatal error occurred" |
| 4532 | |
| 4533 | requires_full_size_output_buffer |
| 4534 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4535 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4536 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4537 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4538 | key_file=data_files/dir-maxpath/10.key" \ |
| 4539 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4540 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4541 | -s "X509 - A fatal error occurred" |
| 4542 | |
| 4543 | requires_full_size_output_buffer |
| 4544 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4545 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4546 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4547 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4548 | key_file=data_files/dir-maxpath/10.key" \ |
| 4549 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4550 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4551 | -s "X509 - A fatal error occurred" |
| 4552 | |
| 4553 | requires_full_size_output_buffer |
| 4554 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4555 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4556 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4557 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4558 | key_file=data_files/dir-maxpath/09.key" \ |
| 4559 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4560 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4561 | -S "X509 - A fatal error occurred" |
| 4562 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4563 | # Tests for certificate selection based on SHA verson |
| 4564 | |
| 4565 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4566 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4567 | key_file=data_files/server5.key \ |
| 4568 | crt_file2=data_files/server5-sha1.crt \ |
| 4569 | key_file2=data_files/server5.key" \ |
| 4570 | "$P_CLI force_version=tls1_2" \ |
| 4571 | 0 \ |
| 4572 | -c "signed using.*ECDSA with SHA256" \ |
| 4573 | -C "signed using.*ECDSA with SHA1" |
| 4574 | |
| 4575 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4576 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4577 | key_file=data_files/server5.key \ |
| 4578 | crt_file2=data_files/server5-sha1.crt \ |
| 4579 | key_file2=data_files/server5.key" \ |
| 4580 | "$P_CLI force_version=tls1_1" \ |
| 4581 | 0 \ |
| 4582 | -C "signed using.*ECDSA with SHA256" \ |
| 4583 | -c "signed using.*ECDSA with SHA1" |
| 4584 | |
| 4585 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4586 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4587 | key_file=data_files/server5.key \ |
| 4588 | crt_file2=data_files/server5-sha1.crt \ |
| 4589 | key_file2=data_files/server5.key" \ |
| 4590 | "$P_CLI force_version=tls1" \ |
| 4591 | 0 \ |
| 4592 | -C "signed using.*ECDSA with SHA256" \ |
| 4593 | -c "signed using.*ECDSA with SHA1" |
| 4594 | |
| 4595 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4596 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4597 | key_file=data_files/server5.key \ |
| 4598 | crt_file2=data_files/server6.crt \ |
| 4599 | key_file2=data_files/server6.key" \ |
| 4600 | "$P_CLI force_version=tls1_1" \ |
| 4601 | 0 \ |
| 4602 | -c "serial number.*09" \ |
| 4603 | -c "signed using.*ECDSA with SHA256" \ |
| 4604 | -C "signed using.*ECDSA with SHA1" |
| 4605 | |
| 4606 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4607 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4608 | key_file=data_files/server6.key \ |
| 4609 | crt_file2=data_files/server5.crt \ |
| 4610 | key_file2=data_files/server5.key" \ |
| 4611 | "$P_CLI force_version=tls1_1" \ |
| 4612 | 0 \ |
| 4613 | -c "serial number.*0A" \ |
| 4614 | -c "signed using.*ECDSA with SHA256" \ |
| 4615 | -C "signed using.*ECDSA with SHA1" |
| 4616 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4617 | # tests for SNI |
| 4618 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4619 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4620 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4621 | 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] | 4622 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4623 | 0 \ |
| 4624 | -S "parse ServerName extension" \ |
| 4625 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4626 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4627 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4628 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4629 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4630 | 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] | 4631 | 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] | 4632 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4633 | 0 \ |
| 4634 | -s "parse ServerName extension" \ |
| 4635 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4636 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4637 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4638 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4639 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4640 | 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] | 4641 | 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] | 4642 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4643 | 0 \ |
| 4644 | -s "parse ServerName extension" \ |
| 4645 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4646 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4647 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4648 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4649 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4650 | 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] | 4651 | 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] | 4652 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4653 | 1 \ |
| 4654 | -s "parse ServerName extension" \ |
| 4655 | -s "ssl_sni_wrapper() returned" \ |
| 4656 | -s "mbedtls_ssl_handshake returned" \ |
| 4657 | -c "mbedtls_ssl_handshake returned" \ |
| 4658 | -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] | 4659 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4660 | run_test "SNI: client auth no override: optional" \ |
| 4661 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4662 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4663 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4664 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4665 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4666 | -S "skip write certificate request" \ |
| 4667 | -C "skip parse certificate request" \ |
| 4668 | -c "got a certificate request" \ |
| 4669 | -C "skip write certificate" \ |
| 4670 | -C "skip write certificate verify" \ |
| 4671 | -S "skip parse certificate verify" |
| 4672 | |
| 4673 | run_test "SNI: client auth override: none -> optional" \ |
| 4674 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4675 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4676 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4677 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4678 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4679 | -S "skip write certificate request" \ |
| 4680 | -C "skip parse certificate request" \ |
| 4681 | -c "got a certificate request" \ |
| 4682 | -C "skip write certificate" \ |
| 4683 | -C "skip write certificate verify" \ |
| 4684 | -S "skip parse certificate verify" |
| 4685 | |
| 4686 | run_test "SNI: client auth override: optional -> none" \ |
| 4687 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4688 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4689 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4690 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4691 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4692 | -s "skip write certificate request" \ |
| 4693 | -C "skip parse certificate request" \ |
| 4694 | -c "got no certificate request" \ |
| 4695 | -c "skip write certificate" \ |
| 4696 | -c "skip write certificate verify" \ |
| 4697 | -s "skip parse certificate verify" |
| 4698 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4699 | run_test "SNI: CA no override" \ |
| 4700 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4701 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4702 | ca_file=data_files/test-ca.crt \ |
| 4703 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4704 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4705 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4706 | 1 \ |
| 4707 | -S "skip write certificate request" \ |
| 4708 | -C "skip parse certificate request" \ |
| 4709 | -c "got a certificate request" \ |
| 4710 | -C "skip write certificate" \ |
| 4711 | -C "skip write certificate verify" \ |
| 4712 | -S "skip parse certificate verify" \ |
| 4713 | -s "x509_verify_cert() returned" \ |
| 4714 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4715 | -S "The certificate has been revoked (is on a CRL)" |
| 4716 | |
| 4717 | run_test "SNI: CA override" \ |
| 4718 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4719 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4720 | ca_file=data_files/test-ca.crt \ |
| 4721 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4722 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4723 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4724 | 0 \ |
| 4725 | -S "skip write certificate request" \ |
| 4726 | -C "skip parse certificate request" \ |
| 4727 | -c "got a certificate request" \ |
| 4728 | -C "skip write certificate" \ |
| 4729 | -C "skip write certificate verify" \ |
| 4730 | -S "skip parse certificate verify" \ |
| 4731 | -S "x509_verify_cert() returned" \ |
| 4732 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4733 | -S "The certificate has been revoked (is on a CRL)" |
| 4734 | |
| 4735 | run_test "SNI: CA override with CRL" \ |
| 4736 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4737 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4738 | ca_file=data_files/test-ca.crt \ |
| 4739 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4740 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4741 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4742 | 1 \ |
| 4743 | -S "skip write certificate request" \ |
| 4744 | -C "skip parse certificate request" \ |
| 4745 | -c "got a certificate request" \ |
| 4746 | -C "skip write certificate" \ |
| 4747 | -C "skip write certificate verify" \ |
| 4748 | -S "skip parse certificate verify" \ |
| 4749 | -s "x509_verify_cert() returned" \ |
| 4750 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4751 | -s "The certificate has been revoked (is on a CRL)" |
| 4752 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4753 | # Tests for SNI and DTLS |
| 4754 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4755 | run_test "SNI: DTLS, no SNI callback" \ |
| 4756 | "$P_SRV debug_level=3 dtls=1 \ |
| 4757 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4758 | "$P_CLI server_name=localhost dtls=1" \ |
| 4759 | 0 \ |
| 4760 | -S "parse ServerName extension" \ |
| 4761 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4762 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4763 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4764 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4765 | "$P_SRV debug_level=3 dtls=1 \ |
| 4766 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4767 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4768 | "$P_CLI server_name=localhost dtls=1" \ |
| 4769 | 0 \ |
| 4770 | -s "parse ServerName extension" \ |
| 4771 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4772 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4773 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4774 | run_test "SNI: DTLS, matching cert 2" \ |
| 4775 | "$P_SRV debug_level=3 dtls=1 \ |
| 4776 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4777 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4778 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4779 | 0 \ |
| 4780 | -s "parse ServerName extension" \ |
| 4781 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4782 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4783 | |
| 4784 | run_test "SNI: DTLS, no matching cert" \ |
| 4785 | "$P_SRV debug_level=3 dtls=1 \ |
| 4786 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4787 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4788 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4789 | 1 \ |
| 4790 | -s "parse ServerName extension" \ |
| 4791 | -s "ssl_sni_wrapper() returned" \ |
| 4792 | -s "mbedtls_ssl_handshake returned" \ |
| 4793 | -c "mbedtls_ssl_handshake returned" \ |
| 4794 | -c "SSL - A fatal alert message was received from our peer" |
| 4795 | |
| 4796 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4797 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4798 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4799 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4800 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4801 | 0 \ |
| 4802 | -S "skip write certificate request" \ |
| 4803 | -C "skip parse certificate request" \ |
| 4804 | -c "got a certificate request" \ |
| 4805 | -C "skip write certificate" \ |
| 4806 | -C "skip write certificate verify" \ |
| 4807 | -S "skip parse certificate verify" |
| 4808 | |
| 4809 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4810 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4811 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4812 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4813 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4814 | 0 \ |
| 4815 | -S "skip write certificate request" \ |
| 4816 | -C "skip parse certificate request" \ |
| 4817 | -c "got a certificate request" \ |
| 4818 | -C "skip write certificate" \ |
| 4819 | -C "skip write certificate verify" \ |
| 4820 | -S "skip parse certificate verify" |
| 4821 | |
| 4822 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4823 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4824 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4825 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4826 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4827 | 0 \ |
| 4828 | -s "skip write certificate request" \ |
| 4829 | -C "skip parse certificate request" \ |
| 4830 | -c "got no certificate request" \ |
| 4831 | -c "skip write certificate" \ |
| 4832 | -c "skip write certificate verify" \ |
| 4833 | -s "skip parse certificate verify" |
| 4834 | |
| 4835 | run_test "SNI: DTLS, CA no override" \ |
| 4836 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4837 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4838 | ca_file=data_files/test-ca.crt \ |
| 4839 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4840 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4841 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4842 | 1 \ |
| 4843 | -S "skip write certificate request" \ |
| 4844 | -C "skip parse certificate request" \ |
| 4845 | -c "got a certificate request" \ |
| 4846 | -C "skip write certificate" \ |
| 4847 | -C "skip write certificate verify" \ |
| 4848 | -S "skip parse certificate verify" \ |
| 4849 | -s "x509_verify_cert() returned" \ |
| 4850 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4851 | -S "The certificate has been revoked (is on a CRL)" |
| 4852 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4853 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4854 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4855 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4856 | ca_file=data_files/test-ca.crt \ |
| 4857 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4858 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4859 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4860 | 0 \ |
| 4861 | -S "skip write certificate request" \ |
| 4862 | -C "skip parse certificate request" \ |
| 4863 | -c "got a certificate request" \ |
| 4864 | -C "skip write certificate" \ |
| 4865 | -C "skip write certificate verify" \ |
| 4866 | -S "skip parse certificate verify" \ |
| 4867 | -S "x509_verify_cert() returned" \ |
| 4868 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4869 | -S "The certificate has been revoked (is on a CRL)" |
| 4870 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4871 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4872 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4873 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4874 | ca_file=data_files/test-ca.crt \ |
| 4875 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4876 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4877 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4878 | 1 \ |
| 4879 | -S "skip write certificate request" \ |
| 4880 | -C "skip parse certificate request" \ |
| 4881 | -c "got a certificate request" \ |
| 4882 | -C "skip write certificate" \ |
| 4883 | -C "skip write certificate verify" \ |
| 4884 | -S "skip parse certificate verify" \ |
| 4885 | -s "x509_verify_cert() returned" \ |
| 4886 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4887 | -s "The certificate has been revoked (is on a CRL)" |
| 4888 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4889 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4890 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4891 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4892 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4893 | "$P_CLI nbio=2 tickets=0" \ |
| 4894 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4895 | -S "mbedtls_ssl_handshake returned" \ |
| 4896 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4897 | -c "Read from server: .* bytes read" |
| 4898 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4899 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4900 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4901 | "$P_CLI nbio=2 tickets=0" \ |
| 4902 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4903 | -S "mbedtls_ssl_handshake returned" \ |
| 4904 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4905 | -c "Read from server: .* bytes read" |
| 4906 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4907 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4908 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4909 | "$P_CLI nbio=2 tickets=1" \ |
| 4910 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4911 | -S "mbedtls_ssl_handshake returned" \ |
| 4912 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4913 | -c "Read from server: .* bytes read" |
| 4914 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4915 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4916 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4917 | "$P_CLI nbio=2 tickets=1" \ |
| 4918 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4919 | -S "mbedtls_ssl_handshake returned" \ |
| 4920 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4921 | -c "Read from server: .* bytes read" |
| 4922 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4923 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4924 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4925 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4926 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4927 | -S "mbedtls_ssl_handshake returned" \ |
| 4928 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4929 | -c "Read from server: .* bytes read" |
| 4930 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4931 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4932 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4933 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4934 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4935 | -S "mbedtls_ssl_handshake returned" \ |
| 4936 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4937 | -c "Read from server: .* bytes read" |
| 4938 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4939 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4940 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4941 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4942 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4943 | -S "mbedtls_ssl_handshake returned" \ |
| 4944 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4945 | -c "Read from server: .* bytes read" |
| 4946 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4947 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4948 | |
| 4949 | run_test "Event-driven I/O: basic handshake" \ |
| 4950 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4951 | "$P_CLI event=1 tickets=0" \ |
| 4952 | 0 \ |
| 4953 | -S "mbedtls_ssl_handshake returned" \ |
| 4954 | -C "mbedtls_ssl_handshake returned" \ |
| 4955 | -c "Read from server: .* bytes read" |
| 4956 | |
| 4957 | run_test "Event-driven I/O: client auth" \ |
| 4958 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4959 | "$P_CLI event=1 tickets=0" \ |
| 4960 | 0 \ |
| 4961 | -S "mbedtls_ssl_handshake returned" \ |
| 4962 | -C "mbedtls_ssl_handshake returned" \ |
| 4963 | -c "Read from server: .* bytes read" |
| 4964 | |
| 4965 | run_test "Event-driven I/O: ticket" \ |
| 4966 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4967 | "$P_CLI event=1 tickets=1" \ |
| 4968 | 0 \ |
| 4969 | -S "mbedtls_ssl_handshake returned" \ |
| 4970 | -C "mbedtls_ssl_handshake returned" \ |
| 4971 | -c "Read from server: .* bytes read" |
| 4972 | |
| 4973 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4974 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4975 | "$P_CLI event=1 tickets=1" \ |
| 4976 | 0 \ |
| 4977 | -S "mbedtls_ssl_handshake returned" \ |
| 4978 | -C "mbedtls_ssl_handshake returned" \ |
| 4979 | -c "Read from server: .* bytes read" |
| 4980 | |
| 4981 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4982 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4983 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4984 | 0 \ |
| 4985 | -S "mbedtls_ssl_handshake returned" \ |
| 4986 | -C "mbedtls_ssl_handshake returned" \ |
| 4987 | -c "Read from server: .* bytes read" |
| 4988 | |
| 4989 | run_test "Event-driven I/O: ticket + resume" \ |
| 4990 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4991 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4992 | 0 \ |
| 4993 | -S "mbedtls_ssl_handshake returned" \ |
| 4994 | -C "mbedtls_ssl_handshake returned" \ |
| 4995 | -c "Read from server: .* bytes read" |
| 4996 | |
| 4997 | run_test "Event-driven I/O: session-id resume" \ |
| 4998 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4999 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5000 | 0 \ |
| 5001 | -S "mbedtls_ssl_handshake returned" \ |
| 5002 | -C "mbedtls_ssl_handshake returned" \ |
| 5003 | -c "Read from server: .* bytes read" |
| 5004 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5005 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5006 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5007 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5008 | 0 \ |
| 5009 | -c "Read from server: .* bytes read" |
| 5010 | |
| 5011 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5012 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5013 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5014 | 0 \ |
| 5015 | -c "Read from server: .* bytes read" |
| 5016 | |
| 5017 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5018 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5019 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5020 | 0 \ |
| 5021 | -c "Read from server: .* bytes read" |
| 5022 | |
| 5023 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5024 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5025 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5026 | 0 \ |
| 5027 | -c "Read from server: .* bytes read" |
| 5028 | |
| 5029 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5030 | "$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] | 5031 | "$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] | 5032 | 0 \ |
| 5033 | -c "Read from server: .* bytes read" |
| 5034 | |
| 5035 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5036 | "$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] | 5037 | "$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] | 5038 | 0 \ |
| 5039 | -c "Read from server: .* bytes read" |
| 5040 | |
| 5041 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5042 | "$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] | 5043 | "$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] | 5044 | 0 \ |
| 5045 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5046 | |
| 5047 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5048 | # During session resumption, the client will send its ApplicationData record |
| 5049 | # within the same datagram as the Finished messages. In this situation, the |
| 5050 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5051 | # because the ApplicationData request has already been queued internally. |
| 5052 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5053 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5054 | "$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] | 5055 | "$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] | 5056 | 0 \ |
| 5057 | -c "Read from server: .* bytes read" |
| 5058 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5059 | # Tests for version negotiation |
| 5060 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5061 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5062 | "$P_SRV" \ |
| 5063 | "$P_CLI" \ |
| 5064 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5065 | -S "mbedtls_ssl_handshake returned" \ |
| 5066 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5067 | -s "Protocol is TLSv1.2" \ |
| 5068 | -c "Protocol is TLSv1.2" |
| 5069 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5070 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5071 | "$P_SRV" \ |
| 5072 | "$P_CLI max_version=tls1_1" \ |
| 5073 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5074 | -S "mbedtls_ssl_handshake returned" \ |
| 5075 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5076 | -s "Protocol is TLSv1.1" \ |
| 5077 | -c "Protocol is TLSv1.1" |
| 5078 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5079 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5080 | "$P_SRV max_version=tls1_1" \ |
| 5081 | "$P_CLI" \ |
| 5082 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5083 | -S "mbedtls_ssl_handshake returned" \ |
| 5084 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5085 | -s "Protocol is TLSv1.1" \ |
| 5086 | -c "Protocol is TLSv1.1" |
| 5087 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5088 | 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] | 5089 | "$P_SRV max_version=tls1_1" \ |
| 5090 | "$P_CLI max_version=tls1_1" \ |
| 5091 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5092 | -S "mbedtls_ssl_handshake returned" \ |
| 5093 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5094 | -s "Protocol is TLSv1.1" \ |
| 5095 | -c "Protocol is TLSv1.1" |
| 5096 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5097 | 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] | 5098 | "$P_SRV min_version=tls1_1" \ |
| 5099 | "$P_CLI max_version=tls1_1" \ |
| 5100 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5101 | -S "mbedtls_ssl_handshake returned" \ |
| 5102 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5103 | -s "Protocol is TLSv1.1" \ |
| 5104 | -c "Protocol is TLSv1.1" |
| 5105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5106 | 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] | 5107 | "$P_SRV max_version=tls1_1" \ |
| 5108 | "$P_CLI min_version=tls1_1" \ |
| 5109 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5110 | -S "mbedtls_ssl_handshake returned" \ |
| 5111 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5112 | -s "Protocol is TLSv1.1" \ |
| 5113 | -c "Protocol is TLSv1.1" |
| 5114 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5115 | 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] | 5116 | "$P_SRV max_version=tls1_1" \ |
| 5117 | "$P_CLI min_version=tls1_2" \ |
| 5118 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5119 | -s "mbedtls_ssl_handshake returned" \ |
| 5120 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5121 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5122 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5123 | 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] | 5124 | "$P_SRV min_version=tls1_2" \ |
| 5125 | "$P_CLI max_version=tls1_1" \ |
| 5126 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5127 | -s "mbedtls_ssl_handshake returned" \ |
| 5128 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5129 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5130 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5131 | # Tests for ALPN extension |
| 5132 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5133 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5134 | "$P_SRV debug_level=3" \ |
| 5135 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5136 | 0 \ |
| 5137 | -C "client hello, adding alpn extension" \ |
| 5138 | -S "found alpn extension" \ |
| 5139 | -C "got an alert message, type: \\[2:120]" \ |
| 5140 | -S "server hello, adding alpn extension" \ |
| 5141 | -C "found alpn extension " \ |
| 5142 | -C "Application Layer Protocol is" \ |
| 5143 | -S "Application Layer Protocol is" |
| 5144 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5145 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5146 | "$P_SRV debug_level=3" \ |
| 5147 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5148 | 0 \ |
| 5149 | -c "client hello, adding alpn extension" \ |
| 5150 | -s "found alpn extension" \ |
| 5151 | -C "got an alert message, type: \\[2:120]" \ |
| 5152 | -S "server hello, adding alpn extension" \ |
| 5153 | -C "found alpn extension " \ |
| 5154 | -c "Application Layer Protocol is (none)" \ |
| 5155 | -S "Application Layer Protocol is" |
| 5156 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5157 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5158 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5159 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5160 | 0 \ |
| 5161 | -C "client hello, adding alpn extension" \ |
| 5162 | -S "found alpn extension" \ |
| 5163 | -C "got an alert message, type: \\[2:120]" \ |
| 5164 | -S "server hello, adding alpn extension" \ |
| 5165 | -C "found alpn extension " \ |
| 5166 | -C "Application Layer Protocol is" \ |
| 5167 | -s "Application Layer Protocol is (none)" |
| 5168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5169 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5170 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5171 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5172 | 0 \ |
| 5173 | -c "client hello, adding alpn extension" \ |
| 5174 | -s "found alpn extension" \ |
| 5175 | -C "got an alert message, type: \\[2:120]" \ |
| 5176 | -s "server hello, adding alpn extension" \ |
| 5177 | -c "found alpn extension" \ |
| 5178 | -c "Application Layer Protocol is abc" \ |
| 5179 | -s "Application Layer Protocol is abc" |
| 5180 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5181 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5182 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5183 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5184 | 0 \ |
| 5185 | -c "client hello, adding alpn extension" \ |
| 5186 | -s "found alpn extension" \ |
| 5187 | -C "got an alert message, type: \\[2:120]" \ |
| 5188 | -s "server hello, adding alpn extension" \ |
| 5189 | -c "found alpn extension" \ |
| 5190 | -c "Application Layer Protocol is abc" \ |
| 5191 | -s "Application Layer Protocol is abc" |
| 5192 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5193 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5194 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5195 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5196 | 0 \ |
| 5197 | -c "client hello, adding alpn extension" \ |
| 5198 | -s "found alpn extension" \ |
| 5199 | -C "got an alert message, type: \\[2:120]" \ |
| 5200 | -s "server hello, adding alpn extension" \ |
| 5201 | -c "found alpn extension" \ |
| 5202 | -c "Application Layer Protocol is 1234" \ |
| 5203 | -s "Application Layer Protocol is 1234" |
| 5204 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5205 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5206 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5207 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5208 | 1 \ |
| 5209 | -c "client hello, adding alpn extension" \ |
| 5210 | -s "found alpn extension" \ |
| 5211 | -c "got an alert message, type: \\[2:120]" \ |
| 5212 | -S "server hello, adding alpn extension" \ |
| 5213 | -C "found alpn extension" \ |
| 5214 | -C "Application Layer Protocol is 1234" \ |
| 5215 | -S "Application Layer Protocol is 1234" |
| 5216 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5217 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5218 | # Tests for keyUsage in leaf certificates, part 1: |
| 5219 | # server-side certificate/suite selection |
| 5220 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5221 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5222 | "$P_SRV key_file=data_files/server2.key \ |
| 5223 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5224 | "$P_CLI" \ |
| 5225 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5226 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5227 | |
| 5228 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5229 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5230 | "$P_SRV key_file=data_files/server2.key \ |
| 5231 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5232 | "$P_CLI" \ |
| 5233 | 0 \ |
| 5234 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5235 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5236 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5237 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5238 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5239 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5240 | 1 \ |
| 5241 | -C "Ciphersuite is " |
| 5242 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5243 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5244 | "$P_SRV key_file=data_files/server5.key \ |
| 5245 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5246 | "$P_CLI" \ |
| 5247 | 0 \ |
| 5248 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5249 | |
| 5250 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5251 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5252 | "$P_SRV key_file=data_files/server5.key \ |
| 5253 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5254 | "$P_CLI" \ |
| 5255 | 0 \ |
| 5256 | -c "Ciphersuite is TLS-ECDH-" |
| 5257 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5258 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5259 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5260 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5261 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5262 | 1 \ |
| 5263 | -C "Ciphersuite is " |
| 5264 | |
| 5265 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5266 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5267 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5268 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5269 | "$O_SRV -key data_files/server2.key \ |
| 5270 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5271 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5272 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5273 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5274 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5275 | -C "Processing of the Certificate handshake message failed" \ |
| 5276 | -c "Ciphersuite is TLS-" |
| 5277 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5278 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5279 | "$O_SRV -key data_files/server2.key \ |
| 5280 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5281 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5282 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5283 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5284 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5285 | -C "Processing of the Certificate handshake message failed" \ |
| 5286 | -c "Ciphersuite is TLS-" |
| 5287 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5288 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5289 | "$O_SRV -key data_files/server2.key \ |
| 5290 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5291 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5292 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5293 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5294 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5295 | -C "Processing of the Certificate handshake message failed" \ |
| 5296 | -c "Ciphersuite is TLS-" |
| 5297 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5298 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5299 | "$O_SRV -key data_files/server2.key \ |
| 5300 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5301 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5302 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5303 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5304 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5305 | -c "Processing of the Certificate handshake message failed" \ |
| 5306 | -C "Ciphersuite is TLS-" |
| 5307 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5308 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5309 | "$O_SRV -key data_files/server2.key \ |
| 5310 | -cert data_files/server2.ku-ke.crt" \ |
| 5311 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5312 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5313 | 0 \ |
| 5314 | -c "bad certificate (usage extensions)" \ |
| 5315 | -C "Processing of the Certificate handshake message failed" \ |
| 5316 | -c "Ciphersuite is TLS-" \ |
| 5317 | -c "! Usage does not match the keyUsage extension" |
| 5318 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5319 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5320 | "$O_SRV -key data_files/server2.key \ |
| 5321 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5322 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5323 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5324 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5325 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5326 | -C "Processing of the Certificate handshake message failed" \ |
| 5327 | -c "Ciphersuite is TLS-" |
| 5328 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5329 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5330 | "$O_SRV -key data_files/server2.key \ |
| 5331 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5332 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5333 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5334 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5335 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5336 | -c "Processing of the Certificate handshake message failed" \ |
| 5337 | -C "Ciphersuite is TLS-" |
| 5338 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5339 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5340 | "$O_SRV -key data_files/server2.key \ |
| 5341 | -cert data_files/server2.ku-ds.crt" \ |
| 5342 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5343 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5344 | 0 \ |
| 5345 | -c "bad certificate (usage extensions)" \ |
| 5346 | -C "Processing of the Certificate handshake message failed" \ |
| 5347 | -c "Ciphersuite is TLS-" \ |
| 5348 | -c "! Usage does not match the keyUsage extension" |
| 5349 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5350 | # Tests for keyUsage in leaf certificates, part 3: |
| 5351 | # server-side checking of client cert |
| 5352 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5353 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5354 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5355 | "$O_CLI -key data_files/server2.key \ |
| 5356 | -cert data_files/server2.ku-ds.crt" \ |
| 5357 | 0 \ |
| 5358 | -S "bad certificate (usage extensions)" \ |
| 5359 | -S "Processing of the Certificate handshake message failed" |
| 5360 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5361 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5362 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5363 | "$O_CLI -key data_files/server2.key \ |
| 5364 | -cert data_files/server2.ku-ke.crt" \ |
| 5365 | 0 \ |
| 5366 | -s "bad certificate (usage extensions)" \ |
| 5367 | -S "Processing of the Certificate handshake message failed" |
| 5368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5369 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5370 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5371 | "$O_CLI -key data_files/server2.key \ |
| 5372 | -cert data_files/server2.ku-ke.crt" \ |
| 5373 | 1 \ |
| 5374 | -s "bad certificate (usage extensions)" \ |
| 5375 | -s "Processing of the Certificate handshake message failed" |
| 5376 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5377 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5378 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5379 | "$O_CLI -key data_files/server5.key \ |
| 5380 | -cert data_files/server5.ku-ds.crt" \ |
| 5381 | 0 \ |
| 5382 | -S "bad certificate (usage extensions)" \ |
| 5383 | -S "Processing of the Certificate handshake message failed" |
| 5384 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5385 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5386 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5387 | "$O_CLI -key data_files/server5.key \ |
| 5388 | -cert data_files/server5.ku-ka.crt" \ |
| 5389 | 0 \ |
| 5390 | -s "bad certificate (usage extensions)" \ |
| 5391 | -S "Processing of the Certificate handshake message failed" |
| 5392 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5393 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5394 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5395 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5396 | "$P_SRV key_file=data_files/server5.key \ |
| 5397 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5398 | "$P_CLI" \ |
| 5399 | 0 |
| 5400 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5401 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5402 | "$P_SRV key_file=data_files/server5.key \ |
| 5403 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5404 | "$P_CLI" \ |
| 5405 | 0 |
| 5406 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5407 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5408 | "$P_SRV key_file=data_files/server5.key \ |
| 5409 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5410 | "$P_CLI" \ |
| 5411 | 0 |
| 5412 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5413 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5414 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5415 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5416 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5417 | 1 |
| 5418 | |
| 5419 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5420 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5421 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5422 | "$O_SRV -key data_files/server5.key \ |
| 5423 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5424 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5425 | 0 \ |
| 5426 | -C "bad certificate (usage extensions)" \ |
| 5427 | -C "Processing of the Certificate handshake message failed" \ |
| 5428 | -c "Ciphersuite is TLS-" |
| 5429 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5430 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5431 | "$O_SRV -key data_files/server5.key \ |
| 5432 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5433 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5434 | 0 \ |
| 5435 | -C "bad certificate (usage extensions)" \ |
| 5436 | -C "Processing of the Certificate handshake message failed" \ |
| 5437 | -c "Ciphersuite is TLS-" |
| 5438 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5439 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5440 | "$O_SRV -key data_files/server5.key \ |
| 5441 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5442 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5443 | 0 \ |
| 5444 | -C "bad certificate (usage extensions)" \ |
| 5445 | -C "Processing of the Certificate handshake message failed" \ |
| 5446 | -c "Ciphersuite is TLS-" |
| 5447 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5448 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5449 | "$O_SRV -key data_files/server5.key \ |
| 5450 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5451 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5452 | 1 \ |
| 5453 | -c "bad certificate (usage extensions)" \ |
| 5454 | -c "Processing of the Certificate handshake message failed" \ |
| 5455 | -C "Ciphersuite is TLS-" |
| 5456 | |
| 5457 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5458 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5459 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5460 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5461 | "$O_CLI -key data_files/server5.key \ |
| 5462 | -cert data_files/server5.eku-cli.crt" \ |
| 5463 | 0 \ |
| 5464 | -S "bad certificate (usage extensions)" \ |
| 5465 | -S "Processing of the Certificate handshake message failed" |
| 5466 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5467 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5468 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5469 | "$O_CLI -key data_files/server5.key \ |
| 5470 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5471 | 0 \ |
| 5472 | -S "bad certificate (usage extensions)" \ |
| 5473 | -S "Processing of the Certificate handshake message failed" |
| 5474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5475 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5476 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5477 | "$O_CLI -key data_files/server5.key \ |
| 5478 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5479 | 0 \ |
| 5480 | -S "bad certificate (usage extensions)" \ |
| 5481 | -S "Processing of the Certificate handshake message failed" |
| 5482 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5483 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5484 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5485 | "$O_CLI -key data_files/server5.key \ |
| 5486 | -cert data_files/server5.eku-cs.crt" \ |
| 5487 | 0 \ |
| 5488 | -s "bad certificate (usage extensions)" \ |
| 5489 | -S "Processing of the Certificate handshake message failed" |
| 5490 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5491 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5492 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5493 | "$O_CLI -key data_files/server5.key \ |
| 5494 | -cert data_files/server5.eku-cs.crt" \ |
| 5495 | 1 \ |
| 5496 | -s "bad certificate (usage extensions)" \ |
| 5497 | -s "Processing of the Certificate handshake message failed" |
| 5498 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5499 | # Tests for DHM parameters loading |
| 5500 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5501 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5502 | "$P_SRV" \ |
| 5503 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5504 | debug_level=3" \ |
| 5505 | 0 \ |
| 5506 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5507 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5508 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5509 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5510 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5511 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5512 | debug_level=3" \ |
| 5513 | 0 \ |
| 5514 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5515 | -c "value of 'DHM: G ' (2 bits)" |
| 5516 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5517 | # Tests for DHM client-side size checking |
| 5518 | |
| 5519 | run_test "DHM size: server default, client default, OK" \ |
| 5520 | "$P_SRV" \ |
| 5521 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5522 | debug_level=1" \ |
| 5523 | 0 \ |
| 5524 | -C "DHM prime too short:" |
| 5525 | |
| 5526 | run_test "DHM size: server default, client 2048, OK" \ |
| 5527 | "$P_SRV" \ |
| 5528 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5529 | debug_level=1 dhmlen=2048" \ |
| 5530 | 0 \ |
| 5531 | -C "DHM prime too short:" |
| 5532 | |
| 5533 | run_test "DHM size: server 1024, client default, OK" \ |
| 5534 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5535 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5536 | debug_level=1" \ |
| 5537 | 0 \ |
| 5538 | -C "DHM prime too short:" |
| 5539 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame^] | 5540 | run_test "DHM size: server 999, client 999, OK" \ |
| 5541 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5542 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5543 | debug_level=1 dhmlen=999" \ |
| 5544 | 0 \ |
| 5545 | -C "DHM prime too short:" |
| 5546 | |
| 5547 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5548 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5549 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5550 | debug_level=1 dhmlen=1000" \ |
| 5551 | 0 \ |
| 5552 | -C "DHM prime too short:" |
| 5553 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5554 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5555 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5556 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5557 | debug_level=1" \ |
| 5558 | 1 \ |
| 5559 | -c "DHM prime too short:" |
| 5560 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame^] | 5561 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5562 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5563 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5564 | debug_level=1 dhmlen=1001" \ |
| 5565 | 1 \ |
| 5566 | -c "DHM prime too short:" |
| 5567 | |
| 5568 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5569 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5570 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5571 | debug_level=1 dhmlen=1000" \ |
| 5572 | 1 \ |
| 5573 | -c "DHM prime too short:" |
| 5574 | |
| 5575 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5576 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5577 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5578 | debug_level=1 dhmlen=999" \ |
| 5579 | 1 \ |
| 5580 | -c "DHM prime too short:" |
| 5581 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5582 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5583 | "$P_SRV" \ |
| 5584 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5585 | debug_level=1 dhmlen=2049" \ |
| 5586 | 1 \ |
| 5587 | -c "DHM prime too short:" |
| 5588 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5589 | # Tests for PSK callback |
| 5590 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5591 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5592 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5593 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5594 | psk_identity=foo psk=abc123" \ |
| 5595 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5596 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5597 | -S "SSL - Unknown identity received" \ |
| 5598 | -S "SSL - Verification of the message MAC failed" |
| 5599 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5600 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5601 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5602 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5603 | "$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] | 5604 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 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 | f702751 | 2018-10-23 15:27:39 +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: opaque psk on client, no callback, SHA-384" \ |
| 5616 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5617 | "$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] | 5618 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 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 | f702751 | 2018-10-23 15:27:39 +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: opaque psk on client, no callback, EMS" \ |
| 5630 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5631 | "$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] | 5632 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5633 | 0 \ |
| 5634 | -c "skip PMS generation for opaque PSK"\ |
| 5635 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5636 | -c "session hash for extended master secret"\ |
| 5637 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5638 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5639 | -S "SSL - Unknown identity received" \ |
| 5640 | -S "SSL - Verification of the message MAC failed" |
| 5641 | |
| 5642 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5643 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5644 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5645 | "$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] | 5646 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5647 | 0 \ |
| 5648 | -c "skip PMS generation for opaque PSK"\ |
| 5649 | -S "skip PMS generation for opaque PSK"\ |
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 | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5652 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5653 | -S "SSL - Unknown identity received" \ |
| 5654 | -S "SSL - Verification of the message MAC failed" |
| 5655 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5656 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5657 | 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] | 5658 | "$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] | 5659 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5660 | psk_identity=foo psk=abc123" \ |
| 5661 | 0 \ |
| 5662 | -C "skip PMS generation for opaque PSK"\ |
| 5663 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5664 | -C "session hash for extended master secret"\ |
| 5665 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5666 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5667 | -S "SSL - Unknown identity received" \ |
| 5668 | -S "SSL - Verification of the message MAC failed" |
| 5669 | |
| 5670 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5671 | 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] | 5672 | "$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] | 5673 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5674 | psk_identity=foo psk=abc123" \ |
| 5675 | 0 \ |
| 5676 | -C "skip PMS generation for opaque PSK"\ |
| 5677 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5678 | -C "session hash for extended master secret"\ |
| 5679 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5680 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5681 | -S "SSL - Unknown identity received" \ |
| 5682 | -S "SSL - Verification of the message MAC failed" |
| 5683 | |
| 5684 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5685 | 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] | 5686 | "$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] | 5687 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5688 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5689 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5690 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5691 | -c "session hash for extended master secret"\ |
| 5692 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5693 | -C "skip PMS generation for opaque PSK"\ |
| 5694 | -s "skip PMS generation for opaque PSK"\ |
| 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, static opaque on server, no callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5701 | "$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] | 5702 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5703 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5704 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5705 | 0 \ |
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 | -C "skip PMS generation for opaque PSK"\ |
| 5709 | -s "skip PMS generation for opaque PSK"\ |
| 5710 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5711 | -S "SSL - Unknown identity received" \ |
| 5712 | -S "SSL - Verification of the message MAC failed" |
| 5713 | |
| 5714 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5715 | 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] | 5716 | "$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] | 5717 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5718 | psk_identity=def psk=beef" \ |
| 5719 | 0 \ |
| 5720 | -C "skip PMS generation for opaque PSK"\ |
| 5721 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5722 | -C "session hash for extended master secret"\ |
| 5723 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5724 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5725 | -S "SSL - Unknown identity received" \ |
| 5726 | -S "SSL - Verification of the message MAC failed" |
| 5727 | |
| 5728 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5729 | 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] | 5730 | "$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] | 5731 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5732 | psk_identity=def psk=beef" \ |
| 5733 | 0 \ |
| 5734 | -C "skip PMS generation for opaque PSK"\ |
| 5735 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5736 | -C "session hash for extended master secret"\ |
| 5737 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5738 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5739 | -S "SSL - Unknown identity received" \ |
| 5740 | -S "SSL - Verification of the message MAC failed" |
| 5741 | |
| 5742 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5743 | 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] | 5744 | "$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] | 5745 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5746 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5747 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5748 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5749 | -c "session hash for extended master secret"\ |
| 5750 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5751 | -C "skip PMS generation for opaque PSK"\ |
| 5752 | -s "skip PMS generation for opaque PSK"\ |
| 5753 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5754 | -S "SSL - Unknown identity received" \ |
| 5755 | -S "SSL - Verification of the message MAC failed" |
| 5756 | |
| 5757 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5758 | 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] | 5759 | "$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] | 5760 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5761 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5762 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5763 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5764 | -c "session hash for extended master secret"\ |
| 5765 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5766 | -C "skip PMS generation for opaque PSK"\ |
| 5767 | -s "skip PMS generation for opaque PSK"\ |
| 5768 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5769 | -S "SSL - Unknown identity received" \ |
| 5770 | -S "SSL - Verification of the message MAC failed" |
| 5771 | |
| 5772 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5773 | 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] | 5774 | "$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] | 5775 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5776 | psk_identity=def psk=beef" \ |
| 5777 | 0 \ |
| 5778 | -C "skip PMS generation for opaque PSK"\ |
| 5779 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5780 | -C "session hash for extended master secret"\ |
| 5781 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5782 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5783 | -S "SSL - Unknown identity received" \ |
| 5784 | -S "SSL - Verification of the message MAC failed" |
| 5785 | |
| 5786 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5787 | 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] | 5788 | "$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] | 5789 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5790 | psk_identity=def psk=beef" \ |
| 5791 | 0 \ |
| 5792 | -C "skip PMS generation for opaque PSK"\ |
| 5793 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5794 | -C "session hash for extended master secret"\ |
| 5795 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5796 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5797 | -S "SSL - Unknown identity received" \ |
| 5798 | -S "SSL - Verification of the message MAC failed" |
| 5799 | |
| 5800 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5801 | 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] | 5802 | "$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] | 5803 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5804 | psk_identity=def psk=beef" \ |
| 5805 | 0 \ |
| 5806 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5807 | -C "session hash for extended master secret"\ |
| 5808 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5809 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5810 | -S "SSL - Unknown identity received" \ |
| 5811 | -S "SSL - Verification of the message MAC failed" |
| 5812 | |
| 5813 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5814 | 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] | 5815 | "$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] | 5816 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5817 | psk_identity=def psk=beef" \ |
| 5818 | 0 \ |
| 5819 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5820 | -C "session hash for extended master secret"\ |
| 5821 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5822 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5823 | -S "SSL - Unknown identity received" \ |
| 5824 | -S "SSL - Verification of the message MAC failed" |
| 5825 | |
| 5826 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5827 | 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] | 5828 | "$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] | 5829 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5830 | psk_identity=def psk=beef" \ |
| 5831 | 1 \ |
| 5832 | -s "SSL - Verification of the message MAC failed" |
| 5833 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5834 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5835 | "$P_SRV" \ |
| 5836 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5837 | psk_identity=foo psk=abc123" \ |
| 5838 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5839 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5840 | -S "SSL - Unknown identity received" \ |
| 5841 | -S "SSL - Verification of the message MAC failed" |
| 5842 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5843 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5844 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5845 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5846 | psk_identity=foo psk=abc123" \ |
| 5847 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5848 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5849 | -s "SSL - Unknown identity received" \ |
| 5850 | -S "SSL - Verification of the message MAC failed" |
| 5851 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5852 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5853 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5854 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5855 | psk_identity=abc psk=dead" \ |
| 5856 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5857 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5858 | -S "SSL - Unknown identity received" \ |
| 5859 | -S "SSL - Verification of the message MAC failed" |
| 5860 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5861 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5862 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5863 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5864 | psk_identity=def psk=beef" \ |
| 5865 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5866 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5867 | -S "SSL - Unknown identity received" \ |
| 5868 | -S "SSL - Verification of the message MAC failed" |
| 5869 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5870 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5871 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5872 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5873 | psk_identity=ghi psk=beef" \ |
| 5874 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5875 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5876 | -s "SSL - Unknown identity received" \ |
| 5877 | -S "SSL - Verification of the message MAC failed" |
| 5878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5879 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5880 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5881 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5882 | psk_identity=abc psk=beef" \ |
| 5883 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5884 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5885 | -S "SSL - Unknown identity received" \ |
| 5886 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5887 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5888 | # Tests for EC J-PAKE |
| 5889 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5890 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5891 | run_test "ECJPAKE: client not configured" \ |
| 5892 | "$P_SRV debug_level=3" \ |
| 5893 | "$P_CLI debug_level=3" \ |
| 5894 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5895 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5896 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5897 | -S "found ecjpake kkpp extension" \ |
| 5898 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5899 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5900 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5901 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5902 | -S "None of the common ciphersuites is usable" |
| 5903 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5904 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5905 | run_test "ECJPAKE: server not configured" \ |
| 5906 | "$P_SRV debug_level=3" \ |
| 5907 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5908 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5909 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5910 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5911 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5912 | -s "found ecjpake kkpp extension" \ |
| 5913 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5914 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5915 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5916 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5917 | -s "None of the common ciphersuites is usable" |
| 5918 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5919 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5920 | run_test "ECJPAKE: working, TLS" \ |
| 5921 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5922 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5923 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5924 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5925 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5926 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5927 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5928 | -s "found ecjpake kkpp extension" \ |
| 5929 | -S "skip ecjpake kkpp extension" \ |
| 5930 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5931 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5932 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5933 | -S "None of the common ciphersuites is usable" \ |
| 5934 | -S "SSL - Verification of the message MAC failed" |
| 5935 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5936 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5937 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5938 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5939 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5940 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5941 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5942 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5943 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5944 | -s "SSL - Verification of the message MAC failed" |
| 5945 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5946 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5947 | run_test "ECJPAKE: working, DTLS" \ |
| 5948 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5949 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5950 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5951 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5952 | -c "re-using cached ecjpake parameters" \ |
| 5953 | -S "SSL - Verification of the message MAC failed" |
| 5954 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5955 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5956 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5957 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5958 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5959 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5960 | 0 \ |
| 5961 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5962 | -S "SSL - Verification of the message MAC failed" |
| 5963 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5964 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5965 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5966 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5967 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5968 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5969 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5970 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5971 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5972 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5973 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5974 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5975 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5976 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5977 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5978 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5979 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5980 | 0 |
| 5981 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5982 | # Tests for ciphersuites per version |
| 5983 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5984 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5985 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5986 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5987 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5988 | "$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] | 5989 | "$P_CLI force_version=ssl3" \ |
| 5990 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5991 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5992 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5994 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5995 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5996 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5997 | "$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] | 5998 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5999 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6000 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6001 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6003 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6004 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6005 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6006 | "$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] | 6007 | "$P_CLI force_version=tls1_1" \ |
| 6008 | 0 \ |
| 6009 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 6010 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6011 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6012 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6013 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6014 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6015 | "$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] | 6016 | "$P_CLI force_version=tls1_2" \ |
| 6017 | 0 \ |
| 6018 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 6019 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6020 | # Test for ClientHello without extensions |
| 6021 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6022 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6023 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6024 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6025 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6026 | 0 \ |
| 6027 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6028 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6029 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6030 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6031 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6032 | "$P_SRV" \ |
| 6033 | "$P_CLI request_size=100" \ |
| 6034 | 0 \ |
| 6035 | -s "Read from client: 100 bytes read$" |
| 6036 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6037 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6038 | "$P_SRV" \ |
| 6039 | "$P_CLI request_size=500" \ |
| 6040 | 0 \ |
| 6041 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6042 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6043 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6044 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6045 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6046 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6047 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6048 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6049 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6050 | 0 \ |
| 6051 | -s "Read from client: 1 bytes read" |
| 6052 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6053 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6054 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6055 | "$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] | 6056 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6057 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6058 | 0 \ |
| 6059 | -s "Read from client: 1 bytes read" |
| 6060 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6061 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6062 | "$P_SRV" \ |
| 6063 | "$P_CLI request_size=1 force_version=tls1 \ |
| 6064 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6065 | 0 \ |
| 6066 | -s "Read from client: 1 bytes read" |
| 6067 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6068 | 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] | 6069 | "$P_SRV" \ |
| 6070 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 6071 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6072 | 0 \ |
| 6073 | -s "Read from client: 1 bytes read" |
| 6074 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6075 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6076 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6077 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6078 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6079 | 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] | 6080 | 0 \ |
| 6081 | -s "Read from client: 1 bytes read" |
| 6082 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6083 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6084 | 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] | 6085 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6086 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6087 | 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] | 6088 | 0 \ |
| 6089 | -s "Read from client: 1 bytes read" |
| 6090 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6091 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6092 | "$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] | 6093 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6094 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6095 | 0 \ |
| 6096 | -s "Read from client: 1 bytes read" |
| 6097 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6098 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6099 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6100 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6101 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6102 | 0 \ |
| 6103 | -s "Read from client: 1 bytes read" |
| 6104 | |
| 6105 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6106 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6107 | "$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] | 6108 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6109 | 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] | 6110 | 0 \ |
| 6111 | -s "Read from client: 1 bytes read" |
| 6112 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6113 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6114 | 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] | 6115 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6116 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6117 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6118 | 0 \ |
| 6119 | -s "Read from client: 1 bytes read" |
| 6120 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6121 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6122 | "$P_SRV" \ |
| 6123 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6124 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6125 | 0 \ |
| 6126 | -s "Read from client: 1 bytes read" |
| 6127 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6128 | 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] | 6129 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6130 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6131 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6132 | 0 \ |
| 6133 | -s "Read from client: 1 bytes read" |
| 6134 | |
| 6135 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6136 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6137 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6138 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6139 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6140 | 0 \ |
| 6141 | -s "Read from client: 1 bytes read" |
| 6142 | |
| 6143 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6144 | 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] | 6145 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6146 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6147 | 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] | 6148 | 0 \ |
| 6149 | -s "Read from client: 1 bytes read" |
| 6150 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6151 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6152 | "$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] | 6153 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6154 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6155 | 0 \ |
| 6156 | -s "Read from client: 1 bytes read" |
| 6157 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6158 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6159 | "$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] | 6160 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6161 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6162 | 0 \ |
| 6163 | -s "Read from client: 1 bytes read" |
| 6164 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6165 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6166 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6167 | "$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] | 6168 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6169 | 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] | 6170 | 0 \ |
| 6171 | -s "Read from client: 1 bytes read" |
| 6172 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6173 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6174 | 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] | 6175 | "$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] | 6176 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6177 | 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] | 6178 | 0 \ |
| 6179 | -s "Read from client: 1 bytes read" |
| 6180 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6181 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6182 | "$P_SRV" \ |
| 6183 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6184 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6185 | 0 \ |
| 6186 | -s "Read from client: 1 bytes read" |
| 6187 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6188 | 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] | 6189 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6190 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6191 | 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] | 6192 | 0 \ |
| 6193 | -s "Read from client: 1 bytes read" |
| 6194 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6195 | 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] | 6196 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6197 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6198 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6199 | 0 \ |
| 6200 | -s "Read from client: 1 bytes read" |
| 6201 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6202 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6203 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6204 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6205 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6206 | 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] | 6207 | 0 \ |
| 6208 | -s "Read from client: 1 bytes read" |
| 6209 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 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 TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6212 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6213 | "$P_CLI request_size=1 force_version=tls1_2 \ |
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 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [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 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6219 | "$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] | 6220 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6221 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6222 | 0 \ |
| 6223 | -s "Read from client: 1 bytes read" |
| 6224 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6225 | 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] | 6226 | "$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] | 6227 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6228 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6229 | 0 \ |
| 6230 | -s "Read from client: 1 bytes read" |
| 6231 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6232 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6233 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6234 | "$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] | 6235 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6236 | 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] | 6237 | 0 \ |
| 6238 | -s "Read from client: 1 bytes read" |
| 6239 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6240 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6241 | 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] | 6242 | "$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] | 6243 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6244 | 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] | 6245 | 0 \ |
| 6246 | -s "Read from client: 1 bytes read" |
| 6247 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6248 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6249 | "$P_SRV" \ |
| 6250 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6251 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6252 | 0 \ |
| 6253 | -s "Read from client: 1 bytes read" |
| 6254 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6255 | 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] | 6256 | "$P_SRV" \ |
| 6257 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6258 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6259 | 0 \ |
| 6260 | -s "Read from client: 1 bytes read" |
| 6261 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6262 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6263 | |
| 6264 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6265 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6266 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6267 | "$P_CLI dtls=1 request_size=1 \ |
| 6268 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6269 | 0 \ |
| 6270 | -s "Read from client: 1 bytes read" |
| 6271 | |
| 6272 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6273 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6274 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6275 | "$P_CLI dtls=1 request_size=1 \ |
| 6276 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6277 | 0 \ |
| 6278 | -s "Read from client: 1 bytes read" |
| 6279 | |
| 6280 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6281 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6282 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6283 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6284 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6285 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6286 | 0 \ |
| 6287 | -s "Read from client: 1 bytes read" |
| 6288 | |
| 6289 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6290 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6291 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6292 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6293 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6294 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6295 | 0 \ |
| 6296 | -s "Read from client: 1 bytes read" |
| 6297 | |
| 6298 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6299 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6300 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 6301 | "$P_CLI dtls=1 request_size=1 \ |
| 6302 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6303 | 0 \ |
| 6304 | -s "Read from client: 1 bytes read" |
| 6305 | |
| 6306 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6307 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6308 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6309 | "$P_CLI dtls=1 request_size=1 \ |
| 6310 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6311 | 0 \ |
| 6312 | -s "Read from client: 1 bytes read" |
| 6313 | |
| 6314 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6315 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6316 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6317 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6318 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6319 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6320 | 0 \ |
| 6321 | -s "Read from client: 1 bytes read" |
| 6322 | |
| 6323 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6324 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6325 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6326 | "$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] | 6327 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6328 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6329 | 0 \ |
| 6330 | -s "Read from client: 1 bytes read" |
| 6331 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6332 | # Tests for small server packets |
| 6333 | |
| 6334 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6335 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6336 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6337 | "$P_CLI force_version=ssl3 \ |
| 6338 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6339 | 0 \ |
| 6340 | -c "Read from server: 1 bytes read" |
| 6341 | |
| 6342 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6343 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6344 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6345 | "$P_CLI force_version=ssl3 \ |
| 6346 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6347 | 0 \ |
| 6348 | -c "Read from server: 1 bytes read" |
| 6349 | |
| 6350 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6351 | "$P_SRV response_size=1" \ |
| 6352 | "$P_CLI force_version=tls1 \ |
| 6353 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6354 | 0 \ |
| 6355 | -c "Read from server: 1 bytes read" |
| 6356 | |
| 6357 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6358 | "$P_SRV response_size=1" \ |
| 6359 | "$P_CLI force_version=tls1 etm=0 \ |
| 6360 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6361 | 0 \ |
| 6362 | -c "Read from server: 1 bytes read" |
| 6363 | |
| 6364 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6365 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6366 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6367 | "$P_CLI force_version=tls1 \ |
| 6368 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6369 | 0 \ |
| 6370 | -c "Read from server: 1 bytes read" |
| 6371 | |
| 6372 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6373 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6374 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6375 | "$P_CLI force_version=tls1 \ |
| 6376 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6377 | 0 \ |
| 6378 | -c "Read from server: 1 bytes read" |
| 6379 | |
| 6380 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6381 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6382 | "$P_CLI force_version=tls1 \ |
| 6383 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6384 | 0 \ |
| 6385 | -c "Read from server: 1 bytes read" |
| 6386 | |
| 6387 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6388 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6389 | "$P_CLI force_version=tls1 \ |
| 6390 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6391 | 0 \ |
| 6392 | -c "Read from server: 1 bytes read" |
| 6393 | |
| 6394 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6395 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6396 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6397 | "$P_CLI force_version=tls1 \ |
| 6398 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6399 | 0 \ |
| 6400 | -c "Read from server: 1 bytes read" |
| 6401 | |
| 6402 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6403 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6404 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6405 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6406 | trunc_hmac=1 etm=0" \ |
| 6407 | 0 \ |
| 6408 | -c "Read from server: 1 bytes read" |
| 6409 | |
| 6410 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6411 | "$P_SRV response_size=1" \ |
| 6412 | "$P_CLI force_version=tls1_1 \ |
| 6413 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6414 | 0 \ |
| 6415 | -c "Read from server: 1 bytes read" |
| 6416 | |
| 6417 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6418 | "$P_SRV response_size=1" \ |
| 6419 | "$P_CLI force_version=tls1_1 \ |
| 6420 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6421 | 0 \ |
| 6422 | -c "Read from server: 1 bytes read" |
| 6423 | |
| 6424 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6425 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6426 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6427 | "$P_CLI force_version=tls1_1 \ |
| 6428 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6429 | 0 \ |
| 6430 | -c "Read from server: 1 bytes read" |
| 6431 | |
| 6432 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6433 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6434 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6435 | "$P_CLI force_version=tls1_1 \ |
| 6436 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6437 | 0 \ |
| 6438 | -c "Read from server: 1 bytes read" |
| 6439 | |
| 6440 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6441 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6442 | "$P_CLI force_version=tls1_1 \ |
| 6443 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6444 | 0 \ |
| 6445 | -c "Read from server: 1 bytes read" |
| 6446 | |
| 6447 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6448 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6449 | "$P_CLI force_version=tls1_1 \ |
| 6450 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6451 | 0 \ |
| 6452 | -c "Read from server: 1 bytes read" |
| 6453 | |
| 6454 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6455 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6456 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6457 | "$P_CLI force_version=tls1_1 \ |
| 6458 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6459 | 0 \ |
| 6460 | -c "Read from server: 1 bytes read" |
| 6461 | |
| 6462 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6463 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6464 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6465 | "$P_CLI force_version=tls1_1 \ |
| 6466 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6467 | 0 \ |
| 6468 | -c "Read from server: 1 bytes read" |
| 6469 | |
| 6470 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6471 | "$P_SRV response_size=1" \ |
| 6472 | "$P_CLI force_version=tls1_2 \ |
| 6473 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6474 | 0 \ |
| 6475 | -c "Read from server: 1 bytes read" |
| 6476 | |
| 6477 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6478 | "$P_SRV response_size=1" \ |
| 6479 | "$P_CLI force_version=tls1_2 \ |
| 6480 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6481 | 0 \ |
| 6482 | -c "Read from server: 1 bytes read" |
| 6483 | |
| 6484 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6485 | "$P_SRV response_size=1" \ |
| 6486 | "$P_CLI force_version=tls1_2 \ |
| 6487 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6488 | 0 \ |
| 6489 | -c "Read from server: 1 bytes read" |
| 6490 | |
| 6491 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6492 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6493 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6494 | "$P_CLI force_version=tls1_2 \ |
| 6495 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6496 | 0 \ |
| 6497 | -c "Read from server: 1 bytes read" |
| 6498 | |
| 6499 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6500 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6501 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6502 | "$P_CLI force_version=tls1_2 \ |
| 6503 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6504 | 0 \ |
| 6505 | -c "Read from server: 1 bytes read" |
| 6506 | |
| 6507 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6508 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6509 | "$P_CLI force_version=tls1_2 \ |
| 6510 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6511 | 0 \ |
| 6512 | -c "Read from server: 1 bytes read" |
| 6513 | |
| 6514 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6515 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6516 | "$P_CLI force_version=tls1_2 \ |
| 6517 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6518 | 0 \ |
| 6519 | -c "Read from server: 1 bytes read" |
| 6520 | |
| 6521 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6522 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6523 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6524 | "$P_CLI force_version=tls1_2 \ |
| 6525 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6526 | 0 \ |
| 6527 | -c "Read from server: 1 bytes read" |
| 6528 | |
| 6529 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6530 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6531 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6532 | "$P_CLI force_version=tls1_2 \ |
| 6533 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6534 | 0 \ |
| 6535 | -c "Read from server: 1 bytes read" |
| 6536 | |
| 6537 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6538 | "$P_SRV response_size=1" \ |
| 6539 | "$P_CLI force_version=tls1_2 \ |
| 6540 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6541 | 0 \ |
| 6542 | -c "Read from server: 1 bytes read" |
| 6543 | |
| 6544 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6545 | "$P_SRV response_size=1" \ |
| 6546 | "$P_CLI force_version=tls1_2 \ |
| 6547 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6548 | 0 \ |
| 6549 | -c "Read from server: 1 bytes read" |
| 6550 | |
| 6551 | # Tests for small server packets in DTLS |
| 6552 | |
| 6553 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6554 | run_test "Small server packet DTLS 1.0" \ |
| 6555 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6556 | "$P_CLI dtls=1 \ |
| 6557 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6558 | 0 \ |
| 6559 | -c "Read from server: 1 bytes read" |
| 6560 | |
| 6561 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6562 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6563 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6564 | "$P_CLI dtls=1 \ |
| 6565 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6566 | 0 \ |
| 6567 | -c "Read from server: 1 bytes read" |
| 6568 | |
| 6569 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6570 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6571 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6572 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6573 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6574 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6575 | 0 \ |
| 6576 | -c "Read from server: 1 bytes read" |
| 6577 | |
| 6578 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6579 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6580 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6581 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6582 | "$P_CLI dtls=1 \ |
| 6583 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6584 | 0 \ |
| 6585 | -c "Read from server: 1 bytes read" |
| 6586 | |
| 6587 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6588 | run_test "Small server packet DTLS 1.2" \ |
| 6589 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6590 | "$P_CLI dtls=1 \ |
| 6591 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6592 | 0 \ |
| 6593 | -c "Read from server: 1 bytes read" |
| 6594 | |
| 6595 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6596 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6597 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6598 | "$P_CLI dtls=1 \ |
| 6599 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6600 | 0 \ |
| 6601 | -c "Read from server: 1 bytes read" |
| 6602 | |
| 6603 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6604 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6605 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6606 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6607 | "$P_CLI dtls=1 \ |
| 6608 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6609 | 0 \ |
| 6610 | -c "Read from server: 1 bytes read" |
| 6611 | |
| 6612 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6613 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6614 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6615 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6616 | "$P_CLI dtls=1 \ |
| 6617 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6618 | 0 \ |
| 6619 | -c "Read from server: 1 bytes read" |
| 6620 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6621 | # A test for extensions in SSLv3 |
| 6622 | |
| 6623 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6624 | run_test "SSLv3 with extensions, server side" \ |
| 6625 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6626 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6627 | 0 \ |
| 6628 | -S "dumping 'client hello extensions'" \ |
| 6629 | -S "server hello, total extension length:" |
| 6630 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6631 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6632 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6633 | # How many fragments do we expect to write $1 bytes? |
| 6634 | fragments_for_write() { |
| 6635 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6636 | } |
| 6637 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6638 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6639 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6640 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6641 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6642 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6643 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6644 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6645 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6646 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6647 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6648 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6649 | "$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] | 6650 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6651 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6652 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6653 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6654 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6655 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6656 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6657 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6658 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6659 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6660 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6661 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6662 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6663 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6664 | 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] | 6665 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6666 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6667 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6668 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6669 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6670 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6671 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6672 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6673 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6674 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6675 | 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] | 6676 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6677 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6678 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6679 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6680 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6681 | 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] | 6682 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6683 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6684 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6685 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6686 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6687 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6688 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6689 | "$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] | 6690 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6691 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6692 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6693 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6694 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6695 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6696 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6697 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6698 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6699 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6700 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6701 | |
| 6702 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6703 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6704 | "$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] | 6705 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6706 | 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] | 6707 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6708 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6709 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6710 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6711 | 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] | 6712 | "$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] | 6713 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6714 | 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] | 6715 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6716 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6717 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6718 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6719 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6720 | "$P_SRV" \ |
| 6721 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6722 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6723 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6724 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6725 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6726 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6727 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6728 | "$P_SRV" \ |
| 6729 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6730 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6731 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6732 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6733 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6734 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6735 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6736 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6737 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6738 | 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] | 6739 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6740 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6741 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6742 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6743 | 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] | 6744 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6745 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6746 | 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] | 6747 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6748 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6749 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6750 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6751 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6752 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6753 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6754 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6755 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6756 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6757 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6758 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6759 | "$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] | 6760 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6761 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6762 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6763 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6764 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6765 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6766 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6767 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6768 | "$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] | 6769 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6770 | 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] | 6771 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6772 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6773 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6774 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6775 | 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] | 6776 | "$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] | 6777 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6778 | 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] | 6779 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6780 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6781 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6782 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6783 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6784 | "$P_SRV" \ |
| 6785 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6786 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6787 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6788 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6789 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6790 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6791 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6792 | "$P_SRV" \ |
| 6793 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6794 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6795 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6796 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6797 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6798 | 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] | 6799 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6800 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6801 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6802 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6803 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6804 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6805 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6806 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6807 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6808 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6809 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6810 | 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] | 6811 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6812 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6813 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6814 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6815 | 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] | 6816 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6817 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6818 | 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] | 6819 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6820 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6821 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6822 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6823 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6824 | "$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] | 6825 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6826 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6827 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6828 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6829 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6830 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6831 | 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] | 6832 | "$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] | 6833 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6834 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6835 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6836 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6837 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6839 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6840 | "$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] | 6841 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6842 | 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] | 6843 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6844 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6845 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6846 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6847 | 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] | 6848 | "$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] | 6849 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6850 | 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] | 6851 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6852 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6853 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6854 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6855 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6856 | "$P_SRV" \ |
| 6857 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6858 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6859 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6860 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6861 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6862 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6863 | 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] | 6864 | "$P_SRV" \ |
| 6865 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6866 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6867 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6868 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6869 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6870 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6871 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6872 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6873 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 6874 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6875 | "$P_CLI force_version=ssl3 \ |
| 6876 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6877 | 0 \ |
| 6878 | -c "Read from server: 16384 bytes read" |
| 6879 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6880 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 6881 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6882 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 6883 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 6884 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 6885 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6886 | 0 \ |
| 6887 | -c "Read from server: 1 bytes read"\ |
| 6888 | -c "16383 bytes read"\ |
| 6889 | -C "Read from server: 16384 bytes read" |
| 6890 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6891 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6892 | "$P_SRV response_size=16384" \ |
| 6893 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6894 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6895 | 0 \ |
| 6896 | -c "Read from server: 1 bytes read"\ |
| 6897 | -c "16383 bytes read"\ |
| 6898 | -C "Read from server: 16384 bytes read" |
| 6899 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6900 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6901 | "$P_SRV response_size=16384" \ |
| 6902 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6903 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6904 | 0 \ |
| 6905 | -c "Read from server: 1 bytes read"\ |
| 6906 | -c "16383 bytes read"\ |
| 6907 | -C "Read from server: 16384 bytes read" |
| 6908 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6909 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6910 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6911 | "$P_SRV response_size=16384" \ |
| 6912 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6913 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6914 | trunc_hmac=1" \ |
| 6915 | 0 \ |
| 6916 | -c "Read from server: 1 bytes read"\ |
| 6917 | -c "16383 bytes read"\ |
| 6918 | -C "Read from server: 16384 bytes read" |
| 6919 | |
| 6920 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6921 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6922 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6923 | "$P_CLI force_version=tls1 \ |
| 6924 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6925 | trunc_hmac=1" \ |
| 6926 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6927 | -s "16384 bytes written in 1 fragments" \ |
| 6928 | -c "Read from server: 16384 bytes read" |
| 6929 | |
| 6930 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6931 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6932 | "$P_CLI force_version=tls1 \ |
| 6933 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6934 | 0 \ |
| 6935 | -s "16384 bytes written in 1 fragments" \ |
| 6936 | -c "Read from server: 16384 bytes read" |
| 6937 | |
| 6938 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6939 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6940 | "$P_CLI force_version=tls1 \ |
| 6941 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6942 | 0 \ |
| 6943 | -s "16384 bytes written in 1 fragments" \ |
| 6944 | -c "Read from server: 16384 bytes read" |
| 6945 | |
| 6946 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6947 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6948 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6949 | "$P_CLI force_version=tls1 \ |
| 6950 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6951 | 0 \ |
| 6952 | -s "16384 bytes written in 1 fragments" \ |
| 6953 | -c "Read from server: 16384 bytes read" |
| 6954 | |
| 6955 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6956 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6957 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6958 | "$P_CLI force_version=tls1 \ |
| 6959 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6960 | 0 \ |
| 6961 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6962 | -c "Read from server: 16384 bytes read" |
| 6963 | |
| 6964 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6965 | "$P_SRV response_size=16384" \ |
| 6966 | "$P_CLI force_version=tls1_1 \ |
| 6967 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6968 | 0 \ |
| 6969 | -c "Read from server: 16384 bytes read" |
| 6970 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6971 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6972 | "$P_SRV response_size=16384" \ |
| 6973 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6974 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6975 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6976 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6977 | -c "Read from server: 16384 bytes read" |
| 6978 | |
| 6979 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6980 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6981 | "$P_SRV response_size=16384" \ |
| 6982 | "$P_CLI force_version=tls1_1 \ |
| 6983 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6984 | trunc_hmac=1" \ |
| 6985 | 0 \ |
| 6986 | -c "Read from server: 16384 bytes read" |
| 6987 | |
| 6988 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6989 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6990 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6991 | "$P_CLI force_version=tls1_1 \ |
| 6992 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6993 | 0 \ |
| 6994 | -s "16384 bytes written in 1 fragments" \ |
| 6995 | -c "Read from server: 16384 bytes read" |
| 6996 | |
| 6997 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6998 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6999 | "$P_CLI force_version=tls1_1 \ |
| 7000 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7001 | 0 \ |
| 7002 | -c "Read from server: 16384 bytes read" |
| 7003 | |
| 7004 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 7005 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7006 | "$P_CLI force_version=tls1_1 \ |
| 7007 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7008 | 0 \ |
| 7009 | -s "16384 bytes written in 1 fragments" \ |
| 7010 | -c "Read from server: 16384 bytes read" |
| 7011 | |
| 7012 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7013 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 7014 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7015 | "$P_CLI force_version=tls1_1 \ |
| 7016 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7017 | trunc_hmac=1" \ |
| 7018 | 0 \ |
| 7019 | -c "Read from server: 16384 bytes read" |
| 7020 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7021 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 7022 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7023 | "$P_CLI force_version=tls1_1 \ |
| 7024 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7025 | 0 \ |
| 7026 | -s "16384 bytes written in 1 fragments" \ |
| 7027 | -c "Read from server: 16384 bytes read" |
| 7028 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7029 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 7030 | "$P_SRV response_size=16384" \ |
| 7031 | "$P_CLI force_version=tls1_2 \ |
| 7032 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7033 | 0 \ |
| 7034 | -c "Read from server: 16384 bytes read" |
| 7035 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7036 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 7037 | "$P_SRV response_size=16384" \ |
| 7038 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 7039 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7040 | 0 \ |
| 7041 | -s "16384 bytes written in 1 fragments" \ |
| 7042 | -c "Read from server: 16384 bytes read" |
| 7043 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7044 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 7045 | "$P_SRV response_size=16384" \ |
| 7046 | "$P_CLI force_version=tls1_2 \ |
| 7047 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 7048 | 0 \ |
| 7049 | -c "Read from server: 16384 bytes read" |
| 7050 | |
| 7051 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7052 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 7053 | "$P_SRV response_size=16384" \ |
| 7054 | "$P_CLI force_version=tls1_2 \ |
| 7055 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7056 | trunc_hmac=1" \ |
| 7057 | 0 \ |
| 7058 | -c "Read from server: 16384 bytes read" |
| 7059 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7060 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 7061 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 7062 | "$P_CLI force_version=tls1_2 \ |
| 7063 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7064 | 0 \ |
| 7065 | -s "16384 bytes written in 1 fragments" \ |
| 7066 | -c "Read from server: 16384 bytes read" |
| 7067 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7068 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 7069 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7070 | "$P_CLI force_version=tls1_2 \ |
| 7071 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7072 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7073 | -s "16384 bytes written in 1 fragments" \ |
| 7074 | -c "Read from server: 16384 bytes read" |
| 7075 | |
| 7076 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 7077 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7078 | "$P_CLI force_version=tls1_2 \ |
| 7079 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7080 | 0 \ |
| 7081 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7082 | -c "Read from server: 16384 bytes read" |
| 7083 | |
| 7084 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7085 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 7086 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7087 | "$P_CLI force_version=tls1_2 \ |
| 7088 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7089 | trunc_hmac=1" \ |
| 7090 | 0 \ |
| 7091 | -c "Read from server: 16384 bytes read" |
| 7092 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7093 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7094 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7095 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7096 | "$P_CLI force_version=tls1_2 \ |
| 7097 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7098 | 0 \ |
| 7099 | -s "16384 bytes written in 1 fragments" \ |
| 7100 | -c "Read from server: 16384 bytes read" |
| 7101 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7102 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 7103 | "$P_SRV response_size=16384" \ |
| 7104 | "$P_CLI force_version=tls1_2 \ |
| 7105 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7106 | 0 \ |
| 7107 | -c "Read from server: 16384 bytes read" |
| 7108 | |
| 7109 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 7110 | "$P_SRV response_size=16384" \ |
| 7111 | "$P_CLI force_version=tls1_2 \ |
| 7112 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7113 | 0 \ |
| 7114 | -c "Read from server: 16384 bytes read" |
| 7115 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7116 | # Tests for restartable ECC |
| 7117 | |
| 7118 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7119 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7120 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7121 | "$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] | 7122 | 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] | 7123 | debug_level=1" \ |
| 7124 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7125 | -C "x509_verify_cert.*4b00" \ |
| 7126 | -C "mbedtls_pk_verify.*4b00" \ |
| 7127 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7128 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7129 | |
| 7130 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7131 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7132 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7133 | "$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] | 7134 | 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] | 7135 | debug_level=1 ec_max_ops=0" \ |
| 7136 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7137 | -C "x509_verify_cert.*4b00" \ |
| 7138 | -C "mbedtls_pk_verify.*4b00" \ |
| 7139 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7140 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7141 | |
| 7142 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7143 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7144 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7145 | "$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] | 7146 | 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] | 7147 | debug_level=1 ec_max_ops=65535" \ |
| 7148 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7149 | -C "x509_verify_cert.*4b00" \ |
| 7150 | -C "mbedtls_pk_verify.*4b00" \ |
| 7151 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7152 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7153 | |
| 7154 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7155 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7156 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7157 | "$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] | 7158 | 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] | 7159 | debug_level=1 ec_max_ops=1000" \ |
| 7160 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7161 | -c "x509_verify_cert.*4b00" \ |
| 7162 | -c "mbedtls_pk_verify.*4b00" \ |
| 7163 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7164 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7165 | |
| 7166 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7167 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7168 | "$P_SRV auth_mode=required \ |
| 7169 | crt_file=data_files/server5-badsign.crt \ |
| 7170 | key_file=data_files/server5.key" \ |
| 7171 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7172 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7173 | debug_level=1 ec_max_ops=1000" \ |
| 7174 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7175 | -c "x509_verify_cert.*4b00" \ |
| 7176 | -C "mbedtls_pk_verify.*4b00" \ |
| 7177 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7178 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7179 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7180 | -c "! mbedtls_ssl_handshake returned" \ |
| 7181 | -c "X509 - Certificate verification failed" |
| 7182 | |
| 7183 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7184 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7185 | "$P_SRV auth_mode=required \ |
| 7186 | crt_file=data_files/server5-badsign.crt \ |
| 7187 | key_file=data_files/server5.key" \ |
| 7188 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7189 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7190 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7191 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7192 | -c "x509_verify_cert.*4b00" \ |
| 7193 | -c "mbedtls_pk_verify.*4b00" \ |
| 7194 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7195 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7196 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7197 | -C "! mbedtls_ssl_handshake returned" \ |
| 7198 | -C "X509 - Certificate verification failed" |
| 7199 | |
| 7200 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7201 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7202 | "$P_SRV auth_mode=required \ |
| 7203 | crt_file=data_files/server5-badsign.crt \ |
| 7204 | key_file=data_files/server5.key" \ |
| 7205 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7206 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7207 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7208 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7209 | -C "x509_verify_cert.*4b00" \ |
| 7210 | -c "mbedtls_pk_verify.*4b00" \ |
| 7211 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7212 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7213 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7214 | -C "! mbedtls_ssl_handshake returned" \ |
| 7215 | -C "X509 - Certificate verification failed" |
| 7216 | |
| 7217 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7218 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7219 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7220 | "$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] | 7221 | 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] | 7222 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7223 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7224 | -c "x509_verify_cert.*4b00" \ |
| 7225 | -c "mbedtls_pk_verify.*4b00" \ |
| 7226 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7227 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7228 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7229 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7230 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7231 | "$P_SRV" \ |
| 7232 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7233 | debug_level=1 ec_max_ops=1000" \ |
| 7234 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7235 | -c "x509_verify_cert.*4b00" \ |
| 7236 | -c "mbedtls_pk_verify.*4b00" \ |
| 7237 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7238 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7239 | |
| 7240 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7241 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 7242 | "$P_SRV psk=abc123" \ |
| 7243 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7244 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7245 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7246 | -C "x509_verify_cert.*4b00" \ |
| 7247 | -C "mbedtls_pk_verify.*4b00" \ |
| 7248 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7249 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7250 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7251 | # Tests of asynchronous private key support in SSL |
| 7252 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7253 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7254 | run_test "SSL async private: sign, delay=0" \ |
| 7255 | "$P_SRV \ |
| 7256 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7257 | "$P_CLI" \ |
| 7258 | 0 \ |
| 7259 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7260 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7261 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7262 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7263 | run_test "SSL async private: sign, delay=1" \ |
| 7264 | "$P_SRV \ |
| 7265 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7266 | "$P_CLI" \ |
| 7267 | 0 \ |
| 7268 | -s "Async sign callback: using key slot " \ |
| 7269 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7270 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7271 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7272 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7273 | run_test "SSL async private: sign, delay=2" \ |
| 7274 | "$P_SRV \ |
| 7275 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7276 | "$P_CLI" \ |
| 7277 | 0 \ |
| 7278 | -s "Async sign callback: using key slot " \ |
| 7279 | -U "Async sign callback: using key slot " \ |
| 7280 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7281 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7282 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7283 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7284 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7285 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7286 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7287 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7288 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7289 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7290 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7291 | "$P_CLI force_version=tls1_1" \ |
| 7292 | 0 \ |
| 7293 | -s "Async sign callback: using key slot " \ |
| 7294 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7295 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7296 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7297 | run_test "SSL async private: sign, SNI" \ |
| 7298 | "$P_SRV debug_level=3 \ |
| 7299 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7300 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7301 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7302 | "$P_CLI server_name=polarssl.example" \ |
| 7303 | 0 \ |
| 7304 | -s "Async sign callback: using key slot " \ |
| 7305 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7306 | -s "parse ServerName extension" \ |
| 7307 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7308 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7309 | |
| 7310 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7311 | run_test "SSL async private: decrypt, delay=0" \ |
| 7312 | "$P_SRV \ |
| 7313 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7314 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7315 | 0 \ |
| 7316 | -s "Async decrypt callback: using key slot " \ |
| 7317 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7318 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7319 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7320 | run_test "SSL async private: decrypt, delay=1" \ |
| 7321 | "$P_SRV \ |
| 7322 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7323 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7324 | 0 \ |
| 7325 | -s "Async decrypt callback: using key slot " \ |
| 7326 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7327 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7328 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7329 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7330 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7331 | "$P_SRV psk=abc123 \ |
| 7332 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7333 | "$P_CLI psk=abc123 \ |
| 7334 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7335 | 0 \ |
| 7336 | -s "Async decrypt callback: using key slot " \ |
| 7337 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7338 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7339 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7340 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7341 | "$P_SRV psk=abc123 \ |
| 7342 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7343 | "$P_CLI psk=abc123 \ |
| 7344 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7345 | 0 \ |
| 7346 | -s "Async decrypt callback: using key slot " \ |
| 7347 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7348 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7349 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7350 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7351 | run_test "SSL async private: sign callback not present" \ |
| 7352 | "$P_SRV \ |
| 7353 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7354 | "$P_CLI; [ \$? -eq 1 ] && |
| 7355 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7356 | 0 \ |
| 7357 | -S "Async sign callback" \ |
| 7358 | -s "! mbedtls_ssl_handshake returned" \ |
| 7359 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7360 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7361 | -s "Successful connection" |
| 7362 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7363 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7364 | run_test "SSL async private: decrypt callback not present" \ |
| 7365 | "$P_SRV debug_level=1 \ |
| 7366 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7367 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7368 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7369 | 0 \ |
| 7370 | -S "Async decrypt callback" \ |
| 7371 | -s "! mbedtls_ssl_handshake returned" \ |
| 7372 | -s "got no RSA private key" \ |
| 7373 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7374 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7375 | |
| 7376 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7377 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7378 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7379 | "$P_SRV \ |
| 7380 | async_operations=s async_private_delay1=1 \ |
| 7381 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7382 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7383 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7384 | 0 \ |
| 7385 | -s "Async sign callback: using key slot 0," \ |
| 7386 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7387 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7388 | |
| 7389 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7390 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7391 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7392 | "$P_SRV \ |
| 7393 | async_operations=s async_private_delay2=1 \ |
| 7394 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7395 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7396 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7397 | 0 \ |
| 7398 | -s "Async sign callback: using key slot 0," \ |
| 7399 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7400 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7401 | |
| 7402 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7403 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7404 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7405 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7406 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7407 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7408 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7409 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7410 | 0 \ |
| 7411 | -s "Async sign callback: using key slot 1," \ |
| 7412 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7413 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7414 | |
| 7415 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7416 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7417 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7418 | "$P_SRV \ |
| 7419 | async_operations=s async_private_delay1=1 \ |
| 7420 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7421 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7422 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7423 | 0 \ |
| 7424 | -s "Async sign callback: no key matches this certificate." |
| 7425 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7426 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7427 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7428 | "$P_SRV \ |
| 7429 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7430 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7431 | "$P_CLI" \ |
| 7432 | 1 \ |
| 7433 | -s "Async sign callback: injected error" \ |
| 7434 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7435 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7436 | -s "! mbedtls_ssl_handshake returned" |
| 7437 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7438 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7439 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7440 | "$P_SRV \ |
| 7441 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7442 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7443 | "$P_CLI" \ |
| 7444 | 1 \ |
| 7445 | -s "Async sign callback: using key slot " \ |
| 7446 | -S "Async resume" \ |
| 7447 | -s "Async cancel" |
| 7448 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7449 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7450 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7451 | "$P_SRV \ |
| 7452 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7453 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7454 | "$P_CLI" \ |
| 7455 | 1 \ |
| 7456 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7457 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7458 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7459 | -s "! mbedtls_ssl_handshake returned" |
| 7460 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7461 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7462 | run_test "SSL async private: decrypt, error in start" \ |
| 7463 | "$P_SRV \ |
| 7464 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7465 | async_private_error=1" \ |
| 7466 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7467 | 1 \ |
| 7468 | -s "Async decrypt callback: injected error" \ |
| 7469 | -S "Async resume" \ |
| 7470 | -S "Async cancel" \ |
| 7471 | -s "! mbedtls_ssl_handshake returned" |
| 7472 | |
| 7473 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7474 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7475 | "$P_SRV \ |
| 7476 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7477 | async_private_error=2" \ |
| 7478 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7479 | 1 \ |
| 7480 | -s "Async decrypt callback: using key slot " \ |
| 7481 | -S "Async resume" \ |
| 7482 | -s "Async cancel" |
| 7483 | |
| 7484 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7485 | run_test "SSL async private: decrypt, error in resume" \ |
| 7486 | "$P_SRV \ |
| 7487 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7488 | async_private_error=3" \ |
| 7489 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7490 | 1 \ |
| 7491 | -s "Async decrypt callback: using key slot " \ |
| 7492 | -s "Async resume callback: decrypt done but injected error" \ |
| 7493 | -S "Async cancel" \ |
| 7494 | -s "! mbedtls_ssl_handshake returned" |
| 7495 | |
| 7496 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7497 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7498 | "$P_SRV \ |
| 7499 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7500 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7501 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7502 | 0 \ |
| 7503 | -s "Async cancel" \ |
| 7504 | -s "! mbedtls_ssl_handshake returned" \ |
| 7505 | -s "Async resume" \ |
| 7506 | -s "Successful connection" |
| 7507 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7508 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7509 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7510 | "$P_SRV \ |
| 7511 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7512 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7513 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7514 | 0 \ |
| 7515 | -s "! mbedtls_ssl_handshake returned" \ |
| 7516 | -s "Async resume" \ |
| 7517 | -s "Successful connection" |
| 7518 | |
| 7519 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7520 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7521 | 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] | 7522 | "$P_SRV \ |
| 7523 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7524 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7525 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7526 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7527 | [ \$? -eq 1 ] && |
| 7528 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7529 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7530 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7531 | -S "Async resume" \ |
| 7532 | -s "Async cancel" \ |
| 7533 | -s "! mbedtls_ssl_handshake returned" \ |
| 7534 | -s "Async sign callback: no key matches this certificate." \ |
| 7535 | -s "Successful connection" |
| 7536 | |
| 7537 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7538 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7539 | 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] | 7540 | "$P_SRV \ |
| 7541 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7542 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7543 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7544 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7545 | [ \$? -eq 1 ] && |
| 7546 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7547 | 0 \ |
| 7548 | -s "Async resume" \ |
| 7549 | -s "! mbedtls_ssl_handshake returned" \ |
| 7550 | -s "Async sign callback: no key matches this certificate." \ |
| 7551 | -s "Successful connection" |
| 7552 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7553 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7554 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7555 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7556 | "$P_SRV \ |
| 7557 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7558 | exchanges=2 renegotiation=1" \ |
| 7559 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7560 | 0 \ |
| 7561 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7562 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7563 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7564 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7565 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7566 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7567 | "$P_SRV \ |
| 7568 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7569 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7570 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7571 | 0 \ |
| 7572 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7573 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7574 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7575 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7576 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7577 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7578 | "$P_SRV \ |
| 7579 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7580 | exchanges=2 renegotiation=1" \ |
| 7581 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7582 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7583 | 0 \ |
| 7584 | -s "Async decrypt callback: using key slot " \ |
| 7585 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7586 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7587 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7588 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7589 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7590 | "$P_SRV \ |
| 7591 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7592 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7593 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7594 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7595 | 0 \ |
| 7596 | -s "Async decrypt callback: using key slot " \ |
| 7597 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7598 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7599 | # Tests for ECC extensions (rfc 4492) |
| 7600 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7601 | requires_config_enabled MBEDTLS_AES_C |
| 7602 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7603 | requires_config_enabled MBEDTLS_SHA256_C |
| 7604 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7605 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7606 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7607 | "$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] | 7608 | 0 \ |
| 7609 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7610 | -C "client hello, adding supported_point_formats extension" \ |
| 7611 | -S "found supported elliptic curves extension" \ |
| 7612 | -S "found supported point formats extension" |
| 7613 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7614 | requires_config_enabled MBEDTLS_AES_C |
| 7615 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7616 | requires_config_enabled MBEDTLS_SHA256_C |
| 7617 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7618 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7619 | "$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] | 7620 | "$P_CLI debug_level=3" \ |
| 7621 | 0 \ |
| 7622 | -C "found supported_point_formats extension" \ |
| 7623 | -S "server hello, supported_point_formats extension" |
| 7624 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7625 | requires_config_enabled MBEDTLS_AES_C |
| 7626 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7627 | requires_config_enabled MBEDTLS_SHA256_C |
| 7628 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7629 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7630 | "$P_SRV debug_level=3" \ |
| 7631 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7632 | 0 \ |
| 7633 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7634 | -c "client hello, adding supported_point_formats extension" \ |
| 7635 | -s "found supported elliptic curves extension" \ |
| 7636 | -s "found supported point formats extension" |
| 7637 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7638 | requires_config_enabled MBEDTLS_AES_C |
| 7639 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7640 | requires_config_enabled MBEDTLS_SHA256_C |
| 7641 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7642 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7643 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7644 | "$P_CLI debug_level=3" \ |
| 7645 | 0 \ |
| 7646 | -c "found supported_point_formats extension" \ |
| 7647 | -s "server hello, supported_point_formats extension" |
| 7648 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7649 | # Tests for DTLS HelloVerifyRequest |
| 7650 | |
| 7651 | run_test "DTLS cookie: enabled" \ |
| 7652 | "$P_SRV dtls=1 debug_level=2" \ |
| 7653 | "$P_CLI dtls=1 debug_level=2" \ |
| 7654 | 0 \ |
| 7655 | -s "cookie verification failed" \ |
| 7656 | -s "cookie verification passed" \ |
| 7657 | -S "cookie verification skipped" \ |
| 7658 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7659 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7660 | -S "SSL - The requested feature is not available" |
| 7661 | |
| 7662 | run_test "DTLS cookie: disabled" \ |
| 7663 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7664 | "$P_CLI dtls=1 debug_level=2" \ |
| 7665 | 0 \ |
| 7666 | -S "cookie verification failed" \ |
| 7667 | -S "cookie verification passed" \ |
| 7668 | -s "cookie verification skipped" \ |
| 7669 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7670 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7671 | -S "SSL - The requested feature is not available" |
| 7672 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7673 | run_test "DTLS cookie: default (failing)" \ |
| 7674 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7675 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7676 | 1 \ |
| 7677 | -s "cookie verification failed" \ |
| 7678 | -S "cookie verification passed" \ |
| 7679 | -S "cookie verification skipped" \ |
| 7680 | -C "received hello verify request" \ |
| 7681 | -S "hello verification requested" \ |
| 7682 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7683 | |
| 7684 | requires_ipv6 |
| 7685 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7686 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7687 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7688 | 0 \ |
| 7689 | -s "cookie verification failed" \ |
| 7690 | -s "cookie verification passed" \ |
| 7691 | -S "cookie verification skipped" \ |
| 7692 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7693 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7694 | -S "SSL - The requested feature is not available" |
| 7695 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7696 | run_test "DTLS cookie: enabled, nbio" \ |
| 7697 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7698 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7699 | 0 \ |
| 7700 | -s "cookie verification failed" \ |
| 7701 | -s "cookie verification passed" \ |
| 7702 | -S "cookie verification skipped" \ |
| 7703 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7704 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7705 | -S "SSL - The requested feature is not available" |
| 7706 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7707 | # Tests for client reconnecting from the same port with DTLS |
| 7708 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7709 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7710 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7711 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7712 | "$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] | 7713 | 0 \ |
| 7714 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7715 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7716 | -S "Client initiated reconnection from same port" |
| 7717 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7718 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7719 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7720 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7721 | "$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] | 7722 | 0 \ |
| 7723 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7724 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7725 | -s "Client initiated reconnection from same port" |
| 7726 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7727 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7728 | 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] | 7729 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7730 | "$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] | 7731 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7732 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7733 | -s "Client initiated reconnection from same port" |
| 7734 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7735 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7736 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7737 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7738 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7739 | 0 \ |
| 7740 | -S "The operation timed out" \ |
| 7741 | -s "Client initiated reconnection from same port" |
| 7742 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7743 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7744 | "$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] | 7745 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7746 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7747 | -s "The operation timed out" \ |
| 7748 | -S "Client initiated reconnection from same port" |
| 7749 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7750 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7751 | -p "$P_PXY inject_clihlo=1" \ |
| 7752 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7753 | "$P_CLI dtls=1 exchanges=2" \ |
| 7754 | 0 \ |
| 7755 | -s "possible client reconnect from the same port" \ |
| 7756 | -S "Client initiated reconnection from same port" |
| 7757 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7758 | # Tests for various cases of client authentication with DTLS |
| 7759 | # (focused on handshake flows and message parsing) |
| 7760 | |
| 7761 | run_test "DTLS client auth: required" \ |
| 7762 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7763 | "$P_CLI dtls=1" \ |
| 7764 | 0 \ |
| 7765 | -s "Verifying peer X.509 certificate... ok" |
| 7766 | |
| 7767 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7768 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7769 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7770 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7771 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7772 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7773 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7774 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7775 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7776 | 0 \ |
| 7777 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7778 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7779 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7780 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7781 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7782 | "$P_CLI dtls=1 psk=abc124" \ |
| 7783 | 1 \ |
| 7784 | -s "SSL - Verification of the message MAC failed" \ |
| 7785 | -c "SSL - A fatal alert message was received from our peer" |
| 7786 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7787 | # Tests for receiving fragmented handshake messages with DTLS |
| 7788 | |
| 7789 | requires_gnutls |
| 7790 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7791 | "$G_SRV -u --mtu 2048 -a" \ |
| 7792 | "$P_CLI dtls=1 debug_level=2" \ |
| 7793 | 0 \ |
| 7794 | -C "found fragmented DTLS handshake message" \ |
| 7795 | -C "error" |
| 7796 | |
| 7797 | requires_gnutls |
| 7798 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7799 | "$G_SRV -u --mtu 512" \ |
| 7800 | "$P_CLI dtls=1 debug_level=2" \ |
| 7801 | 0 \ |
| 7802 | -c "found fragmented DTLS handshake message" \ |
| 7803 | -C "error" |
| 7804 | |
| 7805 | requires_gnutls |
| 7806 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7807 | "$G_SRV -u --mtu 128" \ |
| 7808 | "$P_CLI dtls=1 debug_level=2" \ |
| 7809 | 0 \ |
| 7810 | -c "found fragmented DTLS handshake message" \ |
| 7811 | -C "error" |
| 7812 | |
| 7813 | requires_gnutls |
| 7814 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7815 | "$G_SRV -u --mtu 128" \ |
| 7816 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7817 | 0 \ |
| 7818 | -c "found fragmented DTLS handshake message" \ |
| 7819 | -C "error" |
| 7820 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7821 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7822 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7823 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7824 | "$G_SRV -u --mtu 256" \ |
| 7825 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7826 | 0 \ |
| 7827 | -c "found fragmented DTLS handshake message" \ |
| 7828 | -c "client hello, adding renegotiation extension" \ |
| 7829 | -c "found renegotiation extension" \ |
| 7830 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7831 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7832 | -C "error" \ |
| 7833 | -s "Extra-header:" |
| 7834 | |
| 7835 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7836 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7837 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7838 | "$G_SRV -u --mtu 256" \ |
| 7839 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7840 | 0 \ |
| 7841 | -c "found fragmented DTLS handshake message" \ |
| 7842 | -c "client hello, adding renegotiation extension" \ |
| 7843 | -c "found renegotiation extension" \ |
| 7844 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7845 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7846 | -C "error" \ |
| 7847 | -s "Extra-header:" |
| 7848 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7849 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7850 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7851 | "$P_CLI dtls=1 debug_level=2" \ |
| 7852 | 0 \ |
| 7853 | -C "found fragmented DTLS handshake message" \ |
| 7854 | -C "error" |
| 7855 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7856 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7857 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7858 | "$P_CLI dtls=1 debug_level=2" \ |
| 7859 | 0 \ |
| 7860 | -c "found fragmented DTLS handshake message" \ |
| 7861 | -C "error" |
| 7862 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7863 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7864 | "$O_SRV -dtls1 -mtu 256" \ |
| 7865 | "$P_CLI dtls=1 debug_level=2" \ |
| 7866 | 0 \ |
| 7867 | -c "found fragmented DTLS handshake message" \ |
| 7868 | -C "error" |
| 7869 | |
| 7870 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7871 | "$O_SRV -dtls1 -mtu 256" \ |
| 7872 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7873 | 0 \ |
| 7874 | -c "found fragmented DTLS handshake message" \ |
| 7875 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7876 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7877 | # Tests for sending fragmented handshake messages with DTLS |
| 7878 | # |
| 7879 | # Use client auth when we need the client to send large messages, |
| 7880 | # and use large cert chains on both sides too (the long chains we have all use |
| 7881 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7882 | # Sizes reached (UDP payload): |
| 7883 | # - 2037B for server certificate |
| 7884 | # - 1542B for client certificate |
| 7885 | # - 1013B for newsessionticket |
| 7886 | # - all others below 512B |
| 7887 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7888 | |
| 7889 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7890 | requires_config_enabled MBEDTLS_RSA_C |
| 7891 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7892 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7893 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7894 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7895 | crt_file=data_files/server7_int-ca.crt \ |
| 7896 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7897 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7898 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7899 | "$P_CLI dtls=1 debug_level=2 \ |
| 7900 | crt_file=data_files/server8_int-ca2.crt \ |
| 7901 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7902 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7903 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7904 | 0 \ |
| 7905 | -S "found fragmented DTLS handshake message" \ |
| 7906 | -C "found fragmented DTLS handshake message" \ |
| 7907 | -C "error" |
| 7908 | |
| 7909 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7910 | requires_config_enabled MBEDTLS_RSA_C |
| 7911 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7912 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7913 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7914 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7915 | crt_file=data_files/server7_int-ca.crt \ |
| 7916 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7917 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7918 | max_frag_len=1024" \ |
| 7919 | "$P_CLI dtls=1 debug_level=2 \ |
| 7920 | crt_file=data_files/server8_int-ca2.crt \ |
| 7921 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7922 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7923 | max_frag_len=2048" \ |
| 7924 | 0 \ |
| 7925 | -S "found fragmented DTLS handshake message" \ |
| 7926 | -c "found fragmented DTLS handshake message" \ |
| 7927 | -C "error" |
| 7928 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7929 | # With the MFL extension, the server has no way of forcing |
| 7930 | # the client to not exceed a certain MTU; hence, the following |
| 7931 | # test can't be replicated with an MTU proxy such as the one |
| 7932 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7933 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7934 | requires_config_enabled MBEDTLS_RSA_C |
| 7935 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7936 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7937 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7938 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7939 | crt_file=data_files/server7_int-ca.crt \ |
| 7940 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7941 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7942 | max_frag_len=512" \ |
| 7943 | "$P_CLI dtls=1 debug_level=2 \ |
| 7944 | crt_file=data_files/server8_int-ca2.crt \ |
| 7945 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7946 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7947 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7948 | 0 \ |
| 7949 | -S "found fragmented DTLS handshake message" \ |
| 7950 | -c "found fragmented DTLS handshake message" \ |
| 7951 | -C "error" |
| 7952 | |
| 7953 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7954 | requires_config_enabled MBEDTLS_RSA_C |
| 7955 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7956 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7957 | 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] | 7958 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7959 | crt_file=data_files/server7_int-ca.crt \ |
| 7960 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7961 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7962 | max_frag_len=2048" \ |
| 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 | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7966 | hs_timeout=2500-60000 \ |
| 7967 | max_frag_len=1024" \ |
| 7968 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7969 | -S "found fragmented DTLS handshake message" \ |
| 7970 | -c "found fragmented DTLS handshake message" \ |
| 7971 | -C "error" |
| 7972 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7973 | # While not required by the standard defining the MFL extension |
| 7974 | # (according to which it only applies to records, not to datagrams), |
| 7975 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7976 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7977 | # to the peer. |
| 7978 | # The next test checks that no datagrams significantly larger than the |
| 7979 | # negotiated MFL are sent. |
| 7980 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7981 | requires_config_enabled MBEDTLS_RSA_C |
| 7982 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7983 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7984 | 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] | 7985 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7986 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7987 | crt_file=data_files/server7_int-ca.crt \ |
| 7988 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7989 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7990 | max_frag_len=2048" \ |
| 7991 | "$P_CLI dtls=1 debug_level=2 \ |
| 7992 | crt_file=data_files/server8_int-ca2.crt \ |
| 7993 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7994 | hs_timeout=2500-60000 \ |
| 7995 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7996 | 0 \ |
| 7997 | -S "found fragmented DTLS handshake message" \ |
| 7998 | -c "found fragmented DTLS handshake message" \ |
| 7999 | -C "error" |
| 8000 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8001 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8002 | requires_config_enabled MBEDTLS_RSA_C |
| 8003 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8004 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8005 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8006 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8007 | crt_file=data_files/server7_int-ca.crt \ |
| 8008 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8009 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8010 | max_frag_len=2048" \ |
| 8011 | "$P_CLI dtls=1 debug_level=2 \ |
| 8012 | crt_file=data_files/server8_int-ca2.crt \ |
| 8013 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8014 | hs_timeout=2500-60000 \ |
| 8015 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8016 | 0 \ |
| 8017 | -s "found fragmented DTLS handshake message" \ |
| 8018 | -c "found fragmented DTLS handshake message" \ |
| 8019 | -C "error" |
| 8020 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8021 | # While not required by the standard defining the MFL extension |
| 8022 | # (according to which it only applies to records, not to datagrams), |
| 8023 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8024 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8025 | # to the peer. |
| 8026 | # The next test checks that no datagrams significantly larger than the |
| 8027 | # negotiated MFL are sent. |
| 8028 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8029 | requires_config_enabled MBEDTLS_RSA_C |
| 8030 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8031 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 8032 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8033 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8034 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8035 | crt_file=data_files/server7_int-ca.crt \ |
| 8036 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8037 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8038 | max_frag_len=2048" \ |
| 8039 | "$P_CLI dtls=1 debug_level=2 \ |
| 8040 | crt_file=data_files/server8_int-ca2.crt \ |
| 8041 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8042 | hs_timeout=2500-60000 \ |
| 8043 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8044 | 0 \ |
| 8045 | -s "found fragmented DTLS handshake message" \ |
| 8046 | -c "found fragmented DTLS handshake message" \ |
| 8047 | -C "error" |
| 8048 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8049 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8050 | requires_config_enabled MBEDTLS_RSA_C |
| 8051 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8052 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8053 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8054 | crt_file=data_files/server7_int-ca.crt \ |
| 8055 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8056 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8057 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8058 | "$P_CLI dtls=1 debug_level=2 \ |
| 8059 | crt_file=data_files/server8_int-ca2.crt \ |
| 8060 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8061 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8062 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8063 | 0 \ |
| 8064 | -S "found fragmented DTLS handshake message" \ |
| 8065 | -C "found fragmented DTLS handshake message" \ |
| 8066 | -C "error" |
| 8067 | |
| 8068 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8069 | requires_config_enabled MBEDTLS_RSA_C |
| 8070 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8071 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8072 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8073 | crt_file=data_files/server7_int-ca.crt \ |
| 8074 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8075 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8076 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8077 | "$P_CLI dtls=1 debug_level=2 \ |
| 8078 | crt_file=data_files/server8_int-ca2.crt \ |
| 8079 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8080 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8081 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8082 | 0 \ |
| 8083 | -s "found fragmented DTLS handshake message" \ |
| 8084 | -C "found fragmented DTLS handshake message" \ |
| 8085 | -C "error" |
| 8086 | |
| 8087 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8088 | requires_config_enabled MBEDTLS_RSA_C |
| 8089 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8090 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8091 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8092 | crt_file=data_files/server7_int-ca.crt \ |
| 8093 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8094 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8095 | mtu=512" \ |
| 8096 | "$P_CLI dtls=1 debug_level=2 \ |
| 8097 | crt_file=data_files/server8_int-ca2.crt \ |
| 8098 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8099 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8100 | mtu=2048" \ |
| 8101 | 0 \ |
| 8102 | -S "found fragmented DTLS handshake message" \ |
| 8103 | -c "found fragmented DTLS handshake message" \ |
| 8104 | -C "error" |
| 8105 | |
| 8106 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8107 | requires_config_enabled MBEDTLS_RSA_C |
| 8108 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8109 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8110 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8111 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8112 | crt_file=data_files/server7_int-ca.crt \ |
| 8113 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8114 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8115 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8116 | "$P_CLI dtls=1 debug_level=2 \ |
| 8117 | crt_file=data_files/server8_int-ca2.crt \ |
| 8118 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8119 | hs_timeout=2500-60000 \ |
| 8120 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8121 | 0 \ |
| 8122 | -s "found fragmented DTLS handshake message" \ |
| 8123 | -c "found fragmented DTLS handshake message" \ |
| 8124 | -C "error" |
| 8125 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8126 | # 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] | 8127 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8128 | requires_config_enabled MBEDTLS_RSA_C |
| 8129 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8130 | requires_config_enabled MBEDTLS_SHA256_C |
| 8131 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8132 | requires_config_enabled MBEDTLS_AES_C |
| 8133 | requires_config_enabled MBEDTLS_GCM_C |
| 8134 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8135 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8136 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8137 | crt_file=data_files/server7_int-ca.crt \ |
| 8138 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8139 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8140 | mtu=512" \ |
| 8141 | "$P_CLI dtls=1 debug_level=2 \ |
| 8142 | crt_file=data_files/server8_int-ca2.crt \ |
| 8143 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8144 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8145 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8146 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8147 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8148 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8149 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8150 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8151 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8152 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8153 | # 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] | 8154 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8155 | # retransmissions, but in some cases (like both the server and client using |
| 8156 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8157 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8158 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8159 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8160 | requires_config_enabled MBEDTLS_RSA_C |
| 8161 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8162 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8163 | requires_config_enabled MBEDTLS_AES_C |
| 8164 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8165 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8166 | -p "$P_PXY mtu=508" \ |
| 8167 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8168 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8169 | key_file=data_files/server7.key \ |
| 8170 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8171 | "$P_CLI dtls=1 debug_level=2 \ |
| 8172 | crt_file=data_files/server8_int-ca2.crt \ |
| 8173 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8174 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8175 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8176 | 0 \ |
| 8177 | -s "found fragmented DTLS handshake message" \ |
| 8178 | -c "found fragmented DTLS handshake message" \ |
| 8179 | -C "error" |
| 8180 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8181 | # 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] | 8182 | only_with_valgrind |
| 8183 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8184 | requires_config_enabled MBEDTLS_RSA_C |
| 8185 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8186 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8187 | requires_config_enabled MBEDTLS_AES_C |
| 8188 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8189 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8190 | -p "$P_PXY mtu=508" \ |
| 8191 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8192 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8193 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8194 | hs_timeout=250-10000" \ |
| 8195 | "$P_CLI dtls=1 debug_level=2 \ |
| 8196 | crt_file=data_files/server8_int-ca2.crt \ |
| 8197 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8198 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8199 | hs_timeout=250-10000" \ |
| 8200 | 0 \ |
| 8201 | -s "found fragmented DTLS handshake message" \ |
| 8202 | -c "found fragmented DTLS handshake message" \ |
| 8203 | -C "error" |
| 8204 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8205 | # 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] | 8206 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8207 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8208 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8209 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8210 | requires_config_enabled MBEDTLS_RSA_C |
| 8211 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8212 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8213 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 \ |
| 8218 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 \ |
| 8223 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8224 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8225 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8226 | -s "found fragmented DTLS handshake message" \ |
| 8227 | -c "found fragmented DTLS handshake message" \ |
| 8228 | -C "error" |
| 8229 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8230 | # 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] | 8231 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8232 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8233 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8234 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8235 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8236 | requires_config_enabled MBEDTLS_RSA_C |
| 8237 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8238 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8239 | requires_config_enabled MBEDTLS_AES_C |
| 8240 | requires_config_enabled MBEDTLS_GCM_C |
| 8241 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 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 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8246 | hs_timeout=10000-60000 \ |
| 8247 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8248 | "$P_CLI dtls=1 debug_level=2 \ |
| 8249 | crt_file=data_files/server8_int-ca2.crt \ |
| 8250 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8251 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8252 | hs_timeout=10000-60000 \ |
| 8253 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8254 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8255 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8256 | -s "found fragmented DTLS handshake message" \ |
| 8257 | -c "found fragmented DTLS handshake message" \ |
| 8258 | -C "error" |
| 8259 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8260 | not_with_valgrind # spurious autoreduction due to timeout |
| 8261 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8262 | requires_config_enabled MBEDTLS_RSA_C |
| 8263 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8264 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8265 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8266 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8267 | crt_file=data_files/server7_int-ca.crt \ |
| 8268 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8269 | hs_timeout=10000-60000 \ |
| 8270 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8271 | "$P_CLI dtls=1 debug_level=2 \ |
| 8272 | crt_file=data_files/server8_int-ca2.crt \ |
| 8273 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8274 | hs_timeout=10000-60000 \ |
| 8275 | mtu=1024 nbio=2" \ |
| 8276 | 0 \ |
| 8277 | -S "autoreduction" \ |
| 8278 | -s "found fragmented DTLS handshake message" \ |
| 8279 | -c "found fragmented DTLS handshake message" \ |
| 8280 | -C "error" |
| 8281 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8282 | # 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] | 8283 | not_with_valgrind # spurious autoreduction due to timeout |
| 8284 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8285 | requires_config_enabled MBEDTLS_RSA_C |
| 8286 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8287 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8288 | requires_config_enabled MBEDTLS_AES_C |
| 8289 | requires_config_enabled MBEDTLS_GCM_C |
| 8290 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8291 | -p "$P_PXY mtu=512" \ |
| 8292 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8293 | crt_file=data_files/server7_int-ca.crt \ |
| 8294 | key_file=data_files/server7.key \ |
| 8295 | hs_timeout=10000-60000 \ |
| 8296 | mtu=512 nbio=2" \ |
| 8297 | "$P_CLI dtls=1 debug_level=2 \ |
| 8298 | crt_file=data_files/server8_int-ca2.crt \ |
| 8299 | key_file=data_files/server8.key \ |
| 8300 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8301 | hs_timeout=10000-60000 \ |
| 8302 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8303 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8304 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8305 | -s "found fragmented DTLS handshake message" \ |
| 8306 | -c "found fragmented DTLS handshake message" \ |
| 8307 | -C "error" |
| 8308 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8309 | # 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] | 8310 | # This ensures things still work after session_reset(). |
| 8311 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8312 | # Since we don't support reading fragmented ClientHello yet, |
| 8313 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8314 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8315 | # An autoreduction on the client-side might happen if the server is |
| 8316 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8317 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8318 | # resumed listening, which would result in a spurious autoreduction. |
| 8319 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8320 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8321 | requires_config_enabled MBEDTLS_RSA_C |
| 8322 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8323 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8324 | requires_config_enabled MBEDTLS_AES_C |
| 8325 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8326 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8327 | -p "$P_PXY mtu=1450" \ |
| 8328 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8329 | crt_file=data_files/server7_int-ca.crt \ |
| 8330 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8331 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8332 | mtu=1450" \ |
| 8333 | "$P_CLI dtls=1 debug_level=2 \ |
| 8334 | crt_file=data_files/server8_int-ca2.crt \ |
| 8335 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8336 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8337 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8338 | 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] | 8339 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8340 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8341 | -s "found fragmented DTLS handshake message" \ |
| 8342 | -c "found fragmented DTLS handshake message" \ |
| 8343 | -C "error" |
| 8344 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8345 | # An autoreduction on the client-side might happen if the server is |
| 8346 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8347 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8348 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8349 | requires_config_enabled MBEDTLS_RSA_C |
| 8350 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8351 | requires_config_enabled MBEDTLS_SHA256_C |
| 8352 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8353 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8354 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 8355 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8356 | -p "$P_PXY mtu=512" \ |
| 8357 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8358 | crt_file=data_files/server7_int-ca.crt \ |
| 8359 | key_file=data_files/server7.key \ |
| 8360 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8361 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8362 | mtu=512" \ |
| 8363 | "$P_CLI dtls=1 debug_level=2 \ |
| 8364 | crt_file=data_files/server8_int-ca2.crt \ |
| 8365 | key_file=data_files/server8.key \ |
| 8366 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8367 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8368 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8369 | mtu=512" \ |
| 8370 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8371 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8372 | -s "found fragmented DTLS handshake message" \ |
| 8373 | -c "found fragmented DTLS handshake message" \ |
| 8374 | -C "error" |
| 8375 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8376 | # An autoreduction on the client-side might happen if the server is |
| 8377 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8378 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8379 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8380 | requires_config_enabled MBEDTLS_RSA_C |
| 8381 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8382 | requires_config_enabled MBEDTLS_SHA256_C |
| 8383 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8384 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8385 | requires_config_enabled MBEDTLS_AES_C |
| 8386 | requires_config_enabled MBEDTLS_GCM_C |
| 8387 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8388 | -p "$P_PXY mtu=512" \ |
| 8389 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8390 | crt_file=data_files/server7_int-ca.crt \ |
| 8391 | key_file=data_files/server7.key \ |
| 8392 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8393 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8394 | mtu=512" \ |
| 8395 | "$P_CLI dtls=1 debug_level=2 \ |
| 8396 | crt_file=data_files/server8_int-ca2.crt \ |
| 8397 | key_file=data_files/server8.key \ |
| 8398 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8399 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8400 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8401 | mtu=512" \ |
| 8402 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8403 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8404 | -s "found fragmented DTLS handshake message" \ |
| 8405 | -c "found fragmented DTLS handshake message" \ |
| 8406 | -C "error" |
| 8407 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8408 | # An autoreduction on the client-side might happen if the server is |
| 8409 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8410 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8411 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8412 | requires_config_enabled MBEDTLS_RSA_C |
| 8413 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8414 | requires_config_enabled MBEDTLS_SHA256_C |
| 8415 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8416 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8417 | requires_config_enabled MBEDTLS_AES_C |
| 8418 | requires_config_enabled MBEDTLS_CCM_C |
| 8419 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8420 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8421 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8422 | crt_file=data_files/server7_int-ca.crt \ |
| 8423 | key_file=data_files/server7.key \ |
| 8424 | exchanges=2 renegotiation=1 \ |
| 8425 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8426 | hs_timeout=10000-60000 \ |
| 8427 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8428 | "$P_CLI dtls=1 debug_level=2 \ |
| 8429 | crt_file=data_files/server8_int-ca2.crt \ |
| 8430 | key_file=data_files/server8.key \ |
| 8431 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8432 | hs_timeout=10000-60000 \ |
| 8433 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8434 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8435 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8436 | -s "found fragmented DTLS handshake message" \ |
| 8437 | -c "found fragmented DTLS handshake message" \ |
| 8438 | -C "error" |
| 8439 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8440 | # An autoreduction on the client-side might happen if the server is |
| 8441 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8442 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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_SHA256_C |
| 8447 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8448 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8449 | requires_config_enabled MBEDTLS_AES_C |
| 8450 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8451 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 8452 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8453 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8454 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8455 | crt_file=data_files/server7_int-ca.crt \ |
| 8456 | key_file=data_files/server7.key \ |
| 8457 | exchanges=2 renegotiation=1 \ |
| 8458 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8459 | hs_timeout=10000-60000 \ |
| 8460 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8461 | "$P_CLI dtls=1 debug_level=2 \ |
| 8462 | crt_file=data_files/server8_int-ca2.crt \ |
| 8463 | key_file=data_files/server8.key \ |
| 8464 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8465 | hs_timeout=10000-60000 \ |
| 8466 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8467 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8468 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8469 | -s "found fragmented DTLS handshake message" \ |
| 8470 | -c "found fragmented DTLS handshake message" \ |
| 8471 | -C "error" |
| 8472 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8473 | # An autoreduction on the client-side might happen if the server is |
| 8474 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8475 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8476 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8477 | requires_config_enabled MBEDTLS_RSA_C |
| 8478 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8479 | requires_config_enabled MBEDTLS_SHA256_C |
| 8480 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8481 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8482 | requires_config_enabled MBEDTLS_AES_C |
| 8483 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8484 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8485 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8486 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8487 | crt_file=data_files/server7_int-ca.crt \ |
| 8488 | key_file=data_files/server7.key \ |
| 8489 | exchanges=2 renegotiation=1 \ |
| 8490 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8491 | hs_timeout=10000-60000 \ |
| 8492 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8493 | "$P_CLI dtls=1 debug_level=2 \ |
| 8494 | crt_file=data_files/server8_int-ca2.crt \ |
| 8495 | key_file=data_files/server8.key \ |
| 8496 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8497 | hs_timeout=10000-60000 \ |
| 8498 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8499 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8500 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8501 | -s "found fragmented DTLS handshake message" \ |
| 8502 | -c "found fragmented DTLS handshake message" \ |
| 8503 | -C "error" |
| 8504 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8505 | # 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] | 8506 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8507 | requires_config_enabled MBEDTLS_RSA_C |
| 8508 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8509 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8510 | requires_config_enabled MBEDTLS_AES_C |
| 8511 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8512 | client_needs_more_time 2 |
| 8513 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8514 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8515 | "$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] | 8516 | crt_file=data_files/server7_int-ca.crt \ |
| 8517 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8518 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8519 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8520 | crt_file=data_files/server8_int-ca2.crt \ |
| 8521 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8522 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8523 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8524 | 0 \ |
| 8525 | -s "found fragmented DTLS handshake message" \ |
| 8526 | -c "found fragmented DTLS handshake message" \ |
| 8527 | -C "error" |
| 8528 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8529 | # 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] | 8530 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8531 | requires_config_enabled MBEDTLS_RSA_C |
| 8532 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8533 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8534 | requires_config_enabled MBEDTLS_AES_C |
| 8535 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8536 | client_needs_more_time 2 |
| 8537 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8538 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8539 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8540 | crt_file=data_files/server7_int-ca.crt \ |
| 8541 | key_file=data_files/server7.key \ |
| 8542 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8543 | "$P_CLI dtls=1 debug_level=2 \ |
| 8544 | crt_file=data_files/server8_int-ca2.crt \ |
| 8545 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8546 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8547 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8548 | 0 \ |
| 8549 | -s "found fragmented DTLS handshake message" \ |
| 8550 | -c "found fragmented DTLS handshake message" \ |
| 8551 | -C "error" |
| 8552 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8553 | # interop tests for DTLS fragmentating with reliable connection |
| 8554 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8555 | # here and below we just want to test that the we fragment in a way that |
| 8556 | # pleases other implementations, so we don't need the peer to fragment |
| 8557 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8558 | requires_config_enabled MBEDTLS_RSA_C |
| 8559 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8561 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8562 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8563 | "$G_SRV -u" \ |
| 8564 | "$P_CLI dtls=1 debug_level=2 \ |
| 8565 | crt_file=data_files/server8_int-ca2.crt \ |
| 8566 | key_file=data_files/server8.key \ |
| 8567 | mtu=512 force_version=dtls1_2" \ |
| 8568 | 0 \ |
| 8569 | -c "fragmenting handshake message" \ |
| 8570 | -C "error" |
| 8571 | |
| 8572 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8573 | requires_config_enabled MBEDTLS_RSA_C |
| 8574 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8575 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8576 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8577 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8578 | "$G_SRV -u" \ |
| 8579 | "$P_CLI dtls=1 debug_level=2 \ |
| 8580 | crt_file=data_files/server8_int-ca2.crt \ |
| 8581 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8582 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8583 | 0 \ |
| 8584 | -c "fragmenting handshake message" \ |
| 8585 | -C "error" |
| 8586 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8587 | # We use --insecure for the GnuTLS client because it expects |
| 8588 | # the hostname / IP it connects to to be the name used in the |
| 8589 | # certificate obtained from the server. Here, however, it |
| 8590 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8591 | # as the server name in the certificate. This will make the |
| 8592 | # certifiate validation fail, but passing --insecure makes |
| 8593 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8594 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8595 | requires_config_enabled MBEDTLS_RSA_C |
| 8596 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8598 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8599 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8600 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8601 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8602 | crt_file=data_files/server7_int-ca.crt \ |
| 8603 | key_file=data_files/server7.key \ |
| 8604 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8605 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8606 | 0 \ |
| 8607 | -s "fragmenting handshake message" |
| 8608 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8609 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8610 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8611 | requires_config_enabled MBEDTLS_RSA_C |
| 8612 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8613 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8614 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8615 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8616 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8617 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8618 | crt_file=data_files/server7_int-ca.crt \ |
| 8619 | key_file=data_files/server7.key \ |
| 8620 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8621 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8622 | 0 \ |
| 8623 | -s "fragmenting handshake message" |
| 8624 | |
| 8625 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8626 | requires_config_enabled MBEDTLS_RSA_C |
| 8627 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8629 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8630 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8631 | "$P_CLI dtls=1 debug_level=2 \ |
| 8632 | crt_file=data_files/server8_int-ca2.crt \ |
| 8633 | key_file=data_files/server8.key \ |
| 8634 | mtu=512 force_version=dtls1_2" \ |
| 8635 | 0 \ |
| 8636 | -c "fragmenting handshake message" \ |
| 8637 | -C "error" |
| 8638 | |
| 8639 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8640 | requires_config_enabled MBEDTLS_RSA_C |
| 8641 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8643 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8644 | "$O_SRV -dtls1 -verify 10" \ |
| 8645 | "$P_CLI dtls=1 debug_level=2 \ |
| 8646 | crt_file=data_files/server8_int-ca2.crt \ |
| 8647 | key_file=data_files/server8.key \ |
| 8648 | mtu=512 force_version=dtls1" \ |
| 8649 | 0 \ |
| 8650 | -c "fragmenting handshake message" \ |
| 8651 | -C "error" |
| 8652 | |
| 8653 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8654 | requires_config_enabled MBEDTLS_RSA_C |
| 8655 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8656 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8657 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8658 | "$P_SRV dtls=1 debug_level=2 \ |
| 8659 | crt_file=data_files/server7_int-ca.crt \ |
| 8660 | key_file=data_files/server7.key \ |
| 8661 | mtu=512 force_version=dtls1_2" \ |
| 8662 | "$O_CLI -dtls1_2" \ |
| 8663 | 0 \ |
| 8664 | -s "fragmenting handshake message" |
| 8665 | |
| 8666 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8667 | requires_config_enabled MBEDTLS_RSA_C |
| 8668 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8670 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8671 | "$P_SRV dtls=1 debug_level=2 \ |
| 8672 | crt_file=data_files/server7_int-ca.crt \ |
| 8673 | key_file=data_files/server7.key \ |
| 8674 | mtu=512 force_version=dtls1" \ |
| 8675 | "$O_CLI -dtls1" \ |
| 8676 | 0 \ |
| 8677 | -s "fragmenting handshake message" |
| 8678 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8679 | # interop tests for DTLS fragmentating with unreliable connection |
| 8680 | # |
| 8681 | # again we just want to test that the we fragment in a way that |
| 8682 | # pleases other implementations, so we don't need the peer to fragment |
| 8683 | requires_gnutls_next |
| 8684 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8685 | requires_config_enabled MBEDTLS_RSA_C |
| 8686 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8688 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8689 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8690 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8691 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8692 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8693 | crt_file=data_files/server8_int-ca2.crt \ |
| 8694 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8695 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8696 | 0 \ |
| 8697 | -c "fragmenting handshake message" \ |
| 8698 | -C "error" |
| 8699 | |
| 8700 | requires_gnutls_next |
| 8701 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8702 | requires_config_enabled MBEDTLS_RSA_C |
| 8703 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8705 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8706 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8707 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8708 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8709 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8710 | crt_file=data_files/server8_int-ca2.crt \ |
| 8711 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8712 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8713 | 0 \ |
| 8714 | -c "fragmenting handshake message" \ |
| 8715 | -C "error" |
| 8716 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8717 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8718 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8719 | requires_config_enabled MBEDTLS_RSA_C |
| 8720 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8722 | client_needs_more_time 4 |
| 8723 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8724 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8725 | "$P_SRV dtls=1 debug_level=2 \ |
| 8726 | crt_file=data_files/server7_int-ca.crt \ |
| 8727 | key_file=data_files/server7.key \ |
| 8728 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8729 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8730 | 0 \ |
| 8731 | -s "fragmenting handshake message" |
| 8732 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8733 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8734 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8735 | requires_config_enabled MBEDTLS_RSA_C |
| 8736 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8738 | client_needs_more_time 4 |
| 8739 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8740 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8741 | "$P_SRV dtls=1 debug_level=2 \ |
| 8742 | crt_file=data_files/server7_int-ca.crt \ |
| 8743 | key_file=data_files/server7.key \ |
| 8744 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8745 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8746 | 0 \ |
| 8747 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8748 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8749 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8750 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8751 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8752 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8753 | ## (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] | 8754 | skip_next_test |
| 8755 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8756 | requires_config_enabled MBEDTLS_RSA_C |
| 8757 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8759 | client_needs_more_time 4 |
| 8760 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8761 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8762 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8763 | "$P_CLI dtls=1 debug_level=2 \ |
| 8764 | crt_file=data_files/server8_int-ca2.crt \ |
| 8765 | key_file=data_files/server8.key \ |
| 8766 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8767 | 0 \ |
| 8768 | -c "fragmenting handshake message" \ |
| 8769 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8770 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8771 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8772 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8773 | requires_config_enabled MBEDTLS_RSA_C |
| 8774 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8776 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8777 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8778 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8779 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8780 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8781 | crt_file=data_files/server8_int-ca2.crt \ |
| 8782 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8783 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8784 | 0 \ |
| 8785 | -c "fragmenting handshake message" \ |
| 8786 | -C "error" |
| 8787 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8788 | skip_next_test |
| 8789 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8790 | requires_config_enabled MBEDTLS_RSA_C |
| 8791 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8793 | client_needs_more_time 4 |
| 8794 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8795 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8796 | "$P_SRV dtls=1 debug_level=2 \ |
| 8797 | crt_file=data_files/server7_int-ca.crt \ |
| 8798 | key_file=data_files/server7.key \ |
| 8799 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8800 | "$O_CLI -dtls1_2" \ |
| 8801 | 0 \ |
| 8802 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8803 | |
| 8804 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8805 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8806 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8807 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8808 | requires_config_enabled MBEDTLS_RSA_C |
| 8809 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8811 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8812 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8813 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8814 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8815 | crt_file=data_files/server7_int-ca.crt \ |
| 8816 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8817 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8818 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8819 | 0 \ |
| 8820 | -s "fragmenting handshake message" |
| 8821 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8822 | # Tests for DTLS-SRTP (RFC 5764) |
| 8823 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8824 | run_test "DTLS-SRTP all profiles supported" \ |
| 8825 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8826 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8827 | 0 \ |
| 8828 | -s "found use_srtp extension" \ |
| 8829 | -s "found srtp profile" \ |
| 8830 | -s "selected srtp profile" \ |
| 8831 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8832 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8833 | -c "client hello, adding use_srtp extension" \ |
| 8834 | -c "found use_srtp extension" \ |
| 8835 | -c "found srtp profile" \ |
| 8836 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8837 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8838 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8839 | -C "error" |
| 8840 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8841 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8842 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8843 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 8844 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8845 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=5 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8846 | 0 \ |
| 8847 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8848 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 8849 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8850 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8851 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8852 | -c "client hello, adding use_srtp extension" \ |
| 8853 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8854 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8855 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8856 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8857 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8858 | -C "error" |
| 8859 | |
| 8860 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8861 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8862 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8863 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8864 | 0 \ |
| 8865 | -s "found use_srtp extension" \ |
| 8866 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8867 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8868 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8869 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8870 | -c "client hello, adding use_srtp extension" \ |
| 8871 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8872 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8873 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8874 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8875 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8876 | -C "error" |
| 8877 | |
| 8878 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8879 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8880 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8881 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8882 | 0 \ |
| 8883 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8884 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8885 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8886 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8887 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8888 | -c "client hello, adding use_srtp extension" \ |
| 8889 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8890 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8891 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8892 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8893 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8894 | -C "error" |
| 8895 | |
| 8896 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8897 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8898 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8899 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8900 | 0 \ |
| 8901 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8902 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8903 | -S "selected srtp profile" \ |
| 8904 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8905 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8906 | -c "client hello, adding use_srtp extension" \ |
| 8907 | -C "found use_srtp extension" \ |
| 8908 | -C "found srtp profile" \ |
| 8909 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8910 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8911 | -C "error" |
| 8912 | |
| 8913 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8914 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8915 | "$P_SRV dtls=1 debug_level=3" \ |
| 8916 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8917 | 0 \ |
| 8918 | -s "found use_srtp extension" \ |
| 8919 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8920 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8921 | -c "client hello, adding use_srtp extension" \ |
| 8922 | -C "found use_srtp extension" \ |
| 8923 | -C "found srtp profile" \ |
| 8924 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8925 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8926 | -C "error" |
| 8927 | |
| 8928 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8929 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8930 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8931 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8932 | 0 \ |
| 8933 | -s "found use_srtp extension" \ |
| 8934 | -s "found srtp profile" \ |
| 8935 | -s "selected srtp profile" \ |
| 8936 | -s "server hello, adding use_srtp extension" \ |
| 8937 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8938 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8939 | -c "client hello, adding use_srtp extension" \ |
| 8940 | -c "found use_srtp extension" \ |
| 8941 | -c "found srtp profile" \ |
| 8942 | -c "selected srtp profile" \ |
| 8943 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8944 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8945 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8946 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8947 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8948 | -C "error" |
| 8949 | |
| 8950 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8951 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8952 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8953 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8954 | 0 \ |
| 8955 | -s "found use_srtp extension" \ |
| 8956 | -s "found srtp profile" \ |
| 8957 | -s "selected srtp profile" \ |
| 8958 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8959 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8960 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8961 | -S "dumping 'using mki' (8 bytes)" \ |
| 8962 | -c "client hello, adding use_srtp extension" \ |
| 8963 | -c "found use_srtp extension" \ |
| 8964 | -c "found srtp profile" \ |
| 8965 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8966 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8967 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8968 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8969 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8970 | -C "dumping 'received mki' (8 bytes)" \ |
| 8971 | -C "error" |
| 8972 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8973 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8974 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8975 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8976 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8977 | 0 \ |
| 8978 | -s "found use_srtp extension" \ |
| 8979 | -s "found srtp profile" \ |
| 8980 | -s "selected srtp profile" \ |
| 8981 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8982 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8983 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8984 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8985 | |
| 8986 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8987 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8988 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8989 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8990 | 0 \ |
| 8991 | -s "found use_srtp extension" \ |
| 8992 | -s "found srtp profile" \ |
| 8993 | -s "selected srtp profile" \ |
| 8994 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8995 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8996 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8997 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8998 | |
| 8999 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9000 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 9001 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9002 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9003 | 0 \ |
| 9004 | -s "found use_srtp extension" \ |
| 9005 | -s "found srtp profile" \ |
| 9006 | -s "selected srtp profile" \ |
| 9007 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9008 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9009 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9010 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9011 | |
| 9012 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9013 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 9014 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9015 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9016 | 0 \ |
| 9017 | -s "found use_srtp extension" \ |
| 9018 | -s "found srtp profile" \ |
| 9019 | -s "selected srtp profile" \ |
| 9020 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9021 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9022 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9023 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9024 | |
| 9025 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9026 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 9027 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9028 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9029 | 0 \ |
| 9030 | -s "found use_srtp extension" \ |
| 9031 | -s "found srtp profile" \ |
| 9032 | -s "selected srtp profile" \ |
| 9033 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9034 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9035 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9036 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9037 | |
| 9038 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9039 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 9040 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9041 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9042 | 0 \ |
| 9043 | -s "found use_srtp extension" \ |
| 9044 | -s "found srtp profile" \ |
| 9045 | -S "selected srtp profile" \ |
| 9046 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9047 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9048 | -C "SRTP Extension negotiated, profile" |
| 9049 | |
| 9050 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9051 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 9052 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9053 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9054 | 0 \ |
| 9055 | -s "found use_srtp extension" \ |
| 9056 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9057 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9058 | -C "SRTP Extension negotiated, profile" |
| 9059 | |
| 9060 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9061 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9062 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9063 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9064 | 0 \ |
| 9065 | -c "client hello, adding use_srtp extension" \ |
| 9066 | -c "found use_srtp extension" \ |
| 9067 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9068 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9069 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9070 | -C "error" |
| 9071 | |
| 9072 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9073 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9074 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9075 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9076 | 0 \ |
| 9077 | -c "client hello, adding use_srtp extension" \ |
| 9078 | -c "found use_srtp extension" \ |
| 9079 | -c "found srtp profile" \ |
| 9080 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9081 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9082 | -C "error" |
| 9083 | |
| 9084 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9085 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9086 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9087 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9088 | 0 \ |
| 9089 | -c "client hello, adding use_srtp extension" \ |
| 9090 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9091 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9092 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9093 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9094 | -C "error" |
| 9095 | |
| 9096 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9097 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9098 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9099 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9100 | 0 \ |
| 9101 | -c "client hello, adding use_srtp extension" \ |
| 9102 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9103 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9104 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9105 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9106 | -C "error" |
| 9107 | |
| 9108 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9109 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9110 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9111 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9112 | 0 \ |
| 9113 | -c "client hello, adding use_srtp extension" \ |
| 9114 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9115 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9116 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9117 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9118 | -C "error" |
| 9119 | |
| 9120 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9121 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9122 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9123 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9124 | 0 \ |
| 9125 | -c "client hello, adding use_srtp extension" \ |
| 9126 | -C "found use_srtp extension" \ |
| 9127 | -C "found srtp profile" \ |
| 9128 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9129 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9130 | -C "error" |
| 9131 | |
| 9132 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9133 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9134 | "$O_SRV -dtls1" \ |
| 9135 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9136 | 0 \ |
| 9137 | -c "client hello, adding use_srtp extension" \ |
| 9138 | -C "found use_srtp extension" \ |
| 9139 | -C "found srtp profile" \ |
| 9140 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9141 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9142 | -C "error" |
| 9143 | |
| 9144 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9145 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9146 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9147 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9148 | 0 \ |
| 9149 | -c "client hello, adding use_srtp extension" \ |
| 9150 | -c "found use_srtp extension" \ |
| 9151 | -c "found srtp profile" \ |
| 9152 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9153 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9154 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9155 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9156 | -C "dumping 'received mki' (8 bytes)" \ |
| 9157 | -C "error" |
| 9158 | |
| 9159 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9160 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9161 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9162 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9163 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9164 | 0 \ |
| 9165 | -s "found use_srtp extension" \ |
| 9166 | -s "found srtp profile" \ |
| 9167 | -s "selected srtp profile" \ |
| 9168 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9169 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9170 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9171 | |
| 9172 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9173 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9174 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9175 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9176 | "$G_CLI -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9177 | 0 \ |
| 9178 | -s "found use_srtp extension" \ |
| 9179 | -s "found srtp profile" \ |
| 9180 | -s "selected srtp profile" \ |
| 9181 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9182 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9183 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9184 | |
| 9185 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9186 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9187 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9188 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9189 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9190 | 0 \ |
| 9191 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9192 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9193 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9194 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9195 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9196 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9197 | |
| 9198 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9199 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9200 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls client." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9201 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9202 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9203 | 0 \ |
| 9204 | -s "found use_srtp extension" \ |
| 9205 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9206 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9207 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9208 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9209 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9210 | |
| 9211 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9212 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9213 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9214 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9215 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9216 | 0 \ |
| 9217 | -s "found use_srtp extension" \ |
| 9218 | -s "found srtp profile" \ |
| 9219 | -s "selected srtp profile" \ |
| 9220 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9221 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9222 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9223 | |
| 9224 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9225 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9226 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9227 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9228 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9229 | 0 \ |
| 9230 | -s "found use_srtp extension" \ |
| 9231 | -s "found srtp profile" \ |
| 9232 | -S "selected srtp profile" \ |
| 9233 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9234 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9235 | -C "SRTP profile:" |
| 9236 | |
| 9237 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9238 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9239 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls client" \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9240 | "$P_SRV dtls=1 debug_level=3" \ |
| 9241 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9242 | 0 \ |
| 9243 | -s "found use_srtp extension" \ |
| 9244 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9245 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9246 | -C "SRTP profile:" |
| 9247 | |
| 9248 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9249 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9250 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9251 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 9252 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9253 | 0 \ |
| 9254 | -c "client hello, adding use_srtp extension" \ |
| 9255 | -c "found use_srtp extension" \ |
| 9256 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9257 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9258 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9259 | -C "error" |
| 9260 | |
| 9261 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9262 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9263 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9264 | "$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 9265 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9266 | 0 \ |
| 9267 | -c "client hello, adding use_srtp extension" \ |
| 9268 | -c "found use_srtp extension" \ |
| 9269 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9270 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9271 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9272 | -C "error" |
| 9273 | |
| 9274 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9275 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9276 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9277 | "$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 9278 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9279 | 0 \ |
| 9280 | -c "client hello, adding use_srtp extension" \ |
| 9281 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9282 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9283 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9284 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9285 | -C "error" |
| 9286 | |
| 9287 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9288 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9289 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9290 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9291 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9292 | 0 \ |
| 9293 | -c "client hello, adding use_srtp extension" \ |
| 9294 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9295 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9296 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9297 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9298 | -C "error" |
| 9299 | |
| 9300 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9301 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9302 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9303 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9304 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9305 | 0 \ |
| 9306 | -c "client hello, adding use_srtp extension" \ |
| 9307 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9308 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9309 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9310 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9311 | -C "error" |
| 9312 | |
| 9313 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9314 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9315 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9316 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9317 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9318 | 0 \ |
| 9319 | -c "client hello, adding use_srtp extension" \ |
| 9320 | -C "found use_srtp extension" \ |
| 9321 | -C "found srtp profile" \ |
| 9322 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9323 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9324 | -C "error" |
| 9325 | |
| 9326 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9327 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9328 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9329 | "$G_SRV -u" \ |
| 9330 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9331 | 0 \ |
| 9332 | -c "client hello, adding use_srtp extension" \ |
| 9333 | -C "found use_srtp extension" \ |
| 9334 | -C "found srtp profile" \ |
| 9335 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9336 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9337 | -C "error" |
| 9338 | |
| 9339 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9340 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9341 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9342 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 9343 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9344 | 0 \ |
| 9345 | -c "client hello, adding use_srtp extension" \ |
| 9346 | -c "found use_srtp extension" \ |
| 9347 | -c "found srtp profile" \ |
| 9348 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9349 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9350 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9351 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9352 | -c "dumping 'received mki' (8 bytes)" \ |
| 9353 | -C "error" |
| 9354 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9355 | # Tests for specific things with "unreliable" UDP connection |
| 9356 | |
| 9357 | not_with_valgrind # spurious resend due to timeout |
| 9358 | run_test "DTLS proxy: reference" \ |
| 9359 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9360 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9361 | "$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] | 9362 | 0 \ |
| 9363 | -C "replayed record" \ |
| 9364 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9365 | -C "Buffer record from epoch" \ |
| 9366 | -S "Buffer record from epoch" \ |
| 9367 | -C "ssl_buffer_message" \ |
| 9368 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9369 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9370 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9371 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9372 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9373 | -c "HTTP/1.0 200 OK" |
| 9374 | |
| 9375 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9376 | run_test "DTLS proxy: duplicate every packet" \ |
| 9377 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9378 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9379 | "$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] | 9380 | 0 \ |
| 9381 | -c "replayed record" \ |
| 9382 | -s "replayed record" \ |
| 9383 | -c "record from another epoch" \ |
| 9384 | -s "record from another epoch" \ |
| 9385 | -S "resend" \ |
| 9386 | -s "Extra-header:" \ |
| 9387 | -c "HTTP/1.0 200 OK" |
| 9388 | |
| 9389 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9390 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9391 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9392 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9393 | 0 \ |
| 9394 | -c "replayed record" \ |
| 9395 | -S "replayed record" \ |
| 9396 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9397 | -s "record from another epoch" \ |
| 9398 | -c "resend" \ |
| 9399 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9400 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9401 | -c "HTTP/1.0 200 OK" |
| 9402 | |
| 9403 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9404 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9405 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9406 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9407 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9408 | -c "next record in same datagram" \ |
| 9409 | -s "next record in same datagram" |
| 9410 | |
| 9411 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9412 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9413 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9414 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9415 | 0 \ |
| 9416 | -c "next record in same datagram" \ |
| 9417 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9418 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9419 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9420 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9421 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9422 | "$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] | 9423 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9424 | -c "discarding invalid record (mac)" \ |
| 9425 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9426 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9427 | -c "HTTP/1.0 200 OK" \ |
| 9428 | -S "too many records with bad MAC" \ |
| 9429 | -S "Verification of the message MAC failed" |
| 9430 | |
| 9431 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9432 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9433 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9434 | "$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] | 9435 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9436 | -C "discarding invalid record (mac)" \ |
| 9437 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9438 | -S "Extra-header:" \ |
| 9439 | -C "HTTP/1.0 200 OK" \ |
| 9440 | -s "too many records with bad MAC" \ |
| 9441 | -s "Verification of the message MAC failed" |
| 9442 | |
| 9443 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9444 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9445 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9446 | "$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] | 9447 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9448 | -c "discarding invalid record (mac)" \ |
| 9449 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9450 | -s "Extra-header:" \ |
| 9451 | -c "HTTP/1.0 200 OK" \ |
| 9452 | -S "too many records with bad MAC" \ |
| 9453 | -S "Verification of the message MAC failed" |
| 9454 | |
| 9455 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9456 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9457 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9458 | "$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] | 9459 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9460 | -c "discarding invalid record (mac)" \ |
| 9461 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9462 | -s "Extra-header:" \ |
| 9463 | -c "HTTP/1.0 200 OK" \ |
| 9464 | -s "too many records with bad MAC" \ |
| 9465 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9466 | |
| 9467 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9468 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9469 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9470 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9471 | 0 \ |
| 9472 | -c "record from another epoch" \ |
| 9473 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9474 | -s "Extra-header:" \ |
| 9475 | -c "HTTP/1.0 200 OK" |
| 9476 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9477 | # Tests for reordering support with DTLS |
| 9478 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9479 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9480 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9481 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9482 | hs_timeout=2500-60000" \ |
| 9483 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9484 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9485 | 0 \ |
| 9486 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9487 | -c "Next handshake message has been buffered - load"\ |
| 9488 | -S "Buffering HS message" \ |
| 9489 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9490 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9491 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9492 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9493 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9494 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9495 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9496 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9497 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9498 | hs_timeout=2500-60000" \ |
| 9499 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9500 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9501 | 0 \ |
| 9502 | -c "Buffering HS message" \ |
| 9503 | -c "found fragmented DTLS handshake message"\ |
| 9504 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9505 | -c "Next handshake message has been buffered - load"\ |
| 9506 | -S "Buffering HS message" \ |
| 9507 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9508 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9509 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9510 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9511 | -S "Remember CCS message" |
| 9512 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9513 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9514 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9515 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9516 | # while keeping the ServerKeyExchange. |
| 9517 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 9518 | 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] | 9519 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9520 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9521 | hs_timeout=2500-60000" \ |
| 9522 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9523 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9524 | 0 \ |
| 9525 | -c "Buffering HS message" \ |
| 9526 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9527 | -C "attempt to make space by freeing buffered messages" \ |
| 9528 | -S "Buffering HS message" \ |
| 9529 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9530 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9531 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9532 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9533 | -S "Remember CCS message" |
| 9534 | |
| 9535 | # The size constraints ensure that the delayed certificate message can't |
| 9536 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9537 | # when dropping it first. |
| 9538 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9539 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 9540 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9541 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9542 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9543 | hs_timeout=2500-60000" \ |
| 9544 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9545 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9546 | 0 \ |
| 9547 | -c "Buffering HS message" \ |
| 9548 | -c "attempt to make space by freeing buffered future messages" \ |
| 9549 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9550 | -S "Buffering HS message" \ |
| 9551 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9552 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9553 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9554 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9555 | -S "Remember CCS message" |
| 9556 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9557 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9558 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9559 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9560 | hs_timeout=2500-60000" \ |
| 9561 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9562 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9563 | 0 \ |
| 9564 | -C "Buffering HS message" \ |
| 9565 | -C "Next handshake message has been buffered - load"\ |
| 9566 | -s "Buffering HS message" \ |
| 9567 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9568 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9569 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9570 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9571 | -S "Remember CCS message" |
| 9572 | |
| 9573 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9574 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9575 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9576 | hs_timeout=2500-60000" \ |
| 9577 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9578 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9579 | 0 \ |
| 9580 | -C "Buffering HS message" \ |
| 9581 | -C "Next handshake message has been buffered - load"\ |
| 9582 | -S "Buffering HS message" \ |
| 9583 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9584 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9585 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9586 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9587 | -S "Remember CCS message" |
| 9588 | |
| 9589 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9590 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9591 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9592 | hs_timeout=2500-60000" \ |
| 9593 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9594 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9595 | 0 \ |
| 9596 | -C "Buffering HS message" \ |
| 9597 | -C "Next handshake message has been buffered - load"\ |
| 9598 | -S "Buffering HS message" \ |
| 9599 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9600 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9601 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9602 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9603 | -s "Remember CCS message" |
| 9604 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9605 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9606 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9607 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9608 | hs_timeout=2500-60000" \ |
| 9609 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9610 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9611 | 0 \ |
| 9612 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9613 | -s "Found buffered record from current epoch - load" \ |
| 9614 | -c "Buffer record from epoch 1" \ |
| 9615 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9616 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9617 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9618 | # from the server are delayed, so that the encrypted Finished message |
| 9619 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9620 | # in afterwards, the encrypted Finished message must be freed in order |
| 9621 | # to make space for the NewSessionTicket to be reassembled. |
| 9622 | # This works only in very particular circumstances: |
| 9623 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9624 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9625 | # the encrypted Finished message. |
| 9626 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9627 | # needs to be fragmented. |
| 9628 | # - All messages sent by the server must be small enough to be either sent |
| 9629 | # without fragmentation or be reassembled within the bounds of |
| 9630 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9631 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9632 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9633 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9634 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9635 | -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] | 9636 | "$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] | 9637 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9638 | 0 \ |
| 9639 | -s "Buffer record from epoch 1" \ |
| 9640 | -s "Found buffered record from current epoch - load" \ |
| 9641 | -c "Buffer record from epoch 1" \ |
| 9642 | -C "Found buffered record from current epoch - load" \ |
| 9643 | -c "Enough space available after freeing future epoch record" |
| 9644 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9645 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9646 | |
| 9647 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9648 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9649 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9650 | "$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] | 9651 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9652 | "$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] | 9653 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9654 | 0 \ |
| 9655 | -s "Extra-header:" \ |
| 9656 | -c "HTTP/1.0 200 OK" |
| 9657 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9658 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9659 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9660 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9661 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9662 | "$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] | 9663 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9664 | 0 \ |
| 9665 | -s "Extra-header:" \ |
| 9666 | -c "HTTP/1.0 200 OK" |
| 9667 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9668 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9669 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9670 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9671 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9672 | "$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] | 9673 | 0 \ |
| 9674 | -s "Extra-header:" \ |
| 9675 | -c "HTTP/1.0 200 OK" |
| 9676 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9677 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9678 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9679 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9680 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9681 | "$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] | 9682 | 0 \ |
| 9683 | -s "Extra-header:" \ |
| 9684 | -c "HTTP/1.0 200 OK" |
| 9685 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9686 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9687 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9688 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9689 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9690 | "$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] | 9691 | 0 \ |
| 9692 | -s "Extra-header:" \ |
| 9693 | -c "HTTP/1.0 200 OK" |
| 9694 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9695 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9696 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9697 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9698 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9699 | "$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] | 9700 | 0 \ |
| 9701 | -s "Extra-header:" \ |
| 9702 | -c "HTTP/1.0 200 OK" |
| 9703 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9704 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9705 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9706 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9707 | "$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] | 9708 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9709 | "$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] | 9710 | 0 \ |
| 9711 | -s "Extra-header:" \ |
| 9712 | -c "HTTP/1.0 200 OK" |
| 9713 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9714 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9715 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9716 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9717 | "$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] | 9718 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9719 | "$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] | 9720 | 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] | 9721 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9722 | 0 \ |
| 9723 | -s "a session has been resumed" \ |
| 9724 | -c "a session has been resumed" \ |
| 9725 | -s "Extra-header:" \ |
| 9726 | -c "HTTP/1.0 200 OK" |
| 9727 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9728 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9729 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9730 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9731 | "$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] | 9732 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9733 | "$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] | 9734 | 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] | 9735 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9736 | 0 \ |
| 9737 | -s "a session has been resumed" \ |
| 9738 | -c "a session has been resumed" \ |
| 9739 | -s "Extra-header:" \ |
| 9740 | -c "HTTP/1.0 200 OK" |
| 9741 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9742 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9743 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9744 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9745 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9746 | "$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] | 9747 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9748 | "$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] | 9749 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9750 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9751 | 0 \ |
| 9752 | -c "=> renegotiate" \ |
| 9753 | -s "=> renegotiate" \ |
| 9754 | -s "Extra-header:" \ |
| 9755 | -c "HTTP/1.0 200 OK" |
| 9756 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9757 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9758 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9759 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9760 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9761 | "$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] | 9762 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9763 | "$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] | 9764 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9765 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9766 | 0 \ |
| 9767 | -c "=> renegotiate" \ |
| 9768 | -s "=> renegotiate" \ |
| 9769 | -s "Extra-header:" \ |
| 9770 | -c "HTTP/1.0 200 OK" |
| 9771 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9772 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9773 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9774 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9775 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9776 | "$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] | 9777 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9778 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9779 | "$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] | 9780 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9781 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9782 | 0 \ |
| 9783 | -c "=> renegotiate" \ |
| 9784 | -s "=> renegotiate" \ |
| 9785 | -s "Extra-header:" \ |
| 9786 | -c "HTTP/1.0 200 OK" |
| 9787 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9788 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9789 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9790 | 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] | 9791 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9792 | "$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] | 9793 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9794 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9795 | "$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] | 9796 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9797 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9798 | 0 \ |
| 9799 | -c "=> renegotiate" \ |
| 9800 | -s "=> renegotiate" \ |
| 9801 | -s "Extra-header:" \ |
| 9802 | -c "HTTP/1.0 200 OK" |
| 9803 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9804 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9805 | ## all versions installed on the CI machines), reported here: |
| 9806 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9807 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9808 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9809 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9810 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9811 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9812 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9813 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9814 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9815 | "$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] | 9816 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9817 | -c "HTTP/1.0 200 OK" |
| 9818 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9819 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9820 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9821 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9822 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9823 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9824 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9825 | "$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] | 9826 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9827 | -c "HTTP/1.0 200 OK" |
| 9828 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9829 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9830 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9831 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9832 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9833 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9834 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9835 | "$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] | 9836 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9837 | -c "HTTP/1.0 200 OK" |
| 9838 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9839 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9840 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9841 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9842 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9843 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9844 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9845 | "$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] | 9846 | 0 \ |
| 9847 | -s "Extra-header:" \ |
| 9848 | -c "Extra-header:" |
| 9849 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9850 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9851 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9852 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9853 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9854 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9855 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9856 | "$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] | 9857 | 0 \ |
| 9858 | -s "Extra-header:" \ |
| 9859 | -c "Extra-header:" |
| 9860 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9861 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9862 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9863 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9864 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9865 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9866 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9867 | "$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] | 9868 | 0 \ |
| 9869 | -s "Extra-header:" \ |
| 9870 | -c "Extra-header:" |
| 9871 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9872 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 9873 | run_test "export keys functionality" \ |
| 9874 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9875 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9876 | 0 \ |
| 9877 | -s "exported maclen is " \ |
| 9878 | -s "exported keylen is " \ |
| 9879 | -s "exported ivlen is " \ |
| 9880 | -c "exported maclen is " \ |
| 9881 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9882 | -c "exported ivlen is " \ |
| 9883 | -c "EAP-TLS key material is:"\ |
| 9884 | -s "EAP-TLS key material is:"\ |
| 9885 | -c "EAP-TLS IV is:" \ |
| 9886 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9887 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9888 | # Test heap memory usage after handshake |
| 9889 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9890 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9891 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 9892 | run_tests_memory_after_hanshake |
| 9893 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9894 | # Final report |
| 9895 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9896 | echo "------------------------------------------------------------------------" |
| 9897 | |
| 9898 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9899 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9900 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9901 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9902 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9903 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9904 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9905 | |
| 9906 | exit $FAILS |