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 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 637 | # Compare file content |
| 638 | # Usage: find_in_both pattern file1 file2 |
| 639 | # extract from file1 the first line matching the pattern |
| 640 | # check in file2 that the same line can be found |
| 641 | find_in_both() { |
| 642 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 643 | if [ -z "$srv_pattern" ]; then |
| 644 | return 1; |
| 645 | fi |
| 646 | |
| 647 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 648 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 649 | else |
| 650 | return 1; |
| 651 | fi |
| 652 | } |
| 653 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 654 | # 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] | 655 | # Options: -s pattern pattern that must be present in server output |
| 656 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 657 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 658 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 659 | # -S pattern pattern that must be absent in server output |
| 660 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 661 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 662 | # -F call shell function on server output |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 663 | # -g call shell function on server and client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 664 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 665 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 666 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 667 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 668 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 669 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 670 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 671 | # 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] | 672 | return |
| 673 | fi |
| 674 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 675 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 676 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 677 | # Do we only run numbered tests? |
| 678 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 679 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 680 | else |
| 681 | SKIP_NEXT="YES" |
| 682 | fi |
| 683 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 684 | # does this test use a proxy? |
| 685 | if [ "X$1" = "X-p" ]; then |
| 686 | PXY_CMD="$2" |
| 687 | shift 2 |
| 688 | else |
| 689 | PXY_CMD="" |
| 690 | fi |
| 691 | |
| 692 | # get commands and client output |
| 693 | SRV_CMD="$1" |
| 694 | CLI_CMD="$2" |
| 695 | CLI_EXPECT="$3" |
| 696 | shift 3 |
| 697 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 698 | # Check if test uses files |
| 699 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 700 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 701 | requires_config_enabled MBEDTLS_FS_IO |
| 702 | fi |
| 703 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 704 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 705 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 706 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 707 | |
| 708 | # should we skip? |
| 709 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 710 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 711 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 712 | SKIPS=$(( $SKIPS + 1 )) |
| 713 | return |
| 714 | fi |
| 715 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 716 | # update DTLS variable |
| 717 | detect_dtls "$SRV_CMD" |
| 718 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 719 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 720 | # 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] | 721 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 722 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 723 | case " $SRV_CMD " in |
| 724 | *' server_addr=::1 '*) |
| 725 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 726 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 727 | fi |
| 728 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 729 | # fix client port |
| 730 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 731 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 732 | else |
| 733 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 734 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 735 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 736 | # prepend valgrind to our commands if active |
| 737 | if [ "$MEMCHECK" -gt 0 ]; then |
| 738 | if is_polar "$SRV_CMD"; then |
| 739 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 740 | fi |
| 741 | if is_polar "$CLI_CMD"; then |
| 742 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 743 | fi |
| 744 | fi |
| 745 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 746 | TIMES_LEFT=2 |
| 747 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 748 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 749 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 750 | # run the commands |
| 751 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 752 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 753 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 754 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 755 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 756 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 757 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 758 | check_osrv_dtls |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 759 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 760 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 761 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 762 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 763 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 764 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 765 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 766 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 767 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 768 | sleep 0.05 |
| 769 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 770 | # terminate the server (and the proxy) |
| 771 | kill $SRV_PID |
| 772 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 773 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 774 | if [ -n "$PXY_CMD" ]; then |
| 775 | kill $PXY_PID >/dev/null 2>&1 |
| 776 | wait $PXY_PID |
| 777 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 778 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 779 | # retry only on timeouts |
| 780 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 781 | printf "RETRY " |
| 782 | else |
| 783 | TIMES_LEFT=0 |
| 784 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 785 | done |
| 786 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 787 | # 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] | 788 | # (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] | 789 | # expected client exit to incorrectly succeed in case of catastrophic |
| 790 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 791 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 792 | 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] | 793 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 794 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 795 | return |
| 796 | fi |
| 797 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 798 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 799 | 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] | 800 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 801 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 802 | return |
| 803 | fi |
| 804 | fi |
| 805 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 806 | # check server exit code |
| 807 | if [ $? != 0 ]; then |
| 808 | fail "server fail" |
| 809 | return |
| 810 | fi |
| 811 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 812 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 813 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 814 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 815 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 816 | 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] | 817 | return |
| 818 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 819 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 820 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 821 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 822 | # 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] | 823 | while [ $# -gt 0 ] |
| 824 | do |
| 825 | case $1 in |
| 826 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 827 | 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] | 828 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 829 | return |
| 830 | fi |
| 831 | ;; |
| 832 | |
| 833 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 834 | 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] | 835 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 836 | return |
| 837 | fi |
| 838 | ;; |
| 839 | |
| 840 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 841 | 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] | 842 | 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] | 843 | return |
| 844 | fi |
| 845 | ;; |
| 846 | |
| 847 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 848 | 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] | 849 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 850 | return |
| 851 | fi |
| 852 | ;; |
| 853 | |
| 854 | # The filtering in the following two options (-u and -U) do the following |
| 855 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 856 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 857 | # - keep one of each non-unique line |
| 858 | # - count how many lines remain |
| 859 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 860 | # if there were no duplicates. |
| 861 | "-U") |
| 862 | 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 |
| 863 | fail "lines following pattern '$2' must be unique in Server output" |
| 864 | return |
| 865 | fi |
| 866 | ;; |
| 867 | |
| 868 | "-u") |
| 869 | 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 |
| 870 | 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] | 871 | return |
| 872 | fi |
| 873 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 874 | "-F") |
| 875 | if ! $2 "$SRV_OUT"; then |
| 876 | fail "function call to '$2' failed on Server output" |
| 877 | return |
| 878 | fi |
| 879 | ;; |
| 880 | "-f") |
| 881 | if ! $2 "$CLI_OUT"; then |
| 882 | fail "function call to '$2' failed on Client output" |
| 883 | return |
| 884 | fi |
| 885 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 886 | "-g") |
| 887 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 888 | fail "function call to '$2' failed on Server and Client output" |
| 889 | return |
| 890 | fi |
| 891 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 892 | |
| 893 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 894 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 895 | exit 1 |
| 896 | esac |
| 897 | shift 2 |
| 898 | done |
| 899 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 900 | # check valgrind's results |
| 901 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 902 | 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] | 903 | fail "Server has memory errors" |
| 904 | return |
| 905 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 906 | 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] | 907 | fail "Client has memory errors" |
| 908 | return |
| 909 | fi |
| 910 | fi |
| 911 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 912 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 913 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 914 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 915 | mv $SRV_OUT o-srv-${TESTS}.log |
| 916 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 917 | if [ -n "$PXY_CMD" ]; then |
| 918 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 919 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 920 | fi |
| 921 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 922 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 923 | } |
| 924 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 925 | run_test_psa() { |
| 926 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 927 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 928 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 929 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 930 | 0 \ |
| 931 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 932 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 933 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 934 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 935 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 936 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 937 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 938 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 939 | -C "Failed to setup PSA-based cipher context"\ |
| 940 | -S "Failed to setup PSA-based cipher context"\ |
| 941 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 942 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 943 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 944 | -S "error" \ |
| 945 | -C "error" |
| 946 | } |
| 947 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 948 | run_test_psa_force_curve() { |
| 949 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 950 | run_test "PSA - ECDH with $1" \ |
| 951 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 952 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 953 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 954 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 955 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 956 | -c "PSA calc verify" \ |
| 957 | -c "calc PSA finished" \ |
| 958 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 959 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 960 | -s "PSA calc verify" \ |
| 961 | -s "calc PSA finished" \ |
| 962 | -C "Failed to setup PSA-based cipher context"\ |
| 963 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 964 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 965 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 966 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 967 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 968 | -C "error" |
| 969 | } |
| 970 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 971 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 972 | # a maximum fragment length. |
| 973 | # first argument ($1) is MFL for SSL client |
| 974 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 975 | run_test_memory_after_hanshake_with_mfl() |
| 976 | { |
| 977 | # The test passes if the difference is around 2*(16k-MFL) |
| 978 | local MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
| 979 | |
| 980 | # Leave some margin for robustness |
| 981 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 982 | |
| 983 | run_test "Handshake memory usage (MFL $1)" \ |
| 984 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 985 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 986 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 987 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 988 | 0 \ |
| 989 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 990 | } |
| 991 | |
| 992 | |
| 993 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 994 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 995 | run_tests_memory_after_hanshake() |
| 996 | { |
| 997 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 998 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 999 | |
| 1000 | # first test with default MFU is to get reference memory usage |
| 1001 | MEMORY_USAGE_MFL_16K=0 |
| 1002 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1003 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1004 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1005 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1006 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1007 | 0 \ |
| 1008 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1009 | |
| 1010 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1011 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1012 | |
| 1013 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1014 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1015 | |
| 1016 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1017 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1018 | |
| 1019 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1020 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1021 | } |
| 1022 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1023 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1024 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1025 | rm -f context_srv.txt |
| 1026 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1027 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1028 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1029 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1030 | 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] | 1031 | exit 1 |
| 1032 | } |
| 1033 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1034 | # |
| 1035 | # MAIN |
| 1036 | # |
| 1037 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1038 | get_options "$@" |
| 1039 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1040 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1041 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1042 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1043 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1044 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1045 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1046 | exit 1 |
| 1047 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1048 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1049 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1050 | exit 1 |
| 1051 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1052 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1053 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1054 | exit 1 |
| 1055 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1056 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1057 | if which valgrind >/dev/null 2>&1; then :; else |
| 1058 | echo "Memcheck not possible. Valgrind not found" |
| 1059 | exit 1 |
| 1060 | fi |
| 1061 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1062 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1063 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1064 | exit 1 |
| 1065 | fi |
| 1066 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1067 | # used by watchdog |
| 1068 | MAIN_PID="$$" |
| 1069 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1070 | # We use somewhat arbitrary delays for tests: |
| 1071 | # - how long do we wait for the server to start (when lsof not available)? |
| 1072 | # - how long do we allow for the client to finish? |
| 1073 | # (not to check performance, just to avoid waiting indefinitely) |
| 1074 | # Things are slower with valgrind, so give extra time here. |
| 1075 | # |
| 1076 | # Note: without lsof, there is a trade-off between the running time of this |
| 1077 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1078 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1079 | # 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] | 1080 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1081 | START_DELAY=6 |
| 1082 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1083 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1084 | START_DELAY=2 |
| 1085 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1086 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1087 | |
| 1088 | # some particular tests need more time: |
| 1089 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1090 | # - for the server, we sleep for a number of seconds after the client exits |
| 1091 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1092 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1093 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1094 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1095 | # 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] | 1096 | # +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] | 1097 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1098 | 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] | 1099 | 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] | 1100 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1101 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1102 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1103 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1104 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1105 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1106 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1107 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1108 | fi |
| 1109 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1110 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1111 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1112 | fi |
| 1113 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1114 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1115 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1116 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1117 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1118 | # Allow SHA-1, because many of our test certificates use it |
| 1119 | P_SRV="$P_SRV allow_sha1=1" |
| 1120 | P_CLI="$P_CLI allow_sha1=1" |
| 1121 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1122 | # Also pick a unique name for intermediate files |
| 1123 | SRV_OUT="srv_out.$$" |
| 1124 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1125 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1126 | SESSION="session.$$" |
| 1127 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1128 | SKIP_NEXT="NO" |
| 1129 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1130 | trap cleanup INT TERM HUP |
| 1131 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1132 | # Basic test |
| 1133 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1134 | # Checks that: |
| 1135 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1136 | # - the expected (highest security) parameters are selected |
| 1137 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1138 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1139 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1140 | "$P_CLI" \ |
| 1141 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1142 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1143 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1144 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1145 | -s "ECDHE curve: secp521r1" \ |
| 1146 | -S "error" \ |
| 1147 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1148 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1149 | run_test "Default, DTLS" \ |
| 1150 | "$P_SRV dtls=1" \ |
| 1151 | "$P_CLI dtls=1" \ |
| 1152 | 0 \ |
| 1153 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1154 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1155 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1156 | run_test "TLS client auth: required" \ |
| 1157 | "$P_SRV auth_mode=required" \ |
| 1158 | "$P_CLI" \ |
| 1159 | 0 \ |
| 1160 | -s "Verifying peer X.509 certificate... ok" |
| 1161 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1162 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1163 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1164 | requires_config_enabled MBEDTLS_SHA256_C |
| 1165 | run_test "TLS: password protected client key" \ |
| 1166 | "$P_SRV auth_mode=required" \ |
| 1167 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1168 | 0 |
| 1169 | |
| 1170 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1171 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1172 | requires_config_enabled MBEDTLS_SHA256_C |
| 1173 | run_test "TLS: password protected server key" \ |
| 1174 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1175 | "$P_CLI" \ |
| 1176 | 0 |
| 1177 | |
| 1178 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1179 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1180 | requires_config_enabled MBEDTLS_RSA_C |
| 1181 | requires_config_enabled MBEDTLS_SHA256_C |
| 1182 | run_test "TLS: password protected server key, two certificates" \ |
| 1183 | "$P_SRV \ |
| 1184 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1185 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1186 | "$P_CLI" \ |
| 1187 | 0 |
| 1188 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1189 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1190 | run_test "CA callback on client" \ |
| 1191 | "$P_SRV debug_level=3" \ |
| 1192 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1193 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1194 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1195 | -S "error" \ |
| 1196 | -C "error" |
| 1197 | |
| 1198 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1199 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1200 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1201 | requires_config_enabled MBEDTLS_SHA256_C |
| 1202 | run_test "CA callback on server" \ |
| 1203 | "$P_SRV auth_mode=required" \ |
| 1204 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1205 | key_file=data_files/server5.key" \ |
| 1206 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1207 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1208 | -s "Verifying peer X.509 certificate... ok" \ |
| 1209 | -S "error" \ |
| 1210 | -C "error" |
| 1211 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1212 | # Test using an opaque private key for client authentication |
| 1213 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1214 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1215 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1216 | requires_config_enabled MBEDTLS_SHA256_C |
| 1217 | run_test "Opaque key for client authentication" \ |
| 1218 | "$P_SRV auth_mode=required" \ |
| 1219 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1220 | key_file=data_files/server5.key" \ |
| 1221 | 0 \ |
| 1222 | -c "key type: Opaque" \ |
| 1223 | -s "Verifying peer X.509 certificate... ok" \ |
| 1224 | -S "error" \ |
| 1225 | -C "error" |
| 1226 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1227 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1228 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1229 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1230 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1231 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1232 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1233 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1234 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1235 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1236 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1237 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1238 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1239 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1240 | run_test_psa_force_curve "secp521r1" |
| 1241 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1242 | run_test_psa_force_curve "brainpoolP512r1" |
| 1243 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1244 | run_test_psa_force_curve "secp384r1" |
| 1245 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1246 | run_test_psa_force_curve "brainpoolP384r1" |
| 1247 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1248 | run_test_psa_force_curve "secp256r1" |
| 1249 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1250 | run_test_psa_force_curve "secp256k1" |
| 1251 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1252 | run_test_psa_force_curve "brainpoolP256r1" |
| 1253 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1254 | run_test_psa_force_curve "secp224r1" |
| 1255 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1256 | run_test_psa_force_curve "secp224k1" |
| 1257 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1258 | run_test_psa_force_curve "secp192r1" |
| 1259 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1260 | run_test_psa_force_curve "secp192k1" |
| 1261 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1262 | # Test current time in ServerHello |
| 1263 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1264 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1265 | "$P_SRV debug_level=3" \ |
| 1266 | "$P_CLI debug_level=3" \ |
| 1267 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1268 | -f "check_server_hello_time" \ |
| 1269 | -F "check_server_hello_time" |
| 1270 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1271 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1272 | run_test "Unique IV in GCM" \ |
| 1273 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1274 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1275 | 0 \ |
| 1276 | -u "IV used" \ |
| 1277 | -U "IV used" |
| 1278 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1279 | # Tests for certificate verification callback |
| 1280 | run_test "Configuration-specific CRT verification callback" \ |
| 1281 | "$P_SRV debug_level=3" \ |
| 1282 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1283 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1284 | -S "error" \ |
| 1285 | -c "Verify requested for " \ |
| 1286 | -c "Use configuration-specific verification callback" \ |
| 1287 | -C "Use context-specific verification callback" \ |
| 1288 | -C "error" |
| 1289 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1290 | run_test "Context-specific CRT verification callback" \ |
| 1291 | "$P_SRV debug_level=3" \ |
| 1292 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1293 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1294 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1295 | -c "Verify requested for " \ |
| 1296 | -c "Use context-specific verification callback" \ |
| 1297 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1298 | -C "error" |
| 1299 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1300 | # Tests for rc4 option |
| 1301 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1302 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1303 | run_test "RC4: server disabled, client enabled" \ |
| 1304 | "$P_SRV" \ |
| 1305 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1306 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1307 | -s "SSL - The server has no ciphersuites in common" |
| 1308 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1309 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1310 | run_test "RC4: server half, client enabled" \ |
| 1311 | "$P_SRV arc4=1" \ |
| 1312 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1313 | 1 \ |
| 1314 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1315 | |
| 1316 | run_test "RC4: server enabled, client disabled" \ |
| 1317 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1318 | "$P_CLI" \ |
| 1319 | 1 \ |
| 1320 | -s "SSL - The server has no ciphersuites in common" |
| 1321 | |
| 1322 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1323 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1324 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1325 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1326 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1327 | -S "SSL - The server has no ciphersuites in common" |
| 1328 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1329 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1330 | |
| 1331 | requires_gnutls |
| 1332 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1333 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1334 | "$G_SRV"\ |
| 1335 | "$P_CLI force_version=tls1_1" \ |
| 1336 | 0 |
| 1337 | |
| 1338 | requires_gnutls |
| 1339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1340 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1341 | "$G_SRV"\ |
| 1342 | "$P_CLI force_version=tls1" \ |
| 1343 | 0 |
| 1344 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1345 | # Tests for SHA-1 support |
| 1346 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1347 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1348 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1349 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1350 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1351 | 1 \ |
| 1352 | -c "The certificate is signed with an unacceptable hash" |
| 1353 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1354 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1355 | run_test "SHA-1 allowed by default in server certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1356 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1357 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1358 | 0 |
| 1359 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1360 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1361 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1362 | "$P_CLI allow_sha1=1" \ |
| 1363 | 0 |
| 1364 | |
| 1365 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1366 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1367 | "$P_CLI allow_sha1=0" \ |
| 1368 | 0 |
| 1369 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1370 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1371 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1372 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1373 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1374 | 1 \ |
| 1375 | -s "The certificate is signed with an unacceptable hash" |
| 1376 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1377 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1378 | run_test "SHA-1 allowed by default in client certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1379 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1380 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1381 | 0 |
| 1382 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1383 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1384 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1385 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1386 | 0 |
| 1387 | |
| 1388 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1389 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1390 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1391 | 0 |
| 1392 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1393 | # Tests for datagram packing |
| 1394 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1395 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1396 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1397 | 0 \ |
| 1398 | -c "next record in same datagram" \ |
| 1399 | -s "next record in same datagram" |
| 1400 | |
| 1401 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1402 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1403 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1404 | 0 \ |
| 1405 | -s "next record in same datagram" \ |
| 1406 | -C "next record in same datagram" |
| 1407 | |
| 1408 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1409 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1410 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1411 | 0 \ |
| 1412 | -S "next record in same datagram" \ |
| 1413 | -c "next record in same datagram" |
| 1414 | |
| 1415 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1416 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1417 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1418 | 0 \ |
| 1419 | -S "next record in same datagram" \ |
| 1420 | -C "next record in same datagram" |
| 1421 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1422 | # Tests for Truncated HMAC extension |
| 1423 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1424 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1425 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1426 | "$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] | 1427 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1428 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1429 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1430 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1431 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1432 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1433 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1434 | "$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] | 1435 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1436 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1437 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1438 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1439 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1440 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1441 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1442 | "$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] | 1443 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1444 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1445 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1446 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1447 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1448 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1449 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1450 | "$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] | 1451 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1452 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1453 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1454 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1455 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1456 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1457 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1458 | "$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] | 1459 | 0 \ |
| 1460 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1461 | -S "dumping 'expected mac' (10 bytes)" |
| 1462 | |
| 1463 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1464 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1465 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1466 | "$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] | 1467 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1468 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1469 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1470 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1471 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1472 | "$P_SRV dtls=1 debug_level=4" \ |
| 1473 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1474 | 0 \ |
| 1475 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1476 | -S "dumping 'expected mac' (10 bytes)" |
| 1477 | |
| 1478 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1479 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1480 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1481 | "$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] | 1482 | 0 \ |
| 1483 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1484 | -S "dumping 'expected mac' (10 bytes)" |
| 1485 | |
| 1486 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1487 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1488 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1489 | "$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] | 1490 | 0 \ |
| 1491 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1492 | -S "dumping 'expected mac' (10 bytes)" |
| 1493 | |
| 1494 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1495 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1496 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1497 | "$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] | 1498 | 0 \ |
| 1499 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1500 | -S "dumping 'expected mac' (10 bytes)" |
| 1501 | |
| 1502 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1503 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1504 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1505 | "$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] | 1506 | 0 \ |
| 1507 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1508 | -S "dumping 'expected mac' (10 bytes)" |
| 1509 | |
| 1510 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1511 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1512 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1513 | "$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] | 1514 | 0 \ |
| 1515 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1516 | -s "dumping 'expected mac' (10 bytes)" |
| 1517 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1518 | # Tests for Context serialization |
| 1519 | |
| 1520 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1521 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1522 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1523 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1524 | 0 \ |
| 1525 | -c "Deserializing connection..." \ |
| 1526 | -S "Deserializing connection..." |
| 1527 | |
| 1528 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1529 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1530 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1531 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1532 | 0 \ |
| 1533 | -c "Deserializing connection..." \ |
| 1534 | -S "Deserializing connection..." |
| 1535 | |
| 1536 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1537 | run_test "Context serialization, client serializes, GCM" \ |
| 1538 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1539 | "$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] | 1540 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1541 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1542 | -S "Deserializing connection..." |
| 1543 | |
| 1544 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1545 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1546 | run_test "Context serialization, client serializes, with CID" \ |
| 1547 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1548 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1549 | 0 \ |
| 1550 | -c "Deserializing connection..." \ |
| 1551 | -S "Deserializing connection..." |
| 1552 | |
| 1553 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1554 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1555 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1556 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1557 | 0 \ |
| 1558 | -C "Deserializing connection..." \ |
| 1559 | -s "Deserializing connection..." |
| 1560 | |
| 1561 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1562 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1563 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1564 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1565 | 0 \ |
| 1566 | -C "Deserializing connection..." \ |
| 1567 | -s "Deserializing connection..." |
| 1568 | |
| 1569 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1570 | run_test "Context serialization, server serializes, GCM" \ |
| 1571 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1572 | "$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] | 1573 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1574 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1575 | -s "Deserializing connection..." |
| 1576 | |
| 1577 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1578 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1579 | run_test "Context serialization, server serializes, with CID" \ |
| 1580 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1581 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1582 | 0 \ |
| 1583 | -C "Deserializing connection..." \ |
| 1584 | -s "Deserializing connection..." |
| 1585 | |
| 1586 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1587 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1588 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1589 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1590 | 0 \ |
| 1591 | -c "Deserializing connection..." \ |
| 1592 | -s "Deserializing connection..." |
| 1593 | |
| 1594 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1595 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1596 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1597 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1598 | 0 \ |
| 1599 | -c "Deserializing connection..." \ |
| 1600 | -s "Deserializing connection..." |
| 1601 | |
| 1602 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1603 | run_test "Context serialization, both serialize, GCM" \ |
| 1604 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1605 | "$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] | 1606 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1607 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1608 | -s "Deserializing connection..." |
| 1609 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1610 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1611 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1612 | run_test "Context serialization, both serialize, with CID" \ |
| 1613 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1614 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1615 | 0 \ |
| 1616 | -c "Deserializing connection..." \ |
| 1617 | -s "Deserializing connection..." |
| 1618 | |
| 1619 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1620 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1621 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1622 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1623 | 0 \ |
| 1624 | -c "Deserializing connection..." \ |
| 1625 | -S "Deserializing connection..." |
| 1626 | |
| 1627 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1628 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1629 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1630 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1631 | 0 \ |
| 1632 | -c "Deserializing connection..." \ |
| 1633 | -S "Deserializing connection..." |
| 1634 | |
| 1635 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1636 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1637 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1638 | "$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] | 1639 | 0 \ |
| 1640 | -c "Deserializing connection..." \ |
| 1641 | -S "Deserializing connection..." |
| 1642 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1643 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1644 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1645 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1646 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1647 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1648 | 0 \ |
| 1649 | -c "Deserializing connection..." \ |
| 1650 | -S "Deserializing connection..." |
| 1651 | |
| 1652 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1653 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1654 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1655 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1656 | 0 \ |
| 1657 | -C "Deserializing connection..." \ |
| 1658 | -s "Deserializing connection..." |
| 1659 | |
| 1660 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1661 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1662 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1663 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1664 | 0 \ |
| 1665 | -C "Deserializing connection..." \ |
| 1666 | -s "Deserializing connection..." |
| 1667 | |
| 1668 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1669 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1670 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1671 | "$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] | 1672 | 0 \ |
| 1673 | -C "Deserializing connection..." \ |
| 1674 | -s "Deserializing connection..." |
| 1675 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1676 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1677 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1678 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1679 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1680 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1681 | 0 \ |
| 1682 | -C "Deserializing connection..." \ |
| 1683 | -s "Deserializing connection..." |
| 1684 | |
| 1685 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1686 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1687 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1688 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1689 | 0 \ |
| 1690 | -c "Deserializing connection..." \ |
| 1691 | -s "Deserializing connection..." |
| 1692 | |
| 1693 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1694 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1695 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1696 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1697 | 0 \ |
| 1698 | -c "Deserializing connection..." \ |
| 1699 | -s "Deserializing connection..." |
| 1700 | |
| 1701 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1702 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1703 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1704 | "$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] | 1705 | 0 \ |
| 1706 | -c "Deserializing connection..." \ |
| 1707 | -s "Deserializing connection..." |
| 1708 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1709 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1710 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1711 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1712 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1713 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1714 | 0 \ |
| 1715 | -c "Deserializing connection..." \ |
| 1716 | -s "Deserializing connection..." |
| 1717 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1718 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1719 | run_test "Saving the serialized context to a file" \ |
| 1720 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1721 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1722 | 0 \ |
| 1723 | -s "Save serialized context to a file... ok" \ |
| 1724 | -c "Save serialized context to a file... ok" |
| 1725 | rm -f context_srv.txt |
| 1726 | rm -f context_cli.txt |
| 1727 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1728 | # Tests for DTLS Connection ID extension |
| 1729 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1730 | # So far, the CID API isn't implemented, so we can't |
| 1731 | # grep for output witnessing its use. This needs to be |
| 1732 | # changed once the CID extension is implemented. |
| 1733 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1734 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1735 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1736 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1737 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1738 | 0 \ |
| 1739 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1740 | -s "found CID extension" \ |
| 1741 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1742 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1743 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1744 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1745 | -C "found CID extension" \ |
| 1746 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1747 | -C "Copy CIDs into SSL transform" \ |
| 1748 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1749 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1750 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1751 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1752 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1753 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1754 | 0 \ |
| 1755 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1756 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1757 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1758 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1759 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1760 | -C "found CID extension" \ |
| 1761 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1762 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1763 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1764 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1765 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1766 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1767 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1768 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1769 | 0 \ |
| 1770 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1771 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1772 | -c "client hello, adding CID extension" \ |
| 1773 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1774 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1775 | -s "server hello, adding CID extension" \ |
| 1776 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1777 | -c "Use of CID extension negotiated" \ |
| 1778 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1779 | -c "Copy CIDs into SSL transform" \ |
| 1780 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1781 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1782 | -s "Use of Connection ID has been negotiated" \ |
| 1783 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1784 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1785 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1786 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1787 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1788 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1789 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1790 | 0 \ |
| 1791 | -c "Enable use of CID extension." \ |
| 1792 | -s "Enable use of CID extension." \ |
| 1793 | -c "client hello, adding CID extension" \ |
| 1794 | -s "found CID extension" \ |
| 1795 | -s "Use of CID extension negotiated" \ |
| 1796 | -s "server hello, adding CID extension" \ |
| 1797 | -c "found CID extension" \ |
| 1798 | -c "Use of CID extension negotiated" \ |
| 1799 | -s "Copy CIDs into SSL transform" \ |
| 1800 | -c "Copy CIDs into SSL transform" \ |
| 1801 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1802 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1803 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1804 | -c "Use of Connection ID has been negotiated" \ |
| 1805 | -c "ignoring unexpected CID" \ |
| 1806 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1807 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1808 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1809 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1810 | -p "$P_PXY mtu=800" \ |
| 1811 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1812 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1813 | 0 \ |
| 1814 | -c "Enable use of CID extension." \ |
| 1815 | -s "Enable use of CID extension." \ |
| 1816 | -c "client hello, adding CID extension" \ |
| 1817 | -s "found CID extension" \ |
| 1818 | -s "Use of CID extension negotiated" \ |
| 1819 | -s "server hello, adding CID extension" \ |
| 1820 | -c "found CID extension" \ |
| 1821 | -c "Use of CID extension negotiated" \ |
| 1822 | -s "Copy CIDs into SSL transform" \ |
| 1823 | -c "Copy CIDs into SSL transform" \ |
| 1824 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1825 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1826 | -s "Use of Connection ID has been negotiated" \ |
| 1827 | -c "Use of Connection ID has been negotiated" |
| 1828 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1829 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1830 | 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] | 1831 | -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] | 1832 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1833 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1834 | 0 \ |
| 1835 | -c "Enable use of CID extension." \ |
| 1836 | -s "Enable use of CID extension." \ |
| 1837 | -c "client hello, adding CID extension" \ |
| 1838 | -s "found CID extension" \ |
| 1839 | -s "Use of CID extension negotiated" \ |
| 1840 | -s "server hello, adding CID extension" \ |
| 1841 | -c "found CID extension" \ |
| 1842 | -c "Use of CID extension negotiated" \ |
| 1843 | -s "Copy CIDs into SSL transform" \ |
| 1844 | -c "Copy CIDs into SSL transform" \ |
| 1845 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1846 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1847 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1848 | -c "Use of Connection ID has been negotiated" \ |
| 1849 | -c "ignoring unexpected CID" \ |
| 1850 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1851 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1852 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1853 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1854 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1855 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1856 | 0 \ |
| 1857 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1858 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1859 | -c "client hello, adding CID extension" \ |
| 1860 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1861 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1862 | -s "server hello, adding CID extension" \ |
| 1863 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1864 | -c "Use of CID extension negotiated" \ |
| 1865 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1866 | -c "Copy CIDs into SSL transform" \ |
| 1867 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1868 | -s "Peer CID (length 0 Bytes):" \ |
| 1869 | -s "Use of Connection ID has been negotiated" \ |
| 1870 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1871 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1872 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1873 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1874 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1875 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1876 | 0 \ |
| 1877 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1878 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1879 | -c "client hello, adding CID extension" \ |
| 1880 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1881 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1882 | -s "server hello, adding CID extension" \ |
| 1883 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1884 | -c "Use of CID extension negotiated" \ |
| 1885 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1886 | -c "Copy CIDs into SSL transform" \ |
| 1887 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1888 | -c "Peer CID (length 0 Bytes):" \ |
| 1889 | -s "Use of Connection ID has been negotiated" \ |
| 1890 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1891 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1892 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1893 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1894 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1895 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1896 | 0 \ |
| 1897 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1898 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1899 | -c "client hello, adding CID extension" \ |
| 1900 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1901 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1902 | -s "server hello, adding CID extension" \ |
| 1903 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1904 | -c "Use of CID extension negotiated" \ |
| 1905 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1906 | -c "Copy CIDs into SSL transform" \ |
| 1907 | -S "Use of Connection ID has been negotiated" \ |
| 1908 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1909 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1910 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1911 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1912 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1913 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1914 | 0 \ |
| 1915 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1916 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1917 | -c "client hello, adding CID extension" \ |
| 1918 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1919 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1920 | -s "server hello, adding CID extension" \ |
| 1921 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1922 | -c "Use of CID extension negotiated" \ |
| 1923 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1924 | -c "Copy CIDs into SSL transform" \ |
| 1925 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1926 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1927 | -s "Use of Connection ID has been negotiated" \ |
| 1928 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1929 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1930 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1931 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1932 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1933 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1934 | 0 \ |
| 1935 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1936 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1937 | -c "client hello, adding CID extension" \ |
| 1938 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1939 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1940 | -s "server hello, adding CID extension" \ |
| 1941 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1942 | -c "Use of CID extension negotiated" \ |
| 1943 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1944 | -c "Copy CIDs into SSL transform" \ |
| 1945 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1946 | -s "Peer CID (length 0 Bytes):" \ |
| 1947 | -s "Use of Connection ID has been negotiated" \ |
| 1948 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1949 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1950 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1951 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1952 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1953 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1954 | 0 \ |
| 1955 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1956 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1957 | -c "client hello, adding CID extension" \ |
| 1958 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1959 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1960 | -s "server hello, adding CID extension" \ |
| 1961 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1962 | -c "Use of CID extension negotiated" \ |
| 1963 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1964 | -c "Copy CIDs into SSL transform" \ |
| 1965 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1966 | -c "Peer CID (length 0 Bytes):" \ |
| 1967 | -s "Use of Connection ID has been negotiated" \ |
| 1968 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1969 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1971 | 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] | 1972 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1973 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1974 | 0 \ |
| 1975 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1976 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1977 | -c "client hello, adding CID extension" \ |
| 1978 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1979 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1980 | -s "server hello, adding CID extension" \ |
| 1981 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1982 | -c "Use of CID extension negotiated" \ |
| 1983 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1984 | -c "Copy CIDs into SSL transform" \ |
| 1985 | -S "Use of Connection ID has been negotiated" \ |
| 1986 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1987 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1988 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1989 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1990 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1991 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1992 | 0 \ |
| 1993 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1994 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1995 | -c "client hello, adding CID extension" \ |
| 1996 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1997 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1998 | -s "server hello, adding CID extension" \ |
| 1999 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2000 | -c "Use of CID extension negotiated" \ |
| 2001 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2002 | -c "Copy CIDs into SSL transform" \ |
| 2003 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2004 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2005 | -s "Use of Connection ID has been negotiated" \ |
| 2006 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2007 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2008 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2009 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2010 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2011 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2012 | 0 \ |
| 2013 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2014 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2015 | -c "client hello, adding CID extension" \ |
| 2016 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2017 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2018 | -s "server hello, adding CID extension" \ |
| 2019 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2020 | -c "Use of CID extension negotiated" \ |
| 2021 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2022 | -c "Copy CIDs into SSL transform" \ |
| 2023 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2024 | -s "Peer CID (length 0 Bytes):" \ |
| 2025 | -s "Use of Connection ID has been negotiated" \ |
| 2026 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2027 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2028 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2029 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2030 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2031 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2032 | 0 \ |
| 2033 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2034 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2035 | -c "client hello, adding CID extension" \ |
| 2036 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2037 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2038 | -s "server hello, adding CID extension" \ |
| 2039 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2040 | -c "Use of CID extension negotiated" \ |
| 2041 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2042 | -c "Copy CIDs into SSL transform" \ |
| 2043 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2044 | -c "Peer CID (length 0 Bytes):" \ |
| 2045 | -s "Use of Connection ID has been negotiated" \ |
| 2046 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2047 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2048 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2049 | 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] | 2050 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2051 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2052 | 0 \ |
| 2053 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2054 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2055 | -c "client hello, adding CID extension" \ |
| 2056 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2057 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2058 | -s "server hello, adding CID extension" \ |
| 2059 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2060 | -c "Use of CID extension negotiated" \ |
| 2061 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2062 | -c "Copy CIDs into SSL transform" \ |
| 2063 | -S "Use of Connection ID has been negotiated" \ |
| 2064 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2065 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2066 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2067 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2068 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2069 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2070 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2071 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2072 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2073 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2074 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2075 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2076 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2077 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2078 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2079 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2080 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2081 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2082 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2083 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2084 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2085 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2086 | 0 \ |
| 2087 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2088 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2089 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2090 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2091 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2092 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2093 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2094 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2095 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2096 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2097 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2098 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2099 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2100 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2101 | 0 \ |
| 2102 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2103 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2104 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2105 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2106 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2107 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2108 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2109 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2110 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2111 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2112 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2113 | 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] | 2114 | -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] | 2115 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2116 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2117 | 0 \ |
| 2118 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2119 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2120 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2121 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2122 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2123 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2124 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2125 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2126 | -c "ignoring unexpected CID" \ |
| 2127 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2128 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2129 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2130 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2131 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2132 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2133 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2134 | 0 \ |
| 2135 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2136 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2137 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2138 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2139 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2140 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2141 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2142 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2143 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2144 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2145 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2146 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2147 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2148 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2149 | 0 \ |
| 2150 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2151 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2152 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2153 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2154 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2155 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2156 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2157 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2158 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2159 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2160 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2161 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2162 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2163 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2164 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2165 | 0 \ |
| 2166 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2167 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2168 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2169 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2170 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2171 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2172 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2173 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2174 | -c "ignoring unexpected CID" \ |
| 2175 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2176 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2177 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2178 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2179 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2180 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2181 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2182 | 0 \ |
| 2183 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2184 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2185 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2186 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2187 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2188 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2189 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2190 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2191 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2192 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2193 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2194 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2195 | 0 \ |
| 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2204 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2205 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2206 | -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] | 2207 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2208 | "$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" \ |
| 2209 | 0 \ |
| 2210 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2211 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2212 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2213 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2214 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2215 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2216 | -c "ignoring unexpected CID" \ |
| 2217 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2218 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2219 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2221 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2222 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2223 | "$P_CLI debug_level=3 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" \ |
| 2232 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2233 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2234 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2235 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2237 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2238 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2239 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2240 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2241 | 0 \ |
| 2242 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2243 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2244 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2245 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2246 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2247 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2248 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2249 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2250 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2251 | -c "ignoring unexpected CID" \ |
| 2252 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2253 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2254 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2255 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2256 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2257 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2258 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2259 | 0 \ |
| 2260 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2261 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2262 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2263 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2264 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2265 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2266 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2267 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2268 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2269 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2270 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2271 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2272 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2273 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2274 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2275 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2276 | 0 \ |
| 2277 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2278 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2279 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2280 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2281 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2282 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2283 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2284 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2285 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2286 | -c "ignoring unexpected CID" \ |
| 2287 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2288 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2289 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2290 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2291 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2292 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2293 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2294 | 0 \ |
| 2295 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2296 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2297 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2298 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2299 | -s "Reallocating in_buf" \ |
| 2300 | -s "Reallocating out_buf" |
| 2301 | |
| 2302 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2303 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2304 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2305 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2306 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2307 | 0 \ |
| 2308 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2309 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2310 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2311 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2312 | -s "Reallocating in_buf" \ |
| 2313 | -s "Reallocating out_buf" |
| 2314 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2315 | # Tests for Encrypt-then-MAC extension |
| 2316 | |
| 2317 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2318 | "$P_SRV debug_level=3 \ |
| 2319 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2320 | "$P_CLI debug_level=3" \ |
| 2321 | 0 \ |
| 2322 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2323 | -s "found encrypt then mac extension" \ |
| 2324 | -s "server hello, adding encrypt then mac extension" \ |
| 2325 | -c "found encrypt_then_mac extension" \ |
| 2326 | -c "using encrypt then mac" \ |
| 2327 | -s "using encrypt then mac" |
| 2328 | |
| 2329 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2330 | "$P_SRV debug_level=3 etm=0 \ |
| 2331 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2332 | "$P_CLI debug_level=3 etm=1" \ |
| 2333 | 0 \ |
| 2334 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2335 | -s "found encrypt then mac extension" \ |
| 2336 | -S "server hello, adding encrypt then mac extension" \ |
| 2337 | -C "found encrypt_then_mac extension" \ |
| 2338 | -C "using encrypt then mac" \ |
| 2339 | -S "using encrypt then mac" |
| 2340 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2341 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2342 | "$P_SRV debug_level=3 etm=1 \ |
| 2343 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2344 | "$P_CLI debug_level=3 etm=1" \ |
| 2345 | 0 \ |
| 2346 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2347 | -s "found encrypt then mac extension" \ |
| 2348 | -S "server hello, adding encrypt then mac extension" \ |
| 2349 | -C "found encrypt_then_mac extension" \ |
| 2350 | -C "using encrypt then mac" \ |
| 2351 | -S "using encrypt then mac" |
| 2352 | |
| 2353 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2354 | "$P_SRV debug_level=3 etm=1 \ |
| 2355 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2356 | "$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] | 2357 | 0 \ |
| 2358 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2359 | -s "found encrypt then mac extension" \ |
| 2360 | -S "server hello, adding encrypt then mac extension" \ |
| 2361 | -C "found encrypt_then_mac extension" \ |
| 2362 | -C "using encrypt then mac" \ |
| 2363 | -S "using encrypt then mac" |
| 2364 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2365 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2366 | "$P_SRV debug_level=3 etm=1 \ |
| 2367 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2368 | "$P_CLI debug_level=3 etm=0" \ |
| 2369 | 0 \ |
| 2370 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2371 | -S "found encrypt then mac extension" \ |
| 2372 | -S "server hello, adding encrypt then mac extension" \ |
| 2373 | -C "found encrypt_then_mac extension" \ |
| 2374 | -C "using encrypt then mac" \ |
| 2375 | -S "using encrypt then mac" |
| 2376 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2377 | # Tests for Extended Master Secret extension |
| 2378 | |
| 2379 | run_test "Extended Master Secret: default" \ |
| 2380 | "$P_SRV debug_level=3" \ |
| 2381 | "$P_CLI debug_level=3" \ |
| 2382 | 0 \ |
| 2383 | -c "client hello, adding extended_master_secret extension" \ |
| 2384 | -s "found extended master secret extension" \ |
| 2385 | -s "server hello, adding extended master secret extension" \ |
| 2386 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2387 | -c "session hash for extended master secret" \ |
| 2388 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2389 | |
| 2390 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2391 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2392 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2393 | 0 \ |
| 2394 | -c "client hello, adding extended_master_secret extension" \ |
| 2395 | -s "found extended master secret extension" \ |
| 2396 | -S "server hello, adding extended master secret extension" \ |
| 2397 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2398 | -C "session hash for extended master secret" \ |
| 2399 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2400 | |
| 2401 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2402 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2403 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2404 | 0 \ |
| 2405 | -C "client hello, adding extended_master_secret extension" \ |
| 2406 | -S "found extended master secret extension" \ |
| 2407 | -S "server hello, adding extended master secret extension" \ |
| 2408 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2409 | -C "session hash for extended master secret" \ |
| 2410 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2411 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2412 | # Tests for FALLBACK_SCSV |
| 2413 | |
| 2414 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2415 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2416 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2417 | 0 \ |
| 2418 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2419 | -S "received FALLBACK_SCSV" \ |
| 2420 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2421 | -C "is a fatal alert message (msg 86)" |
| 2422 | |
| 2423 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2424 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2425 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2426 | 0 \ |
| 2427 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2428 | -S "received FALLBACK_SCSV" \ |
| 2429 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2430 | -C "is a fatal alert message (msg 86)" |
| 2431 | |
| 2432 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2433 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2434 | "$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] | 2435 | 1 \ |
| 2436 | -c "adding FALLBACK_SCSV" \ |
| 2437 | -s "received FALLBACK_SCSV" \ |
| 2438 | -s "inapropriate fallback" \ |
| 2439 | -c "is a fatal alert message (msg 86)" |
| 2440 | |
| 2441 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2442 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2443 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2444 | 0 \ |
| 2445 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2446 | -s "received FALLBACK_SCSV" \ |
| 2447 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2448 | -C "is a fatal alert message (msg 86)" |
| 2449 | |
| 2450 | requires_openssl_with_fallback_scsv |
| 2451 | run_test "Fallback SCSV: default, openssl server" \ |
| 2452 | "$O_SRV" \ |
| 2453 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2454 | 0 \ |
| 2455 | -C "adding FALLBACK_SCSV" \ |
| 2456 | -C "is a fatal alert message (msg 86)" |
| 2457 | |
| 2458 | requires_openssl_with_fallback_scsv |
| 2459 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2460 | "$O_SRV" \ |
| 2461 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2462 | 1 \ |
| 2463 | -c "adding FALLBACK_SCSV" \ |
| 2464 | -c "is a fatal alert message (msg 86)" |
| 2465 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2466 | requires_openssl_with_fallback_scsv |
| 2467 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2468 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2469 | "$O_CLI -tls1_1" \ |
| 2470 | 0 \ |
| 2471 | -S "received FALLBACK_SCSV" \ |
| 2472 | -S "inapropriate fallback" |
| 2473 | |
| 2474 | requires_openssl_with_fallback_scsv |
| 2475 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2476 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2477 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2478 | 1 \ |
| 2479 | -s "received FALLBACK_SCSV" \ |
| 2480 | -s "inapropriate fallback" |
| 2481 | |
| 2482 | requires_openssl_with_fallback_scsv |
| 2483 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2484 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2485 | "$O_CLI -fallback_scsv" \ |
| 2486 | 0 \ |
| 2487 | -s "received FALLBACK_SCSV" \ |
| 2488 | -S "inapropriate fallback" |
| 2489 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2490 | # Test sending and receiving empty application data records |
| 2491 | |
| 2492 | run_test "Encrypt then MAC: empty application data record" \ |
| 2493 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2494 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2495 | 0 \ |
| 2496 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2497 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2498 | -c "0 bytes written in 1 fragments" |
| 2499 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2500 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2501 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2502 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2503 | 0 \ |
| 2504 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2505 | -c "0 bytes written in 1 fragments" |
| 2506 | |
| 2507 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2508 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2509 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2510 | 0 \ |
| 2511 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2512 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2513 | -c "0 bytes written in 1 fragments" |
| 2514 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2515 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2516 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2517 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2518 | 0 \ |
| 2519 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2520 | -c "0 bytes written in 1 fragments" |
| 2521 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2522 | ## ClientHello generated with |
| 2523 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2524 | ## then manually twiddling the ciphersuite list. |
| 2525 | ## The ClientHello content is spelled out below as a hex string as |
| 2526 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2527 | ## The expected response is an inappropriate_fallback alert. |
| 2528 | requires_openssl_with_fallback_scsv |
| 2529 | run_test "Fallback SCSV: beginning of list" \ |
| 2530 | "$P_SRV debug_level=2" \ |
| 2531 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2532 | 0 \ |
| 2533 | -s "received FALLBACK_SCSV" \ |
| 2534 | -s "inapropriate fallback" |
| 2535 | |
| 2536 | requires_openssl_with_fallback_scsv |
| 2537 | run_test "Fallback SCSV: end of list" \ |
| 2538 | "$P_SRV debug_level=2" \ |
| 2539 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2540 | 0 \ |
| 2541 | -s "received FALLBACK_SCSV" \ |
| 2542 | -s "inapropriate fallback" |
| 2543 | |
| 2544 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2545 | requires_openssl_with_fallback_scsv |
| 2546 | run_test "Fallback SCSV: not in list" \ |
| 2547 | "$P_SRV debug_level=2" \ |
| 2548 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2549 | 0 \ |
| 2550 | -S "received FALLBACK_SCSV" \ |
| 2551 | -S "inapropriate fallback" |
| 2552 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2553 | # Tests for CBC 1/n-1 record splitting |
| 2554 | |
| 2555 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2556 | "$P_SRV" \ |
| 2557 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2558 | request_size=123 force_version=tls1_2" \ |
| 2559 | 0 \ |
| 2560 | -s "Read from client: 123 bytes read" \ |
| 2561 | -S "Read from client: 1 bytes read" \ |
| 2562 | -S "122 bytes read" |
| 2563 | |
| 2564 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2565 | "$P_SRV" \ |
| 2566 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2567 | request_size=123 force_version=tls1_1" \ |
| 2568 | 0 \ |
| 2569 | -s "Read from client: 123 bytes read" \ |
| 2570 | -S "Read from client: 1 bytes read" \ |
| 2571 | -S "122 bytes read" |
| 2572 | |
| 2573 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2574 | "$P_SRV" \ |
| 2575 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2576 | request_size=123 force_version=tls1" \ |
| 2577 | 0 \ |
| 2578 | -S "Read from client: 123 bytes read" \ |
| 2579 | -s "Read from client: 1 bytes read" \ |
| 2580 | -s "122 bytes read" |
| 2581 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2582 | 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] | 2583 | "$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] | 2584 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2585 | request_size=123 force_version=tls1" \ |
| 2586 | 0 \ |
| 2587 | -s "Read from client: 123 bytes read" \ |
| 2588 | -S "Read from client: 1 bytes read" \ |
| 2589 | -S "122 bytes read" |
| 2590 | |
| 2591 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2592 | "$P_SRV" \ |
| 2593 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2594 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2595 | 0 \ |
| 2596 | -s "Read from client: 123 bytes read" \ |
| 2597 | -S "Read from client: 1 bytes read" \ |
| 2598 | -S "122 bytes read" |
| 2599 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2600 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2601 | "$P_SRV nbio=2" \ |
| 2602 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2603 | request_size=123 force_version=tls1" \ |
| 2604 | 0 \ |
| 2605 | -S "Read from client: 123 bytes read" \ |
| 2606 | -s "Read from client: 1 bytes read" \ |
| 2607 | -s "122 bytes read" |
| 2608 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2609 | # Tests for Session Tickets |
| 2610 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2611 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2612 | "$P_SRV debug_level=3 tickets=1" \ |
| 2613 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2614 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2615 | -c "client hello, adding session ticket extension" \ |
| 2616 | -s "found session ticket extension" \ |
| 2617 | -s "server hello, adding session ticket extension" \ |
| 2618 | -c "found session_ticket extension" \ |
| 2619 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2620 | -S "session successfully restored from cache" \ |
| 2621 | -s "session successfully restored from ticket" \ |
| 2622 | -s "a session has been resumed" \ |
| 2623 | -c "a session has been resumed" |
| 2624 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2625 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2626 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2627 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2628 | 0 \ |
| 2629 | -c "client hello, adding session ticket extension" \ |
| 2630 | -s "found session ticket extension" \ |
| 2631 | -s "server hello, adding session ticket extension" \ |
| 2632 | -c "found session_ticket extension" \ |
| 2633 | -c "parse new session ticket" \ |
| 2634 | -S "session successfully restored from cache" \ |
| 2635 | -s "session successfully restored from ticket" \ |
| 2636 | -s "a session has been resumed" \ |
| 2637 | -c "a session has been resumed" |
| 2638 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2639 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2640 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2641 | "$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] | 2642 | 0 \ |
| 2643 | -c "client hello, adding session ticket extension" \ |
| 2644 | -s "found session ticket extension" \ |
| 2645 | -s "server hello, adding session ticket extension" \ |
| 2646 | -c "found session_ticket extension" \ |
| 2647 | -c "parse new session ticket" \ |
| 2648 | -S "session successfully restored from cache" \ |
| 2649 | -S "session successfully restored from ticket" \ |
| 2650 | -S "a session has been resumed" \ |
| 2651 | -C "a session has been resumed" |
| 2652 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2653 | run_test "Session resume using tickets: session copy" \ |
| 2654 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2655 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2656 | 0 \ |
| 2657 | -c "client hello, adding session ticket extension" \ |
| 2658 | -s "found session ticket extension" \ |
| 2659 | -s "server hello, adding session ticket extension" \ |
| 2660 | -c "found session_ticket extension" \ |
| 2661 | -c "parse new session ticket" \ |
| 2662 | -S "session successfully restored from cache" \ |
| 2663 | -s "session successfully restored from ticket" \ |
| 2664 | -s "a session has been resumed" \ |
| 2665 | -c "a session has been resumed" |
| 2666 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2667 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2668 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2669 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2670 | 0 \ |
| 2671 | -c "client hello, adding session ticket extension" \ |
| 2672 | -c "found session_ticket extension" \ |
| 2673 | -c "parse new session ticket" \ |
| 2674 | -c "a session has been resumed" |
| 2675 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2676 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2677 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2678 | "( $O_CLI -sess_out $SESSION; \ |
| 2679 | $O_CLI -sess_in $SESSION; \ |
| 2680 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2681 | 0 \ |
| 2682 | -s "found session ticket extension" \ |
| 2683 | -s "server hello, adding session ticket extension" \ |
| 2684 | -S "session successfully restored from cache" \ |
| 2685 | -s "session successfully restored from ticket" \ |
| 2686 | -s "a session has been resumed" |
| 2687 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2688 | # Tests for Session Tickets with DTLS |
| 2689 | |
| 2690 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2691 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2692 | "$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] | 2693 | 0 \ |
| 2694 | -c "client hello, adding session ticket extension" \ |
| 2695 | -s "found session ticket extension" \ |
| 2696 | -s "server hello, adding session ticket extension" \ |
| 2697 | -c "found session_ticket extension" \ |
| 2698 | -c "parse new session ticket" \ |
| 2699 | -S "session successfully restored from cache" \ |
| 2700 | -s "session successfully restored from ticket" \ |
| 2701 | -s "a session has been resumed" \ |
| 2702 | -c "a session has been resumed" |
| 2703 | |
| 2704 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2705 | "$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] | 2706 | "$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] | 2707 | 0 \ |
| 2708 | -c "client hello, adding session ticket extension" \ |
| 2709 | -s "found session ticket extension" \ |
| 2710 | -s "server hello, adding session ticket extension" \ |
| 2711 | -c "found session_ticket extension" \ |
| 2712 | -c "parse new session ticket" \ |
| 2713 | -S "session successfully restored from cache" \ |
| 2714 | -s "session successfully restored from ticket" \ |
| 2715 | -s "a session has been resumed" \ |
| 2716 | -c "a session has been resumed" |
| 2717 | |
| 2718 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2719 | "$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] | 2720 | "$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] | 2721 | 0 \ |
| 2722 | -c "client hello, adding session ticket extension" \ |
| 2723 | -s "found session ticket extension" \ |
| 2724 | -s "server hello, adding session ticket extension" \ |
| 2725 | -c "found session_ticket extension" \ |
| 2726 | -c "parse new session ticket" \ |
| 2727 | -S "session successfully restored from cache" \ |
| 2728 | -S "session successfully restored from ticket" \ |
| 2729 | -S "a session has been resumed" \ |
| 2730 | -C "a session has been resumed" |
| 2731 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2732 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2733 | "$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] | 2734 | "$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] | 2735 | 0 \ |
| 2736 | -c "client hello, adding session ticket extension" \ |
| 2737 | -s "found session ticket extension" \ |
| 2738 | -s "server hello, adding session ticket extension" \ |
| 2739 | -c "found session_ticket extension" \ |
| 2740 | -c "parse new session ticket" \ |
| 2741 | -S "session successfully restored from cache" \ |
| 2742 | -s "session successfully restored from ticket" \ |
| 2743 | -s "a session has been resumed" \ |
| 2744 | -c "a session has been resumed" |
| 2745 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2746 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2747 | "$O_SRV -dtls1" \ |
| 2748 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2749 | 0 \ |
| 2750 | -c "client hello, adding session ticket extension" \ |
| 2751 | -c "found session_ticket extension" \ |
| 2752 | -c "parse new session ticket" \ |
| 2753 | -c "a session has been resumed" |
| 2754 | |
| 2755 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2756 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2757 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2758 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2759 | rm -f $SESSION )" \ |
| 2760 | 0 \ |
| 2761 | -s "found session ticket extension" \ |
| 2762 | -s "server hello, adding session ticket extension" \ |
| 2763 | -S "session successfully restored from cache" \ |
| 2764 | -s "session successfully restored from ticket" \ |
| 2765 | -s "a session has been resumed" |
| 2766 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2767 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2768 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2769 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2770 | "$P_SRV debug_level=3 tickets=0" \ |
| 2771 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2772 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2773 | -c "client hello, adding session ticket extension" \ |
| 2774 | -s "found session ticket extension" \ |
| 2775 | -S "server hello, adding session ticket extension" \ |
| 2776 | -C "found session_ticket extension" \ |
| 2777 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2778 | -s "session successfully restored from cache" \ |
| 2779 | -S "session successfully restored from ticket" \ |
| 2780 | -s "a session has been resumed" \ |
| 2781 | -c "a session has been resumed" |
| 2782 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2783 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2784 | "$P_SRV debug_level=3 tickets=1" \ |
| 2785 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2786 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2787 | -C "client hello, adding session ticket extension" \ |
| 2788 | -S "found session ticket extension" \ |
| 2789 | -S "server hello, adding session ticket extension" \ |
| 2790 | -C "found session_ticket extension" \ |
| 2791 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2792 | -s "session successfully restored from cache" \ |
| 2793 | -S "session successfully restored from ticket" \ |
| 2794 | -s "a session has been resumed" \ |
| 2795 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2796 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2797 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2798 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2799 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2800 | 0 \ |
| 2801 | -S "session successfully restored from cache" \ |
| 2802 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2803 | -S "a session has been resumed" \ |
| 2804 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2805 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2806 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2807 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2808 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2809 | 0 \ |
| 2810 | -s "session successfully restored from cache" \ |
| 2811 | -S "session successfully restored from ticket" \ |
| 2812 | -s "a session has been resumed" \ |
| 2813 | -c "a session has been resumed" |
| 2814 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2815 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2816 | "$P_SRV debug_level=3 tickets=0" \ |
| 2817 | "$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] | 2818 | 0 \ |
| 2819 | -s "session successfully restored from cache" \ |
| 2820 | -S "session successfully restored from ticket" \ |
| 2821 | -s "a session has been resumed" \ |
| 2822 | -c "a session has been resumed" |
| 2823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2824 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2825 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2826 | "$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] | 2827 | 0 \ |
| 2828 | -S "session successfully restored from cache" \ |
| 2829 | -S "session successfully restored from ticket" \ |
| 2830 | -S "a session has been resumed" \ |
| 2831 | -C "a session has been resumed" |
| 2832 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2833 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2834 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2835 | "$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] | 2836 | 0 \ |
| 2837 | -s "session successfully restored from cache" \ |
| 2838 | -S "session successfully restored from ticket" \ |
| 2839 | -s "a session has been resumed" \ |
| 2840 | -c "a session has been resumed" |
| 2841 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2842 | run_test "Session resume using cache: session copy" \ |
| 2843 | "$P_SRV debug_level=3 tickets=0" \ |
| 2844 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2845 | 0 \ |
| 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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2851 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2852 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2853 | "( $O_CLI -sess_out $SESSION; \ |
| 2854 | $O_CLI -sess_in $SESSION; \ |
| 2855 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2856 | 0 \ |
| 2857 | -s "found session ticket extension" \ |
| 2858 | -S "server hello, adding session ticket extension" \ |
| 2859 | -s "session successfully restored from cache" \ |
| 2860 | -S "session successfully restored from ticket" \ |
| 2861 | -s "a session has been resumed" |
| 2862 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2863 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2864 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2865 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2866 | 0 \ |
| 2867 | -C "found session_ticket extension" \ |
| 2868 | -C "parse new session ticket" \ |
| 2869 | -c "a session has been resumed" |
| 2870 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2871 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2872 | |
| 2873 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2874 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2875 | "$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] | 2876 | 0 \ |
| 2877 | -c "client hello, adding session ticket extension" \ |
| 2878 | -s "found session ticket extension" \ |
| 2879 | -S "server hello, adding session ticket extension" \ |
| 2880 | -C "found session_ticket extension" \ |
| 2881 | -C "parse new session ticket" \ |
| 2882 | -s "session successfully restored from cache" \ |
| 2883 | -S "session successfully restored from ticket" \ |
| 2884 | -s "a session has been resumed" \ |
| 2885 | -c "a session has been resumed" |
| 2886 | |
| 2887 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2888 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2889 | "$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] | 2890 | 0 \ |
| 2891 | -C "client hello, adding session ticket extension" \ |
| 2892 | -S "found session ticket extension" \ |
| 2893 | -S "server hello, adding session ticket extension" \ |
| 2894 | -C "found session_ticket extension" \ |
| 2895 | -C "parse new session ticket" \ |
| 2896 | -s "session successfully restored from cache" \ |
| 2897 | -S "session successfully restored from ticket" \ |
| 2898 | -s "a session has been resumed" \ |
| 2899 | -c "a session has been resumed" |
| 2900 | |
| 2901 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2902 | "$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] | 2903 | "$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] | 2904 | 0 \ |
| 2905 | -S "session successfully restored from cache" \ |
| 2906 | -S "session successfully restored from ticket" \ |
| 2907 | -S "a session has been resumed" \ |
| 2908 | -C "a session has been resumed" |
| 2909 | |
| 2910 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2911 | "$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] | 2912 | "$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] | 2913 | 0 \ |
| 2914 | -s "session successfully restored from cache" \ |
| 2915 | -S "session successfully restored from ticket" \ |
| 2916 | -s "a session has been resumed" \ |
| 2917 | -c "a session has been resumed" |
| 2918 | |
| 2919 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2920 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2921 | "$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] | 2922 | 0 \ |
| 2923 | -s "session successfully restored from cache" \ |
| 2924 | -S "session successfully restored from ticket" \ |
| 2925 | -s "a session has been resumed" \ |
| 2926 | -c "a session has been resumed" |
| 2927 | |
| 2928 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2929 | "$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] | 2930 | "$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] | 2931 | 0 \ |
| 2932 | -S "session successfully restored from cache" \ |
| 2933 | -S "session successfully restored from ticket" \ |
| 2934 | -S "a session has been resumed" \ |
| 2935 | -C "a session has been resumed" |
| 2936 | |
| 2937 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2938 | "$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] | 2939 | "$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] | 2940 | 0 \ |
| 2941 | -s "session successfully restored from cache" \ |
| 2942 | -S "session successfully restored from ticket" \ |
| 2943 | -s "a session has been resumed" \ |
| 2944 | -c "a session has been resumed" |
| 2945 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2946 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2947 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2948 | "$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] | 2949 | 0 \ |
| 2950 | -s "session successfully restored from cache" \ |
| 2951 | -S "session successfully restored from ticket" \ |
| 2952 | -s "a session has been resumed" \ |
| 2953 | -c "a session has been resumed" |
| 2954 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2955 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2956 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2957 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2958 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2959 | rm -f $SESSION )" \ |
| 2960 | 0 \ |
| 2961 | -s "found session ticket extension" \ |
| 2962 | -S "server hello, adding session ticket extension" \ |
| 2963 | -s "session successfully restored from cache" \ |
| 2964 | -S "session successfully restored from ticket" \ |
| 2965 | -s "a session has been resumed" |
| 2966 | |
| 2967 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2968 | "$O_SRV -dtls1" \ |
| 2969 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2970 | 0 \ |
| 2971 | -C "found session_ticket extension" \ |
| 2972 | -C "parse new session ticket" \ |
| 2973 | -c "a session has been resumed" |
| 2974 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2975 | # Tests for Max Fragment Length extension |
| 2976 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2977 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 2978 | 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] | 2979 | exit 1 |
| 2980 | fi |
| 2981 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2982 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 2983 | echo "Using non-default maximum content length $MAX_CONTENT_LEN" |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2984 | fi |
| 2985 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2986 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2987 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2988 | "$P_SRV debug_level=3" \ |
| 2989 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2990 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2991 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 2992 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 2993 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 2994 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2995 | -C "client hello, adding max_fragment_length extension" \ |
| 2996 | -S "found max fragment length extension" \ |
| 2997 | -S "server hello, max_fragment_length extension" \ |
| 2998 | -C "found max_fragment_length extension" |
| 2999 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3000 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3001 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3002 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3003 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3004 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3005 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3006 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3007 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3008 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3009 | -C "client hello, adding max_fragment_length extension" \ |
| 3010 | -S "found max fragment length extension" \ |
| 3011 | -S "server hello, max_fragment_length extension" \ |
| 3012 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3013 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3014 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3015 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3016 | |
| 3017 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3018 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3019 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3020 | "$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] | 3021 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3022 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3023 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3024 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3025 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3026 | -C "client hello, adding max_fragment_length extension" \ |
| 3027 | -S "found max fragment length extension" \ |
| 3028 | -S "server hello, max_fragment_length extension" \ |
| 3029 | -C "found max_fragment_length extension" \ |
| 3030 | -c "fragment larger than.*maximum " |
| 3031 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3032 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3033 | # (session fragment length will be 16384 regardless of mbedtls |
| 3034 | # content length configuration.) |
| 3035 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3036 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3037 | run_test "Max fragment length: disabled, larger message" \ |
| 3038 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3039 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3040 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3041 | -C "Maximum input fragment length is 16384" \ |
| 3042 | -C "Maximum output fragment length is 16384" \ |
| 3043 | -S "Maximum input fragment length is 16384" \ |
| 3044 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3045 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3046 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3047 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3048 | |
| 3049 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3050 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 3051 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3052 | "$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] | 3053 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3054 | -C "Maximum input fragment length is 16384" \ |
| 3055 | -C "Maximum output fragment length is 16384" \ |
| 3056 | -S "Maximum input fragment length is 16384" \ |
| 3057 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3058 | -c "fragment larger than.*maximum " |
| 3059 | |
| 3060 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3061 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3062 | "$P_SRV debug_level=3" \ |
| 3063 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3064 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3065 | -c "Maximum input fragment length is 4096" \ |
| 3066 | -c "Maximum output fragment length is 4096" \ |
| 3067 | -s "Maximum input fragment length is 4096" \ |
| 3068 | -s "Maximum output fragment length is 4096" \ |
| 3069 | -c "client hello, adding max_fragment_length extension" \ |
| 3070 | -s "found max fragment length extension" \ |
| 3071 | -s "server hello, max_fragment_length extension" \ |
| 3072 | -c "found max_fragment_length extension" |
| 3073 | |
| 3074 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3075 | run_test "Max fragment length: client 512, server 1024" \ |
| 3076 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3077 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3078 | 0 \ |
| 3079 | -c "Maximum input fragment length is 512" \ |
| 3080 | -c "Maximum output fragment length is 512" \ |
| 3081 | -s "Maximum input fragment length is 512" \ |
| 3082 | -s "Maximum output fragment length is 512" \ |
| 3083 | -c "client hello, adding max_fragment_length extension" \ |
| 3084 | -s "found max fragment length extension" \ |
| 3085 | -s "server hello, max_fragment_length extension" \ |
| 3086 | -c "found max_fragment_length extension" |
| 3087 | |
| 3088 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3089 | run_test "Max fragment length: client 512, server 2048" \ |
| 3090 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3091 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3092 | 0 \ |
| 3093 | -c "Maximum input fragment length is 512" \ |
| 3094 | -c "Maximum output fragment length is 512" \ |
| 3095 | -s "Maximum input fragment length is 512" \ |
| 3096 | -s "Maximum output fragment length is 512" \ |
| 3097 | -c "client hello, adding max_fragment_length extension" \ |
| 3098 | -s "found max fragment length extension" \ |
| 3099 | -s "server hello, max_fragment_length extension" \ |
| 3100 | -c "found max_fragment_length extension" |
| 3101 | |
| 3102 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3103 | run_test "Max fragment length: client 512, server 4096" \ |
| 3104 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3105 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3106 | 0 \ |
| 3107 | -c "Maximum input fragment length is 512" \ |
| 3108 | -c "Maximum output fragment length is 512" \ |
| 3109 | -s "Maximum input fragment length is 512" \ |
| 3110 | -s "Maximum output fragment length is 512" \ |
| 3111 | -c "client hello, adding max_fragment_length extension" \ |
| 3112 | -s "found max fragment length extension" \ |
| 3113 | -s "server hello, max_fragment_length extension" \ |
| 3114 | -c "found max_fragment_length extension" |
| 3115 | |
| 3116 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3117 | run_test "Max fragment length: client 1024, server 512" \ |
| 3118 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3119 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3120 | 0 \ |
| 3121 | -c "Maximum input fragment length is 1024" \ |
| 3122 | -c "Maximum output fragment length is 1024" \ |
| 3123 | -s "Maximum input fragment length is 1024" \ |
| 3124 | -s "Maximum output fragment length is 512" \ |
| 3125 | -c "client hello, adding max_fragment_length extension" \ |
| 3126 | -s "found max fragment length extension" \ |
| 3127 | -s "server hello, max_fragment_length extension" \ |
| 3128 | -c "found max_fragment_length extension" |
| 3129 | |
| 3130 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3131 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3132 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3133 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3134 | 0 \ |
| 3135 | -c "Maximum input fragment length is 1024" \ |
| 3136 | -c "Maximum output fragment length is 1024" \ |
| 3137 | -s "Maximum input fragment length is 1024" \ |
| 3138 | -s "Maximum output fragment length is 1024" \ |
| 3139 | -c "client hello, adding max_fragment_length extension" \ |
| 3140 | -s "found max fragment length extension" \ |
| 3141 | -s "server hello, max_fragment_length extension" \ |
| 3142 | -c "found max_fragment_length extension" |
| 3143 | |
| 3144 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3145 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3146 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3147 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3148 | 0 \ |
| 3149 | -c "Maximum input fragment length is 1024" \ |
| 3150 | -c "Maximum output fragment length is 1024" \ |
| 3151 | -s "Maximum input fragment length is 1024" \ |
| 3152 | -s "Maximum output fragment length is 1024" \ |
| 3153 | -c "client hello, adding max_fragment_length extension" \ |
| 3154 | -s "found max fragment length extension" \ |
| 3155 | -s "server hello, max_fragment_length extension" \ |
| 3156 | -c "found max_fragment_length extension" |
| 3157 | |
| 3158 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3159 | run_test "Max fragment length: client 2048, server 512" \ |
| 3160 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3161 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3162 | 0 \ |
| 3163 | -c "Maximum input fragment length is 2048" \ |
| 3164 | -c "Maximum output fragment length is 2048" \ |
| 3165 | -s "Maximum input fragment length is 2048" \ |
| 3166 | -s "Maximum output fragment length is 512" \ |
| 3167 | -c "client hello, adding max_fragment_length extension" \ |
| 3168 | -s "found max fragment length extension" \ |
| 3169 | -s "server hello, max_fragment_length extension" \ |
| 3170 | -c "found max_fragment_length extension" |
| 3171 | |
| 3172 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3173 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3174 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3175 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3176 | 0 \ |
| 3177 | -c "Maximum input fragment length is 2048" \ |
| 3178 | -c "Maximum output fragment length is 2048" \ |
| 3179 | -s "Maximum input fragment length is 2048" \ |
| 3180 | -s "Maximum output fragment length is 1024" \ |
| 3181 | -c "client hello, adding max_fragment_length extension" \ |
| 3182 | -s "found max fragment length extension" \ |
| 3183 | -s "server hello, max_fragment_length extension" \ |
| 3184 | -c "found max_fragment_length extension" |
| 3185 | |
| 3186 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3187 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3188 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3189 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3190 | 0 \ |
| 3191 | -c "Maximum input fragment length is 2048" \ |
| 3192 | -c "Maximum output fragment length is 2048" \ |
| 3193 | -s "Maximum input fragment length is 2048" \ |
| 3194 | -s "Maximum output fragment length is 2048" \ |
| 3195 | -c "client hello, adding max_fragment_length extension" \ |
| 3196 | -s "found max fragment length extension" \ |
| 3197 | -s "server hello, max_fragment_length extension" \ |
| 3198 | -c "found max_fragment_length extension" |
| 3199 | |
| 3200 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3201 | run_test "Max fragment length: client 4096, server 512" \ |
| 3202 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3203 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3204 | 0 \ |
| 3205 | -c "Maximum input fragment length is 4096" \ |
| 3206 | -c "Maximum output fragment length is 4096" \ |
| 3207 | -s "Maximum input fragment length is 4096" \ |
| 3208 | -s "Maximum output fragment length is 512" \ |
| 3209 | -c "client hello, adding max_fragment_length extension" \ |
| 3210 | -s "found max fragment length extension" \ |
| 3211 | -s "server hello, max_fragment_length extension" \ |
| 3212 | -c "found max_fragment_length extension" |
| 3213 | |
| 3214 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3215 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3216 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3217 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3218 | 0 \ |
| 3219 | -c "Maximum input fragment length is 4096" \ |
| 3220 | -c "Maximum output fragment length is 4096" \ |
| 3221 | -s "Maximum input fragment length is 4096" \ |
| 3222 | -s "Maximum output fragment length is 1024" \ |
| 3223 | -c "client hello, adding max_fragment_length extension" \ |
| 3224 | -s "found max fragment length extension" \ |
| 3225 | -s "server hello, max_fragment_length extension" \ |
| 3226 | -c "found max_fragment_length extension" |
| 3227 | |
| 3228 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3229 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3230 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3231 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3232 | 0 \ |
| 3233 | -c "Maximum input fragment length is 4096" \ |
| 3234 | -c "Maximum output fragment length is 4096" \ |
| 3235 | -s "Maximum input fragment length is 4096" \ |
| 3236 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3237 | -c "client hello, adding max_fragment_length extension" \ |
| 3238 | -s "found max fragment length extension" \ |
| 3239 | -s "server hello, max_fragment_length extension" \ |
| 3240 | -c "found max_fragment_length extension" |
| 3241 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3242 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3243 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3244 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3245 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3246 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3247 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3248 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3249 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3250 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3251 | -C "client hello, adding max_fragment_length extension" \ |
| 3252 | -S "found max fragment length extension" \ |
| 3253 | -S "server hello, max_fragment_length extension" \ |
| 3254 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3255 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3256 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3257 | requires_gnutls |
| 3258 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3259 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3260 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3261 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3262 | -c "Maximum input fragment length is 4096" \ |
| 3263 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3264 | -c "client hello, adding max_fragment_length extension" \ |
| 3265 | -c "found max_fragment_length extension" |
| 3266 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3267 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3268 | run_test "Max fragment length: client, message just fits" \ |
| 3269 | "$P_SRV debug_level=3" \ |
| 3270 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3271 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3272 | -c "Maximum input fragment length is 2048" \ |
| 3273 | -c "Maximum output fragment length is 2048" \ |
| 3274 | -s "Maximum input fragment length is 2048" \ |
| 3275 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3276 | -c "client hello, adding max_fragment_length extension" \ |
| 3277 | -s "found max fragment length extension" \ |
| 3278 | -s "server hello, max_fragment_length extension" \ |
| 3279 | -c "found max_fragment_length extension" \ |
| 3280 | -c "2048 bytes written in 1 fragments" \ |
| 3281 | -s "2048 bytes read" |
| 3282 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3283 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3284 | run_test "Max fragment length: client, larger message" \ |
| 3285 | "$P_SRV debug_level=3" \ |
| 3286 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3287 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3288 | -c "Maximum input fragment length is 2048" \ |
| 3289 | -c "Maximum output fragment length is 2048" \ |
| 3290 | -s "Maximum input fragment length is 2048" \ |
| 3291 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3292 | -c "client hello, adding max_fragment_length extension" \ |
| 3293 | -s "found max fragment length extension" \ |
| 3294 | -s "server hello, max_fragment_length extension" \ |
| 3295 | -c "found max_fragment_length extension" \ |
| 3296 | -c "2345 bytes written in 2 fragments" \ |
| 3297 | -s "2048 bytes read" \ |
| 3298 | -s "297 bytes read" |
| 3299 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3300 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3301 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3302 | "$P_SRV debug_level=3 dtls=1" \ |
| 3303 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3304 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3305 | -c "Maximum input fragment length is 2048" \ |
| 3306 | -c "Maximum output fragment length is 2048" \ |
| 3307 | -s "Maximum input fragment length is 2048" \ |
| 3308 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3309 | -c "client hello, adding max_fragment_length extension" \ |
| 3310 | -s "found max fragment length extension" \ |
| 3311 | -s "server hello, max_fragment_length extension" \ |
| 3312 | -c "found max_fragment_length extension" \ |
| 3313 | -c "fragment larger than.*maximum" |
| 3314 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3315 | # Tests for renegotiation |
| 3316 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3317 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3318 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3319 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3320 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3321 | 0 \ |
| 3322 | -C "client hello, adding renegotiation extension" \ |
| 3323 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3324 | -S "found renegotiation extension" \ |
| 3325 | -s "server hello, secure renegotiation extension" \ |
| 3326 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3327 | -C "=> renegotiate" \ |
| 3328 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3329 | -S "write hello request" |
| 3330 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3332 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3333 | "$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] | 3334 | "$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] | 3335 | 0 \ |
| 3336 | -c "client hello, adding renegotiation extension" \ |
| 3337 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3338 | -s "found renegotiation extension" \ |
| 3339 | -s "server hello, secure renegotiation extension" \ |
| 3340 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3341 | -c "=> renegotiate" \ |
| 3342 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3343 | -S "write hello request" |
| 3344 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3345 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3346 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3347 | "$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] | 3348 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3349 | 0 \ |
| 3350 | -c "client hello, adding renegotiation extension" \ |
| 3351 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3352 | -s "found renegotiation extension" \ |
| 3353 | -s "server hello, secure renegotiation extension" \ |
| 3354 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3355 | -c "=> renegotiate" \ |
| 3356 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3357 | -s "write hello request" |
| 3358 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3359 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3360 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3361 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3362 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3363 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3364 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3365 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3366 | 0 \ |
| 3367 | -c "client hello, adding renegotiation extension" \ |
| 3368 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3369 | -s "found renegotiation extension" \ |
| 3370 | -s "server hello, secure renegotiation extension" \ |
| 3371 | -c "found renegotiation extension" \ |
| 3372 | -c "=> renegotiate" \ |
| 3373 | -s "=> renegotiate" \ |
| 3374 | -S "write hello request" \ |
| 3375 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3376 | |
| 3377 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3378 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3379 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3380 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3381 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3382 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3383 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3384 | 0 \ |
| 3385 | -c "client hello, adding renegotiation extension" \ |
| 3386 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3387 | -s "found renegotiation extension" \ |
| 3388 | -s "server hello, secure renegotiation extension" \ |
| 3389 | -c "found renegotiation extension" \ |
| 3390 | -c "=> renegotiate" \ |
| 3391 | -s "=> renegotiate" \ |
| 3392 | -s "write hello request" \ |
| 3393 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3394 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3395 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3396 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3397 | "$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] | 3398 | "$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] | 3399 | 0 \ |
| 3400 | -c "client hello, adding renegotiation extension" \ |
| 3401 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3402 | -s "found renegotiation extension" \ |
| 3403 | -s "server hello, secure renegotiation extension" \ |
| 3404 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3405 | -c "=> renegotiate" \ |
| 3406 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3407 | -s "write hello request" |
| 3408 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3410 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3411 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3412 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3413 | "$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" \ |
| 3414 | 0 \ |
| 3415 | -c "Maximum input fragment length is 2048" \ |
| 3416 | -c "Maximum output fragment length is 2048" \ |
| 3417 | -s "Maximum input fragment length is 2048" \ |
| 3418 | -s "Maximum output fragment length is 512" \ |
| 3419 | -c "client hello, adding max_fragment_length extension" \ |
| 3420 | -s "found max fragment length extension" \ |
| 3421 | -s "server hello, max_fragment_length extension" \ |
| 3422 | -c "found max_fragment_length extension" \ |
| 3423 | -c "client hello, adding renegotiation extension" \ |
| 3424 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3425 | -s "found renegotiation extension" \ |
| 3426 | -s "server hello, secure renegotiation extension" \ |
| 3427 | -c "found renegotiation extension" \ |
| 3428 | -c "=> renegotiate" \ |
| 3429 | -s "=> renegotiate" \ |
| 3430 | -s "write hello request" |
| 3431 | |
| 3432 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3433 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3434 | "$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] | 3435 | "$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] | 3436 | 1 \ |
| 3437 | -c "client hello, adding renegotiation extension" \ |
| 3438 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3439 | -S "found renegotiation extension" \ |
| 3440 | -s "server hello, secure renegotiation extension" \ |
| 3441 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3442 | -c "=> renegotiate" \ |
| 3443 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3444 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3445 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3446 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3447 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3448 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3449 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3450 | "$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] | 3451 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3452 | 0 \ |
| 3453 | -C "client hello, adding renegotiation extension" \ |
| 3454 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3455 | -S "found renegotiation extension" \ |
| 3456 | -s "server hello, secure renegotiation extension" \ |
| 3457 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3458 | -C "=> renegotiate" \ |
| 3459 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3460 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3461 | -S "SSL - An unexpected message was received from our peer" \ |
| 3462 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 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, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3466 | "$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] | 3467 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3468 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3469 | 0 \ |
| 3470 | -C "client hello, adding renegotiation extension" \ |
| 3471 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3472 | -S "found renegotiation extension" \ |
| 3473 | -s "server hello, secure renegotiation extension" \ |
| 3474 | -c "found renegotiation extension" \ |
| 3475 | -C "=> renegotiate" \ |
| 3476 | -S "=> renegotiate" \ |
| 3477 | -s "write hello request" \ |
| 3478 | -S "SSL - An unexpected message was received from our peer" \ |
| 3479 | -S "failed" |
| 3480 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3481 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3482 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3483 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3484 | "$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] | 3485 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3486 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3487 | 0 \ |
| 3488 | -C "client hello, adding renegotiation extension" \ |
| 3489 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3490 | -S "found renegotiation extension" \ |
| 3491 | -s "server hello, secure renegotiation extension" \ |
| 3492 | -c "found renegotiation extension" \ |
| 3493 | -C "=> renegotiate" \ |
| 3494 | -S "=> renegotiate" \ |
| 3495 | -s "write hello request" \ |
| 3496 | -S "SSL - An unexpected message was received from our peer" \ |
| 3497 | -S "failed" |
| 3498 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3500 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3501 | "$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] | 3502 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3503 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3504 | 0 \ |
| 3505 | -C "client hello, adding renegotiation extension" \ |
| 3506 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3507 | -S "found renegotiation extension" \ |
| 3508 | -s "server hello, secure renegotiation extension" \ |
| 3509 | -c "found renegotiation extension" \ |
| 3510 | -C "=> renegotiate" \ |
| 3511 | -S "=> renegotiate" \ |
| 3512 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3513 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3514 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3515 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3516 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3517 | "$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] | 3518 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3519 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3520 | 0 \ |
| 3521 | -c "client hello, adding renegotiation extension" \ |
| 3522 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3523 | -s "found renegotiation extension" \ |
| 3524 | -s "server hello, secure renegotiation extension" \ |
| 3525 | -c "found renegotiation extension" \ |
| 3526 | -c "=> renegotiate" \ |
| 3527 | -s "=> renegotiate" \ |
| 3528 | -s "write hello request" \ |
| 3529 | -S "SSL - An unexpected message was received from our peer" \ |
| 3530 | -S "failed" |
| 3531 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3532 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3533 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3534 | "$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] | 3535 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3536 | 0 \ |
| 3537 | -C "client hello, adding renegotiation extension" \ |
| 3538 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3539 | -S "found renegotiation extension" \ |
| 3540 | -s "server hello, secure renegotiation extension" \ |
| 3541 | -c "found renegotiation extension" \ |
| 3542 | -S "record counter limit reached: renegotiate" \ |
| 3543 | -C "=> renegotiate" \ |
| 3544 | -S "=> renegotiate" \ |
| 3545 | -S "write hello request" \ |
| 3546 | -S "SSL - An unexpected message was received from our peer" \ |
| 3547 | -S "failed" |
| 3548 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3549 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3550 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3551 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3552 | "$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] | 3553 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3554 | 0 \ |
| 3555 | -c "client hello, adding renegotiation extension" \ |
| 3556 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3557 | -s "found renegotiation extension" \ |
| 3558 | -s "server hello, secure renegotiation extension" \ |
| 3559 | -c "found renegotiation extension" \ |
| 3560 | -s "record counter limit reached: renegotiate" \ |
| 3561 | -c "=> renegotiate" \ |
| 3562 | -s "=> renegotiate" \ |
| 3563 | -s "write hello request" \ |
| 3564 | -S "SSL - An unexpected message was received from our peer" \ |
| 3565 | -S "failed" |
| 3566 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3567 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3568 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3569 | "$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] | 3570 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +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" \ |
| 3577 | -s "record counter limit reached: renegotiate" \ |
| 3578 | -c "=> renegotiate" \ |
| 3579 | -s "=> renegotiate" \ |
| 3580 | -s "write hello request" \ |
| 3581 | -S "SSL - An unexpected message was received from our peer" \ |
| 3582 | -S "failed" |
| 3583 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3584 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3585 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3586 | "$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] | 3587 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 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 | -S "record counter limit reached: renegotiate" \ |
| 3595 | -C "=> renegotiate" \ |
| 3596 | -S "=> renegotiate" \ |
| 3597 | -S "write hello request" \ |
| 3598 | -S "SSL - An unexpected message was received from our peer" \ |
| 3599 | -S "failed" |
| 3600 | |
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: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3603 | "$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] | 3604 | "$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] | 3605 | 0 \ |
| 3606 | -c "client hello, adding renegotiation extension" \ |
| 3607 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3608 | -s "found renegotiation extension" \ |
| 3609 | -s "server hello, secure renegotiation extension" \ |
| 3610 | -c "found renegotiation extension" \ |
| 3611 | -c "=> renegotiate" \ |
| 3612 | -s "=> renegotiate" \ |
| 3613 | -S "write hello request" |
| 3614 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3615 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3616 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3617 | "$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] | 3618 | "$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] | 3619 | 0 \ |
| 3620 | -c "client hello, adding renegotiation extension" \ |
| 3621 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3622 | -s "found renegotiation extension" \ |
| 3623 | -s "server hello, secure renegotiation extension" \ |
| 3624 | -c "found renegotiation extension" \ |
| 3625 | -c "=> renegotiate" \ |
| 3626 | -s "=> renegotiate" \ |
| 3627 | -s "write hello request" |
| 3628 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3629 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3630 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3631 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3632 | "$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] | 3633 | 0 \ |
| 3634 | -c "client hello, adding renegotiation extension" \ |
| 3635 | -c "found renegotiation extension" \ |
| 3636 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3637 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3638 | -C "error" \ |
| 3639 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3640 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3641 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3642 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3643 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3644 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3645 | "$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] | 3646 | 0 \ |
| 3647 | -c "client hello, adding renegotiation extension" \ |
| 3648 | -c "found renegotiation extension" \ |
| 3649 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3650 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3651 | -C "error" \ |
| 3652 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3653 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3654 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3655 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3656 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3657 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3658 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3659 | 1 \ |
| 3660 | -c "client hello, adding renegotiation extension" \ |
| 3661 | -C "found renegotiation extension" \ |
| 3662 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3663 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3664 | -c "error" \ |
| 3665 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3666 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3667 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3668 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3669 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3670 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3671 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3672 | allow_legacy=0" \ |
| 3673 | 1 \ |
| 3674 | -c "client hello, adding renegotiation extension" \ |
| 3675 | -C "found renegotiation extension" \ |
| 3676 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3677 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3678 | -c "error" \ |
| 3679 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3680 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3681 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3682 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3683 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3684 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3685 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3686 | allow_legacy=1" \ |
| 3687 | 0 \ |
| 3688 | -c "client hello, adding renegotiation extension" \ |
| 3689 | -C "found renegotiation extension" \ |
| 3690 | -c "=> renegotiate" \ |
| 3691 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3692 | -C "error" \ |
| 3693 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3694 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3695 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3696 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3697 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3698 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3699 | 0 \ |
| 3700 | -c "client hello, adding renegotiation extension" \ |
| 3701 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3702 | -s "found renegotiation extension" \ |
| 3703 | -s "server hello, secure renegotiation extension" \ |
| 3704 | -c "found renegotiation extension" \ |
| 3705 | -c "=> renegotiate" \ |
| 3706 | -s "=> renegotiate" \ |
| 3707 | -S "write hello request" |
| 3708 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3709 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3710 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3711 | "$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] | 3712 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3713 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3714 | 0 \ |
| 3715 | -c "client hello, adding renegotiation extension" \ |
| 3716 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3717 | -s "found renegotiation extension" \ |
| 3718 | -s "server hello, secure renegotiation extension" \ |
| 3719 | -c "found renegotiation extension" \ |
| 3720 | -c "=> renegotiate" \ |
| 3721 | -s "=> renegotiate" \ |
| 3722 | -s "write hello request" |
| 3723 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3724 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3725 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3726 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3727 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3728 | 0 \ |
| 3729 | -c "client hello, adding renegotiation extension" \ |
| 3730 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3731 | -s "found renegotiation extension" \ |
| 3732 | -s "server hello, secure renegotiation extension" \ |
| 3733 | -s "record counter limit reached: renegotiate" \ |
| 3734 | -c "=> renegotiate" \ |
| 3735 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3736 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3737 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3738 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3739 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3740 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3741 | "$G_SRV -u --mtu 4096" \ |
| 3742 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3743 | 0 \ |
| 3744 | -c "client hello, adding renegotiation extension" \ |
| 3745 | -c "found renegotiation extension" \ |
| 3746 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3747 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3748 | -C "error" \ |
| 3749 | -s "Extra-header:" |
| 3750 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3751 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3752 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3753 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3754 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3755 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3756 | "$P_CLI debug_level=3" \ |
| 3757 | 0 \ |
| 3758 | -c "found renegotiation extension" \ |
| 3759 | -C "error" \ |
| 3760 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3761 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3762 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3763 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3764 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3765 | "$P_CLI debug_level=3" \ |
| 3766 | 0 \ |
| 3767 | -C "found renegotiation extension" \ |
| 3768 | -C "error" \ |
| 3769 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3770 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3771 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3772 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3773 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3774 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3775 | 1 \ |
| 3776 | -C "found renegotiation extension" \ |
| 3777 | -c "error" \ |
| 3778 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3779 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3780 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3781 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3782 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3783 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3784 | 0 \ |
| 3785 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3786 | -s "server hello, secure renegotiation extension" |
| 3787 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3788 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3789 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3790 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3791 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3792 | 0 \ |
| 3793 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3794 | -S "server hello, secure renegotiation extension" |
| 3795 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3796 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3797 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3798 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3799 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3800 | 1 \ |
| 3801 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3802 | -S "server hello, secure renegotiation extension" |
| 3803 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3804 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3805 | |
| 3806 | requires_gnutls |
| 3807 | run_test "DER format: no trailing bytes" \ |
| 3808 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3809 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3810 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3811 | 0 \ |
| 3812 | -c "Handshake was completed" \ |
| 3813 | |
| 3814 | requires_gnutls |
| 3815 | run_test "DER format: with a trailing zero byte" \ |
| 3816 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3817 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3818 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3819 | 0 \ |
| 3820 | -c "Handshake was completed" \ |
| 3821 | |
| 3822 | requires_gnutls |
| 3823 | run_test "DER format: with a trailing random byte" \ |
| 3824 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3825 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3826 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3827 | 0 \ |
| 3828 | -c "Handshake was completed" \ |
| 3829 | |
| 3830 | requires_gnutls |
| 3831 | run_test "DER format: with 2 trailing random bytes" \ |
| 3832 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3833 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3834 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3835 | 0 \ |
| 3836 | -c "Handshake was completed" \ |
| 3837 | |
| 3838 | requires_gnutls |
| 3839 | run_test "DER format: with 4 trailing random bytes" \ |
| 3840 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3841 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3842 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3843 | 0 \ |
| 3844 | -c "Handshake was completed" \ |
| 3845 | |
| 3846 | requires_gnutls |
| 3847 | run_test "DER format: with 8 trailing random bytes" \ |
| 3848 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3849 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3850 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3851 | 0 \ |
| 3852 | -c "Handshake was completed" \ |
| 3853 | |
| 3854 | requires_gnutls |
| 3855 | run_test "DER format: with 9 trailing random bytes" \ |
| 3856 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3857 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3858 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3859 | 0 \ |
| 3860 | -c "Handshake was completed" \ |
| 3861 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3862 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3863 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3864 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3865 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3866 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3867 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3868 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3869 | 1 \ |
| 3870 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3871 | -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] | 3872 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3873 | -c "X509 - Certificate verification failed" |
| 3874 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3875 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3876 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3877 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3878 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3879 | 0 \ |
| 3880 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3881 | -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] | 3882 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3883 | -C "X509 - Certificate verification failed" |
| 3884 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3885 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3886 | "$P_SRV" \ |
| 3887 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3888 | 0 \ |
| 3889 | -c "x509_verify_cert() returned" \ |
| 3890 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3891 | -c "! Certificate verification flags"\ |
| 3892 | -C "! mbedtls_ssl_handshake returned" \ |
| 3893 | -C "X509 - Certificate verification failed" \ |
| 3894 | -C "SSL - No CA Chain is set, but required to operate" |
| 3895 | |
| 3896 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3897 | "$P_SRV" \ |
| 3898 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3899 | 1 \ |
| 3900 | -c "x509_verify_cert() returned" \ |
| 3901 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3902 | -c "! Certificate verification flags"\ |
| 3903 | -c "! mbedtls_ssl_handshake returned" \ |
| 3904 | -c "SSL - No CA Chain is set, but required to operate" |
| 3905 | |
| 3906 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3907 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3908 | # the client informs the server about the supported curves - it does, though, in the |
| 3909 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3910 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3911 | # different means to have the server ignoring the client's supported curve list. |
| 3912 | |
| 3913 | requires_config_enabled MBEDTLS_ECP_C |
| 3914 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3915 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3916 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3917 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3918 | 1 \ |
| 3919 | -c "bad certificate (EC key curve)"\ |
| 3920 | -c "! Certificate verification flags"\ |
| 3921 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3922 | |
| 3923 | requires_config_enabled MBEDTLS_ECP_C |
| 3924 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3925 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3926 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3927 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3928 | 1 \ |
| 3929 | -c "bad certificate (EC key curve)"\ |
| 3930 | -c "! Certificate verification flags"\ |
| 3931 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3932 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3933 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3934 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3935 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3936 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3937 | 0 \ |
| 3938 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3939 | -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] | 3940 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3941 | -C "X509 - Certificate verification failed" |
| 3942 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3943 | run_test "Authentication: client SHA256, server required" \ |
| 3944 | "$P_SRV auth_mode=required" \ |
| 3945 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3946 | key_file=data_files/server6.key \ |
| 3947 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3948 | 0 \ |
| 3949 | -c "Supported Signature Algorithm found: 4," \ |
| 3950 | -c "Supported Signature Algorithm found: 5," |
| 3951 | |
| 3952 | run_test "Authentication: client SHA384, server required" \ |
| 3953 | "$P_SRV auth_mode=required" \ |
| 3954 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3955 | key_file=data_files/server6.key \ |
| 3956 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3957 | 0 \ |
| 3958 | -c "Supported Signature Algorithm found: 4," \ |
| 3959 | -c "Supported Signature Algorithm found: 5," |
| 3960 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3961 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3962 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3963 | "$P_CLI debug_level=3 crt_file=none \ |
| 3964 | key_file=data_files/server5.key" \ |
| 3965 | 1 \ |
| 3966 | -S "skip write certificate request" \ |
| 3967 | -C "skip parse certificate request" \ |
| 3968 | -c "got a certificate request" \ |
| 3969 | -c "= write certificate$" \ |
| 3970 | -C "skip write certificate$" \ |
| 3971 | -S "x509_verify_cert() returned" \ |
| 3972 | -s "client has no certificate" \ |
| 3973 | -s "! mbedtls_ssl_handshake returned" \ |
| 3974 | -c "! mbedtls_ssl_handshake returned" \ |
| 3975 | -s "No client certification received from the client, but required by the authentication mode" |
| 3976 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3977 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3978 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3979 | "$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] | 3980 | key_file=data_files/server5.key" \ |
| 3981 | 1 \ |
| 3982 | -S "skip write certificate request" \ |
| 3983 | -C "skip parse certificate request" \ |
| 3984 | -c "got a certificate request" \ |
| 3985 | -C "skip write certificate" \ |
| 3986 | -C "skip write certificate verify" \ |
| 3987 | -S "skip parse certificate verify" \ |
| 3988 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3989 | -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] | 3990 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3991 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3992 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3993 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3994 | # We don't check that the client receives the alert because it might |
| 3995 | # detect that its write end of the connection is closed and abort |
| 3996 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3997 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3998 | run_test "Authentication: client cert not trusted, server required" \ |
| 3999 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4000 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4001 | key_file=data_files/server5.key" \ |
| 4002 | 1 \ |
| 4003 | -S "skip write certificate request" \ |
| 4004 | -C "skip parse certificate request" \ |
| 4005 | -c "got a certificate request" \ |
| 4006 | -C "skip write certificate" \ |
| 4007 | -C "skip write certificate verify" \ |
| 4008 | -S "skip parse certificate verify" \ |
| 4009 | -s "x509_verify_cert() returned" \ |
| 4010 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4011 | -s "! mbedtls_ssl_handshake returned" \ |
| 4012 | -c "! mbedtls_ssl_handshake returned" \ |
| 4013 | -s "X509 - Certificate verification failed" |
| 4014 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4015 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4016 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4017 | "$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] | 4018 | key_file=data_files/server5.key" \ |
| 4019 | 0 \ |
| 4020 | -S "skip write certificate request" \ |
| 4021 | -C "skip parse certificate request" \ |
| 4022 | -c "got a certificate request" \ |
| 4023 | -C "skip write certificate" \ |
| 4024 | -C "skip write certificate verify" \ |
| 4025 | -S "skip parse certificate verify" \ |
| 4026 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4027 | -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] | 4028 | -S "! mbedtls_ssl_handshake returned" \ |
| 4029 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4030 | -S "X509 - Certificate verification failed" |
| 4031 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4032 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4033 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4034 | "$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] | 4035 | key_file=data_files/server5.key" \ |
| 4036 | 0 \ |
| 4037 | -s "skip write certificate request" \ |
| 4038 | -C "skip parse certificate request" \ |
| 4039 | -c "got no certificate request" \ |
| 4040 | -c "skip write certificate" \ |
| 4041 | -c "skip write certificate verify" \ |
| 4042 | -s "skip parse certificate verify" \ |
| 4043 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4044 | -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] | 4045 | -S "! mbedtls_ssl_handshake returned" \ |
| 4046 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4047 | -S "X509 - Certificate verification failed" |
| 4048 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4049 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4050 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4051 | "$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] | 4052 | 0 \ |
| 4053 | -S "skip write certificate request" \ |
| 4054 | -C "skip parse certificate request" \ |
| 4055 | -c "got a certificate request" \ |
| 4056 | -C "skip write certificate$" \ |
| 4057 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4058 | -c "skip write certificate verify" \ |
| 4059 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4060 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4061 | -S "! mbedtls_ssl_handshake returned" \ |
| 4062 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4063 | -S "X509 - Certificate verification failed" |
| 4064 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4065 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4066 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4067 | "$O_CLI" \ |
| 4068 | 0 \ |
| 4069 | -S "skip write certificate request" \ |
| 4070 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4071 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4072 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4073 | -S "X509 - Certificate verification failed" |
| 4074 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4075 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4076 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4077 | "$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] | 4078 | 0 \ |
| 4079 | -C "skip parse certificate request" \ |
| 4080 | -c "got a certificate request" \ |
| 4081 | -C "skip write certificate$" \ |
| 4082 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4083 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4084 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4085 | run_test "Authentication: client no cert, openssl server required" \ |
| 4086 | "$O_SRV -Verify 10" \ |
| 4087 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4088 | 1 \ |
| 4089 | -C "skip parse certificate request" \ |
| 4090 | -c "got a certificate request" \ |
| 4091 | -C "skip write certificate$" \ |
| 4092 | -c "skip write certificate verify" \ |
| 4093 | -c "! mbedtls_ssl_handshake returned" |
| 4094 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 4095 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 4096 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4097 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4098 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 4099 | 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] | 4100 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4101 | 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] | 4102 | cat <<EOF |
| 4103 | ${CONFIG_H} contains a value for the configuration of |
| 4104 | MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script's |
| 4105 | test value of ${MAX_IM_CA}. |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4106 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 4107 | The tests assume this value and if it changes, the tests in this |
| 4108 | script should also be adjusted. |
| 4109 | EOF |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4110 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4111 | fi |
| 4112 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4113 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4114 | run_test "Authentication: server max_int chain, client default" \ |
| 4115 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4116 | key_file=data_files/dir-maxpath/09.key" \ |
| 4117 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4118 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4119 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4120 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4121 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4122 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4123 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4124 | key_file=data_files/dir-maxpath/10.key" \ |
| 4125 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4126 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4127 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4128 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4129 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4130 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4131 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4132 | key_file=data_files/dir-maxpath/10.key" \ |
| 4133 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4134 | auth_mode=optional" \ |
| 4135 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4136 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4137 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4138 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4139 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4140 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4141 | key_file=data_files/dir-maxpath/10.key" \ |
| 4142 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4143 | auth_mode=none" \ |
| 4144 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4145 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4146 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4147 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4148 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4149 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4150 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4151 | key_file=data_files/dir-maxpath/10.key" \ |
| 4152 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4153 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4154 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4155 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4156 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4157 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4158 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4159 | key_file=data_files/dir-maxpath/10.key" \ |
| 4160 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4161 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4162 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4163 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4164 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4165 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4166 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4167 | key_file=data_files/dir-maxpath/10.key" \ |
| 4168 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4169 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4170 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4171 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4172 | run_test "Authentication: client max_int chain, server required" \ |
| 4173 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4174 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4175 | key_file=data_files/dir-maxpath/09.key" \ |
| 4176 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4177 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4178 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4179 | # Tests for CA list in CertificateRequest messages |
| 4180 | |
| 4181 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4182 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4183 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4184 | key_file=data_files/server6.key" \ |
| 4185 | 0 \ |
| 4186 | -s "requested DN" |
| 4187 | |
| 4188 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4189 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4190 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4191 | key_file=data_files/server6.key" \ |
| 4192 | 0 \ |
| 4193 | -S "requested DN" |
| 4194 | |
| 4195 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4196 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4197 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4198 | key_file=data_files/server5.key" \ |
| 4199 | 1 \ |
| 4200 | -S "requested DN" \ |
| 4201 | -s "x509_verify_cert() returned" \ |
| 4202 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4203 | -s "! mbedtls_ssl_handshake returned" \ |
| 4204 | -c "! mbedtls_ssl_handshake returned" \ |
| 4205 | -s "X509 - Certificate verification failed" |
| 4206 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4207 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4208 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4209 | |
| 4210 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4211 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4212 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4213 | key_file=data_files/server5.key" \ |
| 4214 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4215 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4216 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4217 | -c "x509_verify_cert() returned" \ |
| 4218 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4219 | -c "! mbedtls_ssl_handshake returned" \ |
| 4220 | -c "X509 - Certificate verification failed" |
| 4221 | |
| 4222 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4223 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4224 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4225 | key_file=data_files/server5.key" \ |
| 4226 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4227 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4228 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4229 | -c "x509_verify_cert() returned" \ |
| 4230 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4231 | -C "! mbedtls_ssl_handshake returned" \ |
| 4232 | -C "X509 - Certificate verification failed" |
| 4233 | |
| 4234 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4235 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4236 | # the client informs the server about the supported curves - it does, though, in the |
| 4237 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4238 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4239 | # different means to have the server ignoring the client's supported curve list. |
| 4240 | |
| 4241 | requires_config_enabled MBEDTLS_ECP_C |
| 4242 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4243 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4244 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4245 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4246 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4247 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4248 | -c "use CA callback for X.509 CRT verification" \ |
| 4249 | -c "bad certificate (EC key curve)" \ |
| 4250 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4251 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4252 | |
| 4253 | requires_config_enabled MBEDTLS_ECP_C |
| 4254 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4255 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4256 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4257 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4258 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4259 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4260 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4261 | -c "bad certificate (EC key curve)"\ |
| 4262 | -c "! Certificate verification flags"\ |
| 4263 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4264 | |
| 4265 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4266 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4267 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4268 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4269 | key_file=data_files/server6.key \ |
| 4270 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4271 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4272 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4273 | -c "Supported Signature Algorithm found: 4," \ |
| 4274 | -c "Supported Signature Algorithm found: 5," |
| 4275 | |
| 4276 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4277 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4278 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4279 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4280 | key_file=data_files/server6.key \ |
| 4281 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4282 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4283 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4284 | -c "Supported Signature Algorithm found: 4," \ |
| 4285 | -c "Supported Signature Algorithm found: 5," |
| 4286 | |
| 4287 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4288 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4289 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4290 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4291 | key_file=data_files/server5.key" \ |
| 4292 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4293 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4294 | -S "skip write certificate request" \ |
| 4295 | -C "skip parse certificate request" \ |
| 4296 | -c "got a certificate request" \ |
| 4297 | -C "skip write certificate" \ |
| 4298 | -C "skip write certificate verify" \ |
| 4299 | -S "skip parse certificate verify" \ |
| 4300 | -s "x509_verify_cert() returned" \ |
| 4301 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4302 | -s "! mbedtls_ssl_handshake returned" \ |
| 4303 | -s "send alert level=2 message=48" \ |
| 4304 | -c "! mbedtls_ssl_handshake returned" \ |
| 4305 | -s "X509 - Certificate verification failed" |
| 4306 | # We don't check that the client receives the alert because it might |
| 4307 | # detect that its write end of the connection is closed and abort |
| 4308 | # before reading the alert message. |
| 4309 | |
| 4310 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4311 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4312 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4313 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4314 | key_file=data_files/server5.key" \ |
| 4315 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4316 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4317 | -S "skip write certificate request" \ |
| 4318 | -C "skip parse certificate request" \ |
| 4319 | -c "got a certificate request" \ |
| 4320 | -C "skip write certificate" \ |
| 4321 | -C "skip write certificate verify" \ |
| 4322 | -S "skip parse certificate verify" \ |
| 4323 | -s "x509_verify_cert() returned" \ |
| 4324 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4325 | -s "! mbedtls_ssl_handshake returned" \ |
| 4326 | -c "! mbedtls_ssl_handshake returned" \ |
| 4327 | -s "X509 - Certificate verification failed" |
| 4328 | |
| 4329 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4330 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4331 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4332 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4333 | key_file=data_files/server5.key" \ |
| 4334 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4335 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4336 | -S "skip write certificate request" \ |
| 4337 | -C "skip parse certificate request" \ |
| 4338 | -c "got a certificate request" \ |
| 4339 | -C "skip write certificate" \ |
| 4340 | -C "skip write certificate verify" \ |
| 4341 | -S "skip parse certificate verify" \ |
| 4342 | -s "x509_verify_cert() returned" \ |
| 4343 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4344 | -S "! mbedtls_ssl_handshake returned" \ |
| 4345 | -C "! mbedtls_ssl_handshake returned" \ |
| 4346 | -S "X509 - Certificate verification failed" |
| 4347 | |
| 4348 | requires_full_size_output_buffer |
| 4349 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4350 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4351 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4352 | key_file=data_files/dir-maxpath/09.key" \ |
| 4353 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4354 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4355 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4356 | -C "X509 - A fatal error occurred" |
| 4357 | |
| 4358 | requires_full_size_output_buffer |
| 4359 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4360 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4361 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4362 | key_file=data_files/dir-maxpath/10.key" \ |
| 4363 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4364 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4365 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4366 | -c "X509 - A fatal error occurred" |
| 4367 | |
| 4368 | requires_full_size_output_buffer |
| 4369 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4370 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4371 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4372 | key_file=data_files/dir-maxpath/10.key" \ |
| 4373 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4374 | debug_level=3 auth_mode=optional" \ |
| 4375 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4376 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4377 | -c "X509 - A fatal error occurred" |
| 4378 | |
| 4379 | requires_full_size_output_buffer |
| 4380 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4381 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4382 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4383 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4384 | key_file=data_files/dir-maxpath/10.key" \ |
| 4385 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4386 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4387 | -s "X509 - A fatal error occurred" |
| 4388 | |
| 4389 | requires_full_size_output_buffer |
| 4390 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4391 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4392 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4393 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4394 | key_file=data_files/dir-maxpath/10.key" \ |
| 4395 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4396 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4397 | -s "X509 - A fatal error occurred" |
| 4398 | |
| 4399 | requires_full_size_output_buffer |
| 4400 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4401 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4402 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4403 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4404 | key_file=data_files/dir-maxpath/09.key" \ |
| 4405 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4406 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4407 | -S "X509 - A fatal error occurred" |
| 4408 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4409 | # Tests for certificate selection based on SHA verson |
| 4410 | |
| 4411 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4412 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4413 | key_file=data_files/server5.key \ |
| 4414 | crt_file2=data_files/server5-sha1.crt \ |
| 4415 | key_file2=data_files/server5.key" \ |
| 4416 | "$P_CLI force_version=tls1_2" \ |
| 4417 | 0 \ |
| 4418 | -c "signed using.*ECDSA with SHA256" \ |
| 4419 | -C "signed using.*ECDSA with SHA1" |
| 4420 | |
| 4421 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4422 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4423 | key_file=data_files/server5.key \ |
| 4424 | crt_file2=data_files/server5-sha1.crt \ |
| 4425 | key_file2=data_files/server5.key" \ |
| 4426 | "$P_CLI force_version=tls1_1" \ |
| 4427 | 0 \ |
| 4428 | -C "signed using.*ECDSA with SHA256" \ |
| 4429 | -c "signed using.*ECDSA with SHA1" |
| 4430 | |
| 4431 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4432 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4433 | key_file=data_files/server5.key \ |
| 4434 | crt_file2=data_files/server5-sha1.crt \ |
| 4435 | key_file2=data_files/server5.key" \ |
| 4436 | "$P_CLI force_version=tls1" \ |
| 4437 | 0 \ |
| 4438 | -C "signed using.*ECDSA with SHA256" \ |
| 4439 | -c "signed using.*ECDSA with SHA1" |
| 4440 | |
| 4441 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4442 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4443 | key_file=data_files/server5.key \ |
| 4444 | crt_file2=data_files/server6.crt \ |
| 4445 | key_file2=data_files/server6.key" \ |
| 4446 | "$P_CLI force_version=tls1_1" \ |
| 4447 | 0 \ |
| 4448 | -c "serial number.*09" \ |
| 4449 | -c "signed using.*ECDSA with SHA256" \ |
| 4450 | -C "signed using.*ECDSA with SHA1" |
| 4451 | |
| 4452 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4453 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4454 | key_file=data_files/server6.key \ |
| 4455 | crt_file2=data_files/server5.crt \ |
| 4456 | key_file2=data_files/server5.key" \ |
| 4457 | "$P_CLI force_version=tls1_1" \ |
| 4458 | 0 \ |
| 4459 | -c "serial number.*0A" \ |
| 4460 | -c "signed using.*ECDSA with SHA256" \ |
| 4461 | -C "signed using.*ECDSA with SHA1" |
| 4462 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4463 | # tests for SNI |
| 4464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4465 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4466 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4467 | 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] | 4468 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4469 | 0 \ |
| 4470 | -S "parse ServerName extension" \ |
| 4471 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4472 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4473 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4474 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4475 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4476 | 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] | 4477 | 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] | 4478 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4479 | 0 \ |
| 4480 | -s "parse ServerName extension" \ |
| 4481 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4482 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4483 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4484 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4485 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4486 | 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] | 4487 | 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] | 4488 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4489 | 0 \ |
| 4490 | -s "parse ServerName extension" \ |
| 4491 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4492 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4493 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4494 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4495 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4496 | 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] | 4497 | 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] | 4498 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4499 | 1 \ |
| 4500 | -s "parse ServerName extension" \ |
| 4501 | -s "ssl_sni_wrapper() returned" \ |
| 4502 | -s "mbedtls_ssl_handshake returned" \ |
| 4503 | -c "mbedtls_ssl_handshake returned" \ |
| 4504 | -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] | 4505 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4506 | run_test "SNI: client auth no override: optional" \ |
| 4507 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4508 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4509 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4510 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4511 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4512 | -S "skip write certificate request" \ |
| 4513 | -C "skip parse certificate request" \ |
| 4514 | -c "got a certificate request" \ |
| 4515 | -C "skip write certificate" \ |
| 4516 | -C "skip write certificate verify" \ |
| 4517 | -S "skip parse certificate verify" |
| 4518 | |
| 4519 | run_test "SNI: client auth override: none -> optional" \ |
| 4520 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4521 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4522 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4523 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4524 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4525 | -S "skip write certificate request" \ |
| 4526 | -C "skip parse certificate request" \ |
| 4527 | -c "got a certificate request" \ |
| 4528 | -C "skip write certificate" \ |
| 4529 | -C "skip write certificate verify" \ |
| 4530 | -S "skip parse certificate verify" |
| 4531 | |
| 4532 | run_test "SNI: client auth override: optional -> none" \ |
| 4533 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4534 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4535 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4536 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4537 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4538 | -s "skip write certificate request" \ |
| 4539 | -C "skip parse certificate request" \ |
| 4540 | -c "got no certificate request" \ |
| 4541 | -c "skip write certificate" \ |
| 4542 | -c "skip write certificate verify" \ |
| 4543 | -s "skip parse certificate verify" |
| 4544 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4545 | run_test "SNI: CA no override" \ |
| 4546 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4547 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4548 | ca_file=data_files/test-ca.crt \ |
| 4549 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4550 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4551 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4552 | 1 \ |
| 4553 | -S "skip write certificate request" \ |
| 4554 | -C "skip parse certificate request" \ |
| 4555 | -c "got a certificate request" \ |
| 4556 | -C "skip write certificate" \ |
| 4557 | -C "skip write certificate verify" \ |
| 4558 | -S "skip parse certificate verify" \ |
| 4559 | -s "x509_verify_cert() returned" \ |
| 4560 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4561 | -S "The certificate has been revoked (is on a CRL)" |
| 4562 | |
| 4563 | run_test "SNI: CA override" \ |
| 4564 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4565 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4566 | ca_file=data_files/test-ca.crt \ |
| 4567 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4568 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4569 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4570 | 0 \ |
| 4571 | -S "skip write certificate request" \ |
| 4572 | -C "skip parse certificate request" \ |
| 4573 | -c "got a certificate request" \ |
| 4574 | -C "skip write certificate" \ |
| 4575 | -C "skip write certificate verify" \ |
| 4576 | -S "skip parse certificate verify" \ |
| 4577 | -S "x509_verify_cert() returned" \ |
| 4578 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4579 | -S "The certificate has been revoked (is on a CRL)" |
| 4580 | |
| 4581 | run_test "SNI: CA override with CRL" \ |
| 4582 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4583 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4584 | ca_file=data_files/test-ca.crt \ |
| 4585 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4586 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4587 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4588 | 1 \ |
| 4589 | -S "skip write certificate request" \ |
| 4590 | -C "skip parse certificate request" \ |
| 4591 | -c "got a certificate request" \ |
| 4592 | -C "skip write certificate" \ |
| 4593 | -C "skip write certificate verify" \ |
| 4594 | -S "skip parse certificate verify" \ |
| 4595 | -s "x509_verify_cert() returned" \ |
| 4596 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4597 | -s "The certificate has been revoked (is on a CRL)" |
| 4598 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4599 | # Tests for SNI and DTLS |
| 4600 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4601 | run_test "SNI: DTLS, no SNI callback" \ |
| 4602 | "$P_SRV debug_level=3 dtls=1 \ |
| 4603 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4604 | "$P_CLI server_name=localhost dtls=1" \ |
| 4605 | 0 \ |
| 4606 | -S "parse ServerName extension" \ |
| 4607 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4608 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4609 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4610 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4611 | "$P_SRV debug_level=3 dtls=1 \ |
| 4612 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4613 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4614 | "$P_CLI server_name=localhost dtls=1" \ |
| 4615 | 0 \ |
| 4616 | -s "parse ServerName extension" \ |
| 4617 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4618 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4619 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4620 | run_test "SNI: DTLS, matching cert 2" \ |
| 4621 | "$P_SRV debug_level=3 dtls=1 \ |
| 4622 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4623 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4624 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4625 | 0 \ |
| 4626 | -s "parse ServerName extension" \ |
| 4627 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4628 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4629 | |
| 4630 | run_test "SNI: DTLS, no matching cert" \ |
| 4631 | "$P_SRV debug_level=3 dtls=1 \ |
| 4632 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4633 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4634 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4635 | 1 \ |
| 4636 | -s "parse ServerName extension" \ |
| 4637 | -s "ssl_sni_wrapper() returned" \ |
| 4638 | -s "mbedtls_ssl_handshake returned" \ |
| 4639 | -c "mbedtls_ssl_handshake returned" \ |
| 4640 | -c "SSL - A fatal alert message was received from our peer" |
| 4641 | |
| 4642 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4643 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4644 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4645 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4646 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4647 | 0 \ |
| 4648 | -S "skip write certificate request" \ |
| 4649 | -C "skip parse certificate request" \ |
| 4650 | -c "got a certificate request" \ |
| 4651 | -C "skip write certificate" \ |
| 4652 | -C "skip write certificate verify" \ |
| 4653 | -S "skip parse certificate verify" |
| 4654 | |
| 4655 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4656 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4657 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4658 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4659 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4660 | 0 \ |
| 4661 | -S "skip write certificate request" \ |
| 4662 | -C "skip parse certificate request" \ |
| 4663 | -c "got a certificate request" \ |
| 4664 | -C "skip write certificate" \ |
| 4665 | -C "skip write certificate verify" \ |
| 4666 | -S "skip parse certificate verify" |
| 4667 | |
| 4668 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4669 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4670 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4671 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4672 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4673 | 0 \ |
| 4674 | -s "skip write certificate request" \ |
| 4675 | -C "skip parse certificate request" \ |
| 4676 | -c "got no certificate request" \ |
| 4677 | -c "skip write certificate" \ |
| 4678 | -c "skip write certificate verify" \ |
| 4679 | -s "skip parse certificate verify" |
| 4680 | |
| 4681 | run_test "SNI: DTLS, CA no override" \ |
| 4682 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4683 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4684 | ca_file=data_files/test-ca.crt \ |
| 4685 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4686 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4687 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4688 | 1 \ |
| 4689 | -S "skip write certificate request" \ |
| 4690 | -C "skip parse certificate request" \ |
| 4691 | -c "got a certificate request" \ |
| 4692 | -C "skip write certificate" \ |
| 4693 | -C "skip write certificate verify" \ |
| 4694 | -S "skip parse certificate verify" \ |
| 4695 | -s "x509_verify_cert() returned" \ |
| 4696 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4697 | -S "The certificate has been revoked (is on a CRL)" |
| 4698 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4699 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4700 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 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,data_files/test-ca2.crt,-,required" \ |
| 4704 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4705 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4706 | 0 \ |
| 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 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4717 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4718 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4719 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4720 | ca_file=data_files/test-ca.crt \ |
| 4721 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4722 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4723 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4724 | 1 \ |
| 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 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4735 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4736 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4737 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4738 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4739 | "$P_CLI nbio=2 tickets=0" \ |
| 4740 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4741 | -S "mbedtls_ssl_handshake returned" \ |
| 4742 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4743 | -c "Read from server: .* bytes read" |
| 4744 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4745 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4746 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4747 | "$P_CLI nbio=2 tickets=0" \ |
| 4748 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4749 | -S "mbedtls_ssl_handshake returned" \ |
| 4750 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4751 | -c "Read from server: .* bytes read" |
| 4752 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4753 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4754 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4755 | "$P_CLI nbio=2 tickets=1" \ |
| 4756 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4757 | -S "mbedtls_ssl_handshake returned" \ |
| 4758 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4759 | -c "Read from server: .* bytes read" |
| 4760 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4761 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4762 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4763 | "$P_CLI nbio=2 tickets=1" \ |
| 4764 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4765 | -S "mbedtls_ssl_handshake returned" \ |
| 4766 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4767 | -c "Read from server: .* bytes read" |
| 4768 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4769 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4770 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4771 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4772 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4773 | -S "mbedtls_ssl_handshake returned" \ |
| 4774 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4775 | -c "Read from server: .* bytes read" |
| 4776 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4777 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4778 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4779 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4780 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4781 | -S "mbedtls_ssl_handshake returned" \ |
| 4782 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4783 | -c "Read from server: .* bytes read" |
| 4784 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4785 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4786 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4787 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4788 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4789 | -S "mbedtls_ssl_handshake returned" \ |
| 4790 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4791 | -c "Read from server: .* bytes read" |
| 4792 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4793 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4794 | |
| 4795 | run_test "Event-driven I/O: basic handshake" \ |
| 4796 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4797 | "$P_CLI event=1 tickets=0" \ |
| 4798 | 0 \ |
| 4799 | -S "mbedtls_ssl_handshake returned" \ |
| 4800 | -C "mbedtls_ssl_handshake returned" \ |
| 4801 | -c "Read from server: .* bytes read" |
| 4802 | |
| 4803 | run_test "Event-driven I/O: client auth" \ |
| 4804 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4805 | "$P_CLI event=1 tickets=0" \ |
| 4806 | 0 \ |
| 4807 | -S "mbedtls_ssl_handshake returned" \ |
| 4808 | -C "mbedtls_ssl_handshake returned" \ |
| 4809 | -c "Read from server: .* bytes read" |
| 4810 | |
| 4811 | run_test "Event-driven I/O: ticket" \ |
| 4812 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4813 | "$P_CLI event=1 tickets=1" \ |
| 4814 | 0 \ |
| 4815 | -S "mbedtls_ssl_handshake returned" \ |
| 4816 | -C "mbedtls_ssl_handshake returned" \ |
| 4817 | -c "Read from server: .* bytes read" |
| 4818 | |
| 4819 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4820 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4821 | "$P_CLI event=1 tickets=1" \ |
| 4822 | 0 \ |
| 4823 | -S "mbedtls_ssl_handshake returned" \ |
| 4824 | -C "mbedtls_ssl_handshake returned" \ |
| 4825 | -c "Read from server: .* bytes read" |
| 4826 | |
| 4827 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4828 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4829 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4830 | 0 \ |
| 4831 | -S "mbedtls_ssl_handshake returned" \ |
| 4832 | -C "mbedtls_ssl_handshake returned" \ |
| 4833 | -c "Read from server: .* bytes read" |
| 4834 | |
| 4835 | run_test "Event-driven I/O: ticket + resume" \ |
| 4836 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4837 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4838 | 0 \ |
| 4839 | -S "mbedtls_ssl_handshake returned" \ |
| 4840 | -C "mbedtls_ssl_handshake returned" \ |
| 4841 | -c "Read from server: .* bytes read" |
| 4842 | |
| 4843 | run_test "Event-driven I/O: session-id resume" \ |
| 4844 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4845 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4846 | 0 \ |
| 4847 | -S "mbedtls_ssl_handshake returned" \ |
| 4848 | -C "mbedtls_ssl_handshake returned" \ |
| 4849 | -c "Read from server: .* bytes read" |
| 4850 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4851 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4852 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4853 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4854 | 0 \ |
| 4855 | -c "Read from server: .* bytes read" |
| 4856 | |
| 4857 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4858 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4859 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4860 | 0 \ |
| 4861 | -c "Read from server: .* bytes read" |
| 4862 | |
| 4863 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4864 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4865 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4866 | 0 \ |
| 4867 | -c "Read from server: .* bytes read" |
| 4868 | |
| 4869 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4870 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4871 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4872 | 0 \ |
| 4873 | -c "Read from server: .* bytes read" |
| 4874 | |
| 4875 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4876 | "$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] | 4877 | "$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] | 4878 | 0 \ |
| 4879 | -c "Read from server: .* bytes read" |
| 4880 | |
| 4881 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4882 | "$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] | 4883 | "$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] | 4884 | 0 \ |
| 4885 | -c "Read from server: .* bytes read" |
| 4886 | |
| 4887 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4888 | "$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] | 4889 | "$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] | 4890 | 0 \ |
| 4891 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4892 | |
| 4893 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4894 | # During session resumption, the client will send its ApplicationData record |
| 4895 | # within the same datagram as the Finished messages. In this situation, the |
| 4896 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4897 | # because the ApplicationData request has already been queued internally. |
| 4898 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4899 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4900 | "$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] | 4901 | "$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] | 4902 | 0 \ |
| 4903 | -c "Read from server: .* bytes read" |
| 4904 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4905 | # Tests for version negotiation |
| 4906 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4907 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4908 | "$P_SRV" \ |
| 4909 | "$P_CLI" \ |
| 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 | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4913 | -s "Protocol is TLSv1.2" \ |
| 4914 | -c "Protocol is TLSv1.2" |
| 4915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4916 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4917 | "$P_SRV" \ |
| 4918 | "$P_CLI max_version=tls1_1" \ |
| 4919 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4920 | -S "mbedtls_ssl_handshake returned" \ |
| 4921 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4922 | -s "Protocol is TLSv1.1" \ |
| 4923 | -c "Protocol is TLSv1.1" |
| 4924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4925 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4926 | "$P_SRV max_version=tls1_1" \ |
| 4927 | "$P_CLI" \ |
| 4928 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4929 | -S "mbedtls_ssl_handshake returned" \ |
| 4930 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4931 | -s "Protocol is TLSv1.1" \ |
| 4932 | -c "Protocol is TLSv1.1" |
| 4933 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4934 | 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] | 4935 | "$P_SRV max_version=tls1_1" \ |
| 4936 | "$P_CLI max_version=tls1_1" \ |
| 4937 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4938 | -S "mbedtls_ssl_handshake returned" \ |
| 4939 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4940 | -s "Protocol is TLSv1.1" \ |
| 4941 | -c "Protocol is TLSv1.1" |
| 4942 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4943 | 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] | 4944 | "$P_SRV min_version=tls1_1" \ |
| 4945 | "$P_CLI max_version=tls1_1" \ |
| 4946 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4947 | -S "mbedtls_ssl_handshake returned" \ |
| 4948 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4949 | -s "Protocol is TLSv1.1" \ |
| 4950 | -c "Protocol is TLSv1.1" |
| 4951 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4952 | 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] | 4953 | "$P_SRV max_version=tls1_1" \ |
| 4954 | "$P_CLI min_version=tls1_1" \ |
| 4955 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4956 | -S "mbedtls_ssl_handshake returned" \ |
| 4957 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4958 | -s "Protocol is TLSv1.1" \ |
| 4959 | -c "Protocol is TLSv1.1" |
| 4960 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4961 | 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] | 4962 | "$P_SRV max_version=tls1_1" \ |
| 4963 | "$P_CLI min_version=tls1_2" \ |
| 4964 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4965 | -s "mbedtls_ssl_handshake returned" \ |
| 4966 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4967 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 4968 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4969 | 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] | 4970 | "$P_SRV min_version=tls1_2" \ |
| 4971 | "$P_CLI max_version=tls1_1" \ |
| 4972 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4973 | -s "mbedtls_ssl_handshake returned" \ |
| 4974 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4975 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 4976 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4977 | # Tests for ALPN extension |
| 4978 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4979 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4980 | "$P_SRV debug_level=3" \ |
| 4981 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4982 | 0 \ |
| 4983 | -C "client hello, adding alpn extension" \ |
| 4984 | -S "found alpn extension" \ |
| 4985 | -C "got an alert message, type: \\[2:120]" \ |
| 4986 | -S "server hello, adding alpn extension" \ |
| 4987 | -C "found alpn extension " \ |
| 4988 | -C "Application Layer Protocol is" \ |
| 4989 | -S "Application Layer Protocol is" |
| 4990 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4991 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4992 | "$P_SRV debug_level=3" \ |
| 4993 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4994 | 0 \ |
| 4995 | -c "client hello, adding alpn extension" \ |
| 4996 | -s "found alpn extension" \ |
| 4997 | -C "got an alert message, type: \\[2:120]" \ |
| 4998 | -S "server hello, adding alpn extension" \ |
| 4999 | -C "found alpn extension " \ |
| 5000 | -c "Application Layer Protocol is (none)" \ |
| 5001 | -S "Application Layer Protocol is" |
| 5002 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5003 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5004 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5005 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5006 | 0 \ |
| 5007 | -C "client hello, adding alpn extension" \ |
| 5008 | -S "found alpn extension" \ |
| 5009 | -C "got an alert message, type: \\[2:120]" \ |
| 5010 | -S "server hello, adding alpn extension" \ |
| 5011 | -C "found alpn extension " \ |
| 5012 | -C "Application Layer Protocol is" \ |
| 5013 | -s "Application Layer Protocol is (none)" |
| 5014 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5015 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5016 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5017 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5018 | 0 \ |
| 5019 | -c "client hello, adding alpn extension" \ |
| 5020 | -s "found alpn extension" \ |
| 5021 | -C "got an alert message, type: \\[2:120]" \ |
| 5022 | -s "server hello, adding alpn extension" \ |
| 5023 | -c "found alpn extension" \ |
| 5024 | -c "Application Layer Protocol is abc" \ |
| 5025 | -s "Application Layer Protocol is abc" |
| 5026 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5027 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5028 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5029 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5030 | 0 \ |
| 5031 | -c "client hello, adding alpn extension" \ |
| 5032 | -s "found alpn extension" \ |
| 5033 | -C "got an alert message, type: \\[2:120]" \ |
| 5034 | -s "server hello, adding alpn extension" \ |
| 5035 | -c "found alpn extension" \ |
| 5036 | -c "Application Layer Protocol is abc" \ |
| 5037 | -s "Application Layer Protocol is abc" |
| 5038 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5039 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5040 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5041 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5042 | 0 \ |
| 5043 | -c "client hello, adding alpn extension" \ |
| 5044 | -s "found alpn extension" \ |
| 5045 | -C "got an alert message, type: \\[2:120]" \ |
| 5046 | -s "server hello, adding alpn extension" \ |
| 5047 | -c "found alpn extension" \ |
| 5048 | -c "Application Layer Protocol is 1234" \ |
| 5049 | -s "Application Layer Protocol is 1234" |
| 5050 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5051 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5052 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5053 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5054 | 1 \ |
| 5055 | -c "client hello, adding alpn extension" \ |
| 5056 | -s "found alpn extension" \ |
| 5057 | -c "got an alert message, type: \\[2:120]" \ |
| 5058 | -S "server hello, adding alpn extension" \ |
| 5059 | -C "found alpn extension" \ |
| 5060 | -C "Application Layer Protocol is 1234" \ |
| 5061 | -S "Application Layer Protocol is 1234" |
| 5062 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5063 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5064 | # Tests for keyUsage in leaf certificates, part 1: |
| 5065 | # server-side certificate/suite selection |
| 5066 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5067 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5068 | "$P_SRV key_file=data_files/server2.key \ |
| 5069 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5070 | "$P_CLI" \ |
| 5071 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5072 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5073 | |
| 5074 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5075 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5076 | "$P_SRV key_file=data_files/server2.key \ |
| 5077 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5078 | "$P_CLI" \ |
| 5079 | 0 \ |
| 5080 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5081 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5082 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5083 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5084 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5085 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5086 | 1 \ |
| 5087 | -C "Ciphersuite is " |
| 5088 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5089 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5090 | "$P_SRV key_file=data_files/server5.key \ |
| 5091 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5092 | "$P_CLI" \ |
| 5093 | 0 \ |
| 5094 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5095 | |
| 5096 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5097 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5098 | "$P_SRV key_file=data_files/server5.key \ |
| 5099 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5100 | "$P_CLI" \ |
| 5101 | 0 \ |
| 5102 | -c "Ciphersuite is TLS-ECDH-" |
| 5103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5104 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5105 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5106 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5107 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5108 | 1 \ |
| 5109 | -C "Ciphersuite is " |
| 5110 | |
| 5111 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5112 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5113 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5114 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5115 | "$O_SRV -key data_files/server2.key \ |
| 5116 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5117 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5118 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5119 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5120 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5121 | -C "Processing of the Certificate handshake message failed" \ |
| 5122 | -c "Ciphersuite is TLS-" |
| 5123 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5124 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5125 | "$O_SRV -key data_files/server2.key \ |
| 5126 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5127 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5128 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5129 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5130 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5131 | -C "Processing of the Certificate handshake message failed" \ |
| 5132 | -c "Ciphersuite is TLS-" |
| 5133 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5134 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5135 | "$O_SRV -key data_files/server2.key \ |
| 5136 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5137 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5138 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5139 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5140 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5141 | -C "Processing of the Certificate handshake message failed" \ |
| 5142 | -c "Ciphersuite is TLS-" |
| 5143 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5144 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5145 | "$O_SRV -key data_files/server2.key \ |
| 5146 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5147 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5148 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5149 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5150 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5151 | -c "Processing of the Certificate handshake message failed" \ |
| 5152 | -C "Ciphersuite is TLS-" |
| 5153 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5154 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5155 | "$O_SRV -key data_files/server2.key \ |
| 5156 | -cert data_files/server2.ku-ke.crt" \ |
| 5157 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5158 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5159 | 0 \ |
| 5160 | -c "bad certificate (usage extensions)" \ |
| 5161 | -C "Processing of the Certificate handshake message failed" \ |
| 5162 | -c "Ciphersuite is TLS-" \ |
| 5163 | -c "! Usage does not match the keyUsage extension" |
| 5164 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5165 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5166 | "$O_SRV -key data_files/server2.key \ |
| 5167 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5168 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5169 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5170 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5171 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5172 | -C "Processing of the Certificate handshake message failed" \ |
| 5173 | -c "Ciphersuite is TLS-" |
| 5174 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5175 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5176 | "$O_SRV -key data_files/server2.key \ |
| 5177 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5178 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5179 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5180 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5181 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5182 | -c "Processing of the Certificate handshake message failed" \ |
| 5183 | -C "Ciphersuite is TLS-" |
| 5184 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5185 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5186 | "$O_SRV -key data_files/server2.key \ |
| 5187 | -cert data_files/server2.ku-ds.crt" \ |
| 5188 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5189 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5190 | 0 \ |
| 5191 | -c "bad certificate (usage extensions)" \ |
| 5192 | -C "Processing of the Certificate handshake message failed" \ |
| 5193 | -c "Ciphersuite is TLS-" \ |
| 5194 | -c "! Usage does not match the keyUsage extension" |
| 5195 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5196 | # Tests for keyUsage in leaf certificates, part 3: |
| 5197 | # server-side checking of client cert |
| 5198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5199 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5200 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5201 | "$O_CLI -key data_files/server2.key \ |
| 5202 | -cert data_files/server2.ku-ds.crt" \ |
| 5203 | 0 \ |
| 5204 | -S "bad certificate (usage extensions)" \ |
| 5205 | -S "Processing of the Certificate handshake message failed" |
| 5206 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5207 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5208 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5209 | "$O_CLI -key data_files/server2.key \ |
| 5210 | -cert data_files/server2.ku-ke.crt" \ |
| 5211 | 0 \ |
| 5212 | -s "bad certificate (usage extensions)" \ |
| 5213 | -S "Processing of the Certificate handshake message failed" |
| 5214 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5215 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5216 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5217 | "$O_CLI -key data_files/server2.key \ |
| 5218 | -cert data_files/server2.ku-ke.crt" \ |
| 5219 | 1 \ |
| 5220 | -s "bad certificate (usage extensions)" \ |
| 5221 | -s "Processing of the Certificate handshake message failed" |
| 5222 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5223 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5224 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5225 | "$O_CLI -key data_files/server5.key \ |
| 5226 | -cert data_files/server5.ku-ds.crt" \ |
| 5227 | 0 \ |
| 5228 | -S "bad certificate (usage extensions)" \ |
| 5229 | -S "Processing of the Certificate handshake message failed" |
| 5230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5231 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5232 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5233 | "$O_CLI -key data_files/server5.key \ |
| 5234 | -cert data_files/server5.ku-ka.crt" \ |
| 5235 | 0 \ |
| 5236 | -s "bad certificate (usage extensions)" \ |
| 5237 | -S "Processing of the Certificate handshake message failed" |
| 5238 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5239 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5240 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5241 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5242 | "$P_SRV key_file=data_files/server5.key \ |
| 5243 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5244 | "$P_CLI" \ |
| 5245 | 0 |
| 5246 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5247 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5248 | "$P_SRV key_file=data_files/server5.key \ |
| 5249 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5250 | "$P_CLI" \ |
| 5251 | 0 |
| 5252 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5253 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5254 | "$P_SRV key_file=data_files/server5.key \ |
| 5255 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5256 | "$P_CLI" \ |
| 5257 | 0 |
| 5258 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5259 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5260 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5261 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5262 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5263 | 1 |
| 5264 | |
| 5265 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5267 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5268 | "$O_SRV -key data_files/server5.key \ |
| 5269 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5270 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5271 | 0 \ |
| 5272 | -C "bad certificate (usage extensions)" \ |
| 5273 | -C "Processing of the Certificate handshake message failed" \ |
| 5274 | -c "Ciphersuite is TLS-" |
| 5275 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5276 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5277 | "$O_SRV -key data_files/server5.key \ |
| 5278 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5279 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5280 | 0 \ |
| 5281 | -C "bad certificate (usage extensions)" \ |
| 5282 | -C "Processing of the Certificate handshake message failed" \ |
| 5283 | -c "Ciphersuite is TLS-" |
| 5284 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5285 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5286 | "$O_SRV -key data_files/server5.key \ |
| 5287 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5288 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5289 | 0 \ |
| 5290 | -C "bad certificate (usage extensions)" \ |
| 5291 | -C "Processing of the Certificate handshake message failed" \ |
| 5292 | -c "Ciphersuite is TLS-" |
| 5293 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5294 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5295 | "$O_SRV -key data_files/server5.key \ |
| 5296 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5297 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5298 | 1 \ |
| 5299 | -c "bad certificate (usage extensions)" \ |
| 5300 | -c "Processing of the Certificate handshake message failed" \ |
| 5301 | -C "Ciphersuite is TLS-" |
| 5302 | |
| 5303 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5304 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5305 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5306 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5307 | "$O_CLI -key data_files/server5.key \ |
| 5308 | -cert data_files/server5.eku-cli.crt" \ |
| 5309 | 0 \ |
| 5310 | -S "bad certificate (usage extensions)" \ |
| 5311 | -S "Processing of the Certificate handshake message failed" |
| 5312 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5313 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5314 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5315 | "$O_CLI -key data_files/server5.key \ |
| 5316 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5317 | 0 \ |
| 5318 | -S "bad certificate (usage extensions)" \ |
| 5319 | -S "Processing of the Certificate handshake message failed" |
| 5320 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5321 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5322 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5323 | "$O_CLI -key data_files/server5.key \ |
| 5324 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5325 | 0 \ |
| 5326 | -S "bad certificate (usage extensions)" \ |
| 5327 | -S "Processing of the Certificate handshake message failed" |
| 5328 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5329 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5330 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5331 | "$O_CLI -key data_files/server5.key \ |
| 5332 | -cert data_files/server5.eku-cs.crt" \ |
| 5333 | 0 \ |
| 5334 | -s "bad certificate (usage extensions)" \ |
| 5335 | -S "Processing of the Certificate handshake message failed" |
| 5336 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5337 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5338 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5339 | "$O_CLI -key data_files/server5.key \ |
| 5340 | -cert data_files/server5.eku-cs.crt" \ |
| 5341 | 1 \ |
| 5342 | -s "bad certificate (usage extensions)" \ |
| 5343 | -s "Processing of the Certificate handshake message failed" |
| 5344 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5345 | # Tests for DHM parameters loading |
| 5346 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5347 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5348 | "$P_SRV" \ |
| 5349 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5350 | debug_level=3" \ |
| 5351 | 0 \ |
| 5352 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5353 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5354 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5355 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5356 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5357 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5358 | debug_level=3" \ |
| 5359 | 0 \ |
| 5360 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5361 | -c "value of 'DHM: G ' (2 bits)" |
| 5362 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5363 | # Tests for DHM client-side size checking |
| 5364 | |
| 5365 | run_test "DHM size: server default, client default, OK" \ |
| 5366 | "$P_SRV" \ |
| 5367 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5368 | debug_level=1" \ |
| 5369 | 0 \ |
| 5370 | -C "DHM prime too short:" |
| 5371 | |
| 5372 | run_test "DHM size: server default, client 2048, OK" \ |
| 5373 | "$P_SRV" \ |
| 5374 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5375 | debug_level=1 dhmlen=2048" \ |
| 5376 | 0 \ |
| 5377 | -C "DHM prime too short:" |
| 5378 | |
| 5379 | run_test "DHM size: server 1024, client default, OK" \ |
| 5380 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5381 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5382 | debug_level=1" \ |
| 5383 | 0 \ |
| 5384 | -C "DHM prime too short:" |
| 5385 | |
| 5386 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5387 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5388 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5389 | debug_level=1" \ |
| 5390 | 1 \ |
| 5391 | -c "DHM prime too short:" |
| 5392 | |
| 5393 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5394 | "$P_SRV" \ |
| 5395 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5396 | debug_level=1 dhmlen=2049" \ |
| 5397 | 1 \ |
| 5398 | -c "DHM prime too short:" |
| 5399 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5400 | # Tests for PSK callback |
| 5401 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5402 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5403 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5404 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5405 | psk_identity=foo psk=abc123" \ |
| 5406 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5407 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5408 | -S "SSL - Unknown identity received" \ |
| 5409 | -S "SSL - Verification of the message MAC failed" |
| 5410 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5411 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5412 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5413 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5414 | "$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] | 5415 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5416 | 0 \ |
| 5417 | -c "skip PMS generation for opaque PSK"\ |
| 5418 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5419 | -C "session hash for extended master secret"\ |
| 5420 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5421 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5422 | -S "SSL - Unknown identity received" \ |
| 5423 | -S "SSL - Verification of the message MAC failed" |
| 5424 | |
| 5425 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5426 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5427 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5428 | "$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] | 5429 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5430 | 0 \ |
| 5431 | -c "skip PMS generation for opaque PSK"\ |
| 5432 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5433 | -C "session hash for extended master secret"\ |
| 5434 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5435 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5436 | -S "SSL - Unknown identity received" \ |
| 5437 | -S "SSL - Verification of the message MAC failed" |
| 5438 | |
| 5439 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5440 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5441 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5442 | "$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] | 5443 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5444 | 0 \ |
| 5445 | -c "skip PMS generation for opaque PSK"\ |
| 5446 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5447 | -c "session hash for extended master secret"\ |
| 5448 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5449 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5450 | -S "SSL - Unknown identity received" \ |
| 5451 | -S "SSL - Verification of the message MAC failed" |
| 5452 | |
| 5453 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5454 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5455 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5456 | "$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] | 5457 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5458 | 0 \ |
| 5459 | -c "skip PMS generation for opaque PSK"\ |
| 5460 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5461 | -c "session hash for extended master secret"\ |
| 5462 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5463 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5464 | -S "SSL - Unknown identity received" \ |
| 5465 | -S "SSL - Verification of the message MAC failed" |
| 5466 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5467 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5468 | 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] | 5469 | "$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] | 5470 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5471 | psk_identity=foo psk=abc123" \ |
| 5472 | 0 \ |
| 5473 | -C "skip PMS generation for opaque PSK"\ |
| 5474 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5475 | -C "session hash for extended master secret"\ |
| 5476 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5477 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5478 | -S "SSL - Unknown identity received" \ |
| 5479 | -S "SSL - Verification of the message MAC failed" |
| 5480 | |
| 5481 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5482 | 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] | 5483 | "$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] | 5484 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5485 | psk_identity=foo psk=abc123" \ |
| 5486 | 0 \ |
| 5487 | -C "skip PMS generation for opaque PSK"\ |
| 5488 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5489 | -C "session hash for extended master secret"\ |
| 5490 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5491 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5492 | -S "SSL - Unknown identity received" \ |
| 5493 | -S "SSL - Verification of the message MAC failed" |
| 5494 | |
| 5495 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5496 | 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] | 5497 | "$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] | 5498 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5499 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5500 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5501 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5502 | -c "session hash for extended master secret"\ |
| 5503 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5504 | -C "skip PMS generation for opaque PSK"\ |
| 5505 | -s "skip PMS generation for opaque PSK"\ |
| 5506 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5507 | -S "SSL - Unknown identity received" \ |
| 5508 | -S "SSL - Verification of the message MAC failed" |
| 5509 | |
| 5510 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5511 | 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] | 5512 | "$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] | 5513 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5514 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5515 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5516 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5517 | -c "session hash for extended master secret"\ |
| 5518 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5519 | -C "skip PMS generation for opaque PSK"\ |
| 5520 | -s "skip PMS generation for opaque PSK"\ |
| 5521 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5522 | -S "SSL - Unknown identity received" \ |
| 5523 | -S "SSL - Verification of the message MAC failed" |
| 5524 | |
| 5525 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5526 | 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] | 5527 | "$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] | 5528 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5529 | psk_identity=def psk=beef" \ |
| 5530 | 0 \ |
| 5531 | -C "skip PMS generation for opaque PSK"\ |
| 5532 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5533 | -C "session hash for extended master secret"\ |
| 5534 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5535 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5536 | -S "SSL - Unknown identity received" \ |
| 5537 | -S "SSL - Verification of the message MAC failed" |
| 5538 | |
| 5539 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5540 | 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] | 5541 | "$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] | 5542 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5543 | psk_identity=def psk=beef" \ |
| 5544 | 0 \ |
| 5545 | -C "skip PMS generation for opaque PSK"\ |
| 5546 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5547 | -C "session hash for extended master secret"\ |
| 5548 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5549 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5550 | -S "SSL - Unknown identity received" \ |
| 5551 | -S "SSL - Verification of the message MAC failed" |
| 5552 | |
| 5553 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5554 | 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] | 5555 | "$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] | 5556 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5557 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5558 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5559 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5560 | -c "session hash for extended master secret"\ |
| 5561 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5562 | -C "skip PMS generation for opaque PSK"\ |
| 5563 | -s "skip PMS generation for opaque PSK"\ |
| 5564 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5565 | -S "SSL - Unknown identity received" \ |
| 5566 | -S "SSL - Verification of the message MAC failed" |
| 5567 | |
| 5568 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5569 | 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] | 5570 | "$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] | 5571 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5572 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5573 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5574 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5575 | -c "session hash for extended master secret"\ |
| 5576 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5577 | -C "skip PMS generation for opaque PSK"\ |
| 5578 | -s "skip PMS generation for opaque PSK"\ |
| 5579 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5580 | -S "SSL - Unknown identity received" \ |
| 5581 | -S "SSL - Verification of the message MAC failed" |
| 5582 | |
| 5583 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5584 | 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] | 5585 | "$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] | 5586 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5587 | psk_identity=def psk=beef" \ |
| 5588 | 0 \ |
| 5589 | -C "skip PMS generation for opaque PSK"\ |
| 5590 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5591 | -C "session hash for extended master secret"\ |
| 5592 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5593 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5594 | -S "SSL - Unknown identity received" \ |
| 5595 | -S "SSL - Verification of the message MAC failed" |
| 5596 | |
| 5597 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5598 | 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] | 5599 | "$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] | 5600 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5601 | psk_identity=def psk=beef" \ |
| 5602 | 0 \ |
| 5603 | -C "skip PMS generation for opaque PSK"\ |
| 5604 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5605 | -C "session hash for extended master secret"\ |
| 5606 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5607 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5608 | -S "SSL - Unknown identity received" \ |
| 5609 | -S "SSL - Verification of the message MAC failed" |
| 5610 | |
| 5611 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5612 | 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] | 5613 | "$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] | 5614 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5615 | psk_identity=def psk=beef" \ |
| 5616 | 0 \ |
| 5617 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5618 | -C "session hash for extended master secret"\ |
| 5619 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5620 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5621 | -S "SSL - Unknown identity received" \ |
| 5622 | -S "SSL - Verification of the message MAC failed" |
| 5623 | |
| 5624 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5625 | 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] | 5626 | "$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] | 5627 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5628 | psk_identity=def psk=beef" \ |
| 5629 | 0 \ |
| 5630 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5631 | -C "session hash for extended master secret"\ |
| 5632 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5633 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5634 | -S "SSL - Unknown identity received" \ |
| 5635 | -S "SSL - Verification of the message MAC failed" |
| 5636 | |
| 5637 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5638 | 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] | 5639 | "$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] | 5640 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5641 | psk_identity=def psk=beef" \ |
| 5642 | 1 \ |
| 5643 | -s "SSL - Verification of the message MAC failed" |
| 5644 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5645 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5646 | "$P_SRV" \ |
| 5647 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5648 | psk_identity=foo psk=abc123" \ |
| 5649 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5650 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5651 | -S "SSL - Unknown identity received" \ |
| 5652 | -S "SSL - Verification of the message MAC failed" |
| 5653 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5654 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5655 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5656 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5657 | psk_identity=foo psk=abc123" \ |
| 5658 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5659 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5660 | -s "SSL - Unknown identity received" \ |
| 5661 | -S "SSL - Verification of the message MAC failed" |
| 5662 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5663 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5664 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5665 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5666 | psk_identity=abc psk=dead" \ |
| 5667 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5668 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5669 | -S "SSL - Unknown identity received" \ |
| 5670 | -S "SSL - Verification of the message MAC failed" |
| 5671 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5672 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5673 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5674 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5675 | psk_identity=def psk=beef" \ |
| 5676 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5677 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5678 | -S "SSL - Unknown identity received" \ |
| 5679 | -S "SSL - Verification of the message MAC failed" |
| 5680 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5681 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5682 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5683 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5684 | psk_identity=ghi psk=beef" \ |
| 5685 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5686 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5687 | -s "SSL - Unknown identity received" \ |
| 5688 | -S "SSL - Verification of the message MAC failed" |
| 5689 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5690 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5691 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5692 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5693 | psk_identity=abc psk=beef" \ |
| 5694 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5695 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5696 | -S "SSL - Unknown identity received" \ |
| 5697 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5698 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5699 | # Tests for EC J-PAKE |
| 5700 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5701 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5702 | run_test "ECJPAKE: client not configured" \ |
| 5703 | "$P_SRV debug_level=3" \ |
| 5704 | "$P_CLI debug_level=3" \ |
| 5705 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5706 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5707 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5708 | -S "found ecjpake kkpp extension" \ |
| 5709 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5710 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5711 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5712 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5713 | -S "None of the common ciphersuites is usable" |
| 5714 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5715 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5716 | run_test "ECJPAKE: server not configured" \ |
| 5717 | "$P_SRV debug_level=3" \ |
| 5718 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5719 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5720 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5721 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5722 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5723 | -s "found ecjpake kkpp extension" \ |
| 5724 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5725 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5726 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5727 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5728 | -s "None of the common ciphersuites is usable" |
| 5729 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5730 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5731 | run_test "ECJPAKE: working, TLS" \ |
| 5732 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5733 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5734 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5735 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5736 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5737 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5738 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5739 | -s "found ecjpake kkpp extension" \ |
| 5740 | -S "skip ecjpake kkpp extension" \ |
| 5741 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5742 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5743 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5744 | -S "None of the common ciphersuites is usable" \ |
| 5745 | -S "SSL - Verification of the message MAC failed" |
| 5746 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5747 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5748 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5749 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5750 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5751 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5752 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5753 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5754 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5755 | -s "SSL - Verification of the message MAC failed" |
| 5756 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5757 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5758 | run_test "ECJPAKE: working, DTLS" \ |
| 5759 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5760 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5761 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5762 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5763 | -c "re-using cached ecjpake parameters" \ |
| 5764 | -S "SSL - Verification of the message MAC failed" |
| 5765 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5766 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5767 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5768 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5769 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5770 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5771 | 0 \ |
| 5772 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5773 | -S "SSL - Verification of the message MAC failed" |
| 5774 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5775 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5776 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5777 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5778 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5779 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5780 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5781 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5782 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5783 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5784 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5785 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5786 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5787 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5788 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5789 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5790 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5791 | 0 |
| 5792 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5793 | # Tests for ciphersuites per version |
| 5794 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5796 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5797 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5798 | run_test "Per-version suites: TLS 1.0" \ |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 5799 | "$P_SRV version_suites=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] | 5800 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5801 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5802 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5803 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5804 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5805 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5806 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5807 | run_test "Per-version suites: TLS 1.1" \ |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 5808 | "$P_SRV version_suites=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] | 5809 | "$P_CLI force_version=tls1_1" \ |
| 5810 | 0 \ |
| 5811 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5812 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5814 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5815 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5816 | run_test "Per-version suites: TLS 1.2" \ |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 5817 | "$P_SRV version_suites=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] | 5818 | "$P_CLI force_version=tls1_2" \ |
| 5819 | 0 \ |
| 5820 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5821 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5822 | # Test for ClientHello without extensions |
| 5823 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5824 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5825 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5826 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5827 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5828 | 0 \ |
| 5829 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5830 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5831 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5832 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5833 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5834 | "$P_SRV" \ |
| 5835 | "$P_CLI request_size=100" \ |
| 5836 | 0 \ |
| 5837 | -s "Read from client: 100 bytes read$" |
| 5838 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5839 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5840 | "$P_SRV" \ |
| 5841 | "$P_CLI request_size=500" \ |
| 5842 | 0 \ |
| 5843 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5844 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5845 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5846 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5847 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5848 | "$P_SRV" \ |
| 5849 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5850 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5851 | 0 \ |
| 5852 | -s "Read from client: 1 bytes read" |
| 5853 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5854 | 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] | 5855 | "$P_SRV" \ |
| 5856 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5857 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5858 | 0 \ |
| 5859 | -s "Read from client: 1 bytes read" |
| 5860 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5861 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5862 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5863 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5864 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5865 | 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] | 5866 | 0 \ |
| 5867 | -s "Read from client: 1 bytes read" |
| 5868 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5869 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5870 | 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] | 5871 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5872 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5873 | 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] | 5874 | 0 \ |
| 5875 | -s "Read from client: 1 bytes read" |
| 5876 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5877 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5878 | "$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] | 5879 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5880 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5881 | 0 \ |
| 5882 | -s "Read from client: 1 bytes read" |
| 5883 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5884 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5885 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5886 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5887 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5888 | 0 \ |
| 5889 | -s "Read from client: 1 bytes read" |
| 5890 | |
| 5891 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5892 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5893 | "$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] | 5894 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5895 | 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] | 5896 | 0 \ |
| 5897 | -s "Read from client: 1 bytes read" |
| 5898 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5899 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5900 | 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] | 5901 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5902 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5903 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5904 | 0 \ |
| 5905 | -s "Read from client: 1 bytes read" |
| 5906 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5907 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5908 | "$P_SRV" \ |
| 5909 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5910 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5911 | 0 \ |
| 5912 | -s "Read from client: 1 bytes read" |
| 5913 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5914 | 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] | 5915 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5916 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5917 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5918 | 0 \ |
| 5919 | -s "Read from client: 1 bytes read" |
| 5920 | |
| 5921 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5922 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5923 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5924 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5925 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5926 | 0 \ |
| 5927 | -s "Read from client: 1 bytes read" |
| 5928 | |
| 5929 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5930 | 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] | 5931 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5932 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5933 | 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] | 5934 | 0 \ |
| 5935 | -s "Read from client: 1 bytes read" |
| 5936 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5937 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5938 | "$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] | 5939 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5940 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5941 | 0 \ |
| 5942 | -s "Read from client: 1 bytes read" |
| 5943 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5944 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5945 | "$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] | 5946 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5947 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5948 | 0 \ |
| 5949 | -s "Read from client: 1 bytes read" |
| 5950 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5951 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5952 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5953 | "$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] | 5954 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5955 | 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] | 5956 | 0 \ |
| 5957 | -s "Read from client: 1 bytes read" |
| 5958 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5959 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5960 | 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] | 5961 | "$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] | 5962 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5963 | 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] | 5964 | 0 \ |
| 5965 | -s "Read from client: 1 bytes read" |
| 5966 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5967 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5968 | "$P_SRV" \ |
| 5969 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5970 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5971 | 0 \ |
| 5972 | -s "Read from client: 1 bytes read" |
| 5973 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5974 | 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] | 5975 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5976 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5977 | 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] | 5978 | 0 \ |
| 5979 | -s "Read from client: 1 bytes read" |
| 5980 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5981 | 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] | 5982 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5983 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5984 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5985 | 0 \ |
| 5986 | -s "Read from client: 1 bytes read" |
| 5987 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5988 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5989 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5990 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5991 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5992 | 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] | 5993 | 0 \ |
| 5994 | -s "Read from client: 1 bytes read" |
| 5995 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5996 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5997 | 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] | 5998 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5999 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6000 | 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] | 6001 | 0 \ |
| 6002 | -s "Read from client: 1 bytes read" |
| 6003 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6004 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6005 | "$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] | 6006 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6007 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6008 | 0 \ |
| 6009 | -s "Read from client: 1 bytes read" |
| 6010 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6011 | 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] | 6012 | "$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] | 6013 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6014 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6015 | 0 \ |
| 6016 | -s "Read from client: 1 bytes read" |
| 6017 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6018 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6019 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6020 | "$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] | 6021 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6022 | 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] | 6023 | 0 \ |
| 6024 | -s "Read from client: 1 bytes read" |
| 6025 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6026 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6027 | 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] | 6028 | "$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] | 6029 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6030 | 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] | 6031 | 0 \ |
| 6032 | -s "Read from client: 1 bytes read" |
| 6033 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6034 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6035 | "$P_SRV" \ |
| 6036 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6037 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6038 | 0 \ |
| 6039 | -s "Read from client: 1 bytes read" |
| 6040 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6041 | 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] | 6042 | "$P_SRV" \ |
| 6043 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6044 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6045 | 0 \ |
| 6046 | -s "Read from client: 1 bytes read" |
| 6047 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6048 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6049 | |
| 6050 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6051 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6052 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6053 | "$P_CLI dtls=1 request_size=1 \ |
| 6054 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6055 | 0 \ |
| 6056 | -s "Read from client: 1 bytes read" |
| 6057 | |
| 6058 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6059 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6060 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6061 | "$P_CLI dtls=1 request_size=1 \ |
| 6062 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6063 | 0 \ |
| 6064 | -s "Read from client: 1 bytes read" |
| 6065 | |
| 6066 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6067 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6068 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6069 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6070 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6071 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6072 | 0 \ |
| 6073 | -s "Read from client: 1 bytes read" |
| 6074 | |
| 6075 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6076 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6077 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6078 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6079 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6080 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6081 | 0 \ |
| 6082 | -s "Read from client: 1 bytes read" |
| 6083 | |
| 6084 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6085 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6086 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 6087 | "$P_CLI dtls=1 request_size=1 \ |
| 6088 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6089 | 0 \ |
| 6090 | -s "Read from client: 1 bytes read" |
| 6091 | |
| 6092 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6093 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6094 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6095 | "$P_CLI dtls=1 request_size=1 \ |
| 6096 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6097 | 0 \ |
| 6098 | -s "Read from client: 1 bytes read" |
| 6099 | |
| 6100 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6101 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6102 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6103 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6104 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6105 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6106 | 0 \ |
| 6107 | -s "Read from client: 1 bytes read" |
| 6108 | |
| 6109 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6110 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6111 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6112 | "$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] | 6113 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6114 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6115 | 0 \ |
| 6116 | -s "Read from client: 1 bytes read" |
| 6117 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6118 | # Tests for small server packets |
| 6119 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6120 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6121 | "$P_SRV response_size=1" \ |
| 6122 | "$P_CLI force_version=tls1 \ |
| 6123 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6124 | 0 \ |
| 6125 | -c "Read from server: 1 bytes read" |
| 6126 | |
| 6127 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6128 | "$P_SRV response_size=1" \ |
| 6129 | "$P_CLI force_version=tls1 etm=0 \ |
| 6130 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6131 | 0 \ |
| 6132 | -c "Read from server: 1 bytes read" |
| 6133 | |
| 6134 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6135 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6136 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6137 | "$P_CLI force_version=tls1 \ |
| 6138 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6139 | 0 \ |
| 6140 | -c "Read from server: 1 bytes read" |
| 6141 | |
| 6142 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6143 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6144 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6145 | "$P_CLI force_version=tls1 \ |
| 6146 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6147 | 0 \ |
| 6148 | -c "Read from server: 1 bytes read" |
| 6149 | |
| 6150 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6151 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6152 | "$P_CLI force_version=tls1 \ |
| 6153 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6154 | 0 \ |
| 6155 | -c "Read from server: 1 bytes read" |
| 6156 | |
| 6157 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6158 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6159 | "$P_CLI force_version=tls1 \ |
| 6160 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6161 | 0 \ |
| 6162 | -c "Read from server: 1 bytes read" |
| 6163 | |
| 6164 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6165 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6166 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6167 | "$P_CLI force_version=tls1 \ |
| 6168 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6169 | 0 \ |
| 6170 | -c "Read from server: 1 bytes read" |
| 6171 | |
| 6172 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6173 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6174 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6175 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6176 | trunc_hmac=1 etm=0" \ |
| 6177 | 0 \ |
| 6178 | -c "Read from server: 1 bytes read" |
| 6179 | |
| 6180 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6181 | "$P_SRV response_size=1" \ |
| 6182 | "$P_CLI force_version=tls1_1 \ |
| 6183 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6184 | 0 \ |
| 6185 | -c "Read from server: 1 bytes read" |
| 6186 | |
| 6187 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6188 | "$P_SRV response_size=1" \ |
| 6189 | "$P_CLI force_version=tls1_1 \ |
| 6190 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6191 | 0 \ |
| 6192 | -c "Read from server: 1 bytes read" |
| 6193 | |
| 6194 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6195 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6196 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6197 | "$P_CLI force_version=tls1_1 \ |
| 6198 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6199 | 0 \ |
| 6200 | -c "Read from server: 1 bytes read" |
| 6201 | |
| 6202 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6203 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6204 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6205 | "$P_CLI force_version=tls1_1 \ |
| 6206 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6207 | 0 \ |
| 6208 | -c "Read from server: 1 bytes read" |
| 6209 | |
| 6210 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6211 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6212 | "$P_CLI force_version=tls1_1 \ |
| 6213 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6214 | 0 \ |
| 6215 | -c "Read from server: 1 bytes read" |
| 6216 | |
| 6217 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6218 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6219 | "$P_CLI force_version=tls1_1 \ |
| 6220 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6221 | 0 \ |
| 6222 | -c "Read from server: 1 bytes read" |
| 6223 | |
| 6224 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6225 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6226 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6227 | "$P_CLI force_version=tls1_1 \ |
| 6228 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6229 | 0 \ |
| 6230 | -c "Read from server: 1 bytes read" |
| 6231 | |
| 6232 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6233 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6234 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6235 | "$P_CLI force_version=tls1_1 \ |
| 6236 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6237 | 0 \ |
| 6238 | -c "Read from server: 1 bytes read" |
| 6239 | |
| 6240 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6241 | "$P_SRV response_size=1" \ |
| 6242 | "$P_CLI force_version=tls1_2 \ |
| 6243 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6244 | 0 \ |
| 6245 | -c "Read from server: 1 bytes read" |
| 6246 | |
| 6247 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6248 | "$P_SRV response_size=1" \ |
| 6249 | "$P_CLI force_version=tls1_2 \ |
| 6250 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6251 | 0 \ |
| 6252 | -c "Read from server: 1 bytes read" |
| 6253 | |
| 6254 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6255 | "$P_SRV response_size=1" \ |
| 6256 | "$P_CLI force_version=tls1_2 \ |
| 6257 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6258 | 0 \ |
| 6259 | -c "Read from server: 1 bytes read" |
| 6260 | |
| 6261 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6262 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6263 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6264 | "$P_CLI force_version=tls1_2 \ |
| 6265 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6266 | 0 \ |
| 6267 | -c "Read from server: 1 bytes read" |
| 6268 | |
| 6269 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6270 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6271 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6272 | "$P_CLI force_version=tls1_2 \ |
| 6273 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6274 | 0 \ |
| 6275 | -c "Read from server: 1 bytes read" |
| 6276 | |
| 6277 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6278 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6279 | "$P_CLI force_version=tls1_2 \ |
| 6280 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6281 | 0 \ |
| 6282 | -c "Read from server: 1 bytes read" |
| 6283 | |
| 6284 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6285 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6286 | "$P_CLI force_version=tls1_2 \ |
| 6287 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6288 | 0 \ |
| 6289 | -c "Read from server: 1 bytes read" |
| 6290 | |
| 6291 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6292 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6293 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6294 | "$P_CLI force_version=tls1_2 \ |
| 6295 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6296 | 0 \ |
| 6297 | -c "Read from server: 1 bytes read" |
| 6298 | |
| 6299 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6300 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6301 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6302 | "$P_CLI force_version=tls1_2 \ |
| 6303 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6304 | 0 \ |
| 6305 | -c "Read from server: 1 bytes read" |
| 6306 | |
| 6307 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6308 | "$P_SRV response_size=1" \ |
| 6309 | "$P_CLI force_version=tls1_2 \ |
| 6310 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6311 | 0 \ |
| 6312 | -c "Read from server: 1 bytes read" |
| 6313 | |
| 6314 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6315 | "$P_SRV response_size=1" \ |
| 6316 | "$P_CLI force_version=tls1_2 \ |
| 6317 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6318 | 0 \ |
| 6319 | -c "Read from server: 1 bytes read" |
| 6320 | |
| 6321 | # Tests for small server packets in DTLS |
| 6322 | |
| 6323 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6324 | run_test "Small server packet DTLS 1.0" \ |
| 6325 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6326 | "$P_CLI dtls=1 \ |
| 6327 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6328 | 0 \ |
| 6329 | -c "Read from server: 1 bytes read" |
| 6330 | |
| 6331 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6332 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6333 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6334 | "$P_CLI dtls=1 \ |
| 6335 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6336 | 0 \ |
| 6337 | -c "Read from server: 1 bytes read" |
| 6338 | |
| 6339 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6340 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6341 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6342 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6343 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6344 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6345 | 0 \ |
| 6346 | -c "Read from server: 1 bytes read" |
| 6347 | |
| 6348 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6349 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6350 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6351 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6352 | "$P_CLI dtls=1 \ |
| 6353 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6354 | 0 \ |
| 6355 | -c "Read from server: 1 bytes read" |
| 6356 | |
| 6357 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6358 | run_test "Small server packet DTLS 1.2" \ |
| 6359 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6360 | "$P_CLI dtls=1 \ |
| 6361 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6362 | 0 \ |
| 6363 | -c "Read from server: 1 bytes read" |
| 6364 | |
| 6365 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6366 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6367 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6368 | "$P_CLI dtls=1 \ |
| 6369 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6370 | 0 \ |
| 6371 | -c "Read from server: 1 bytes read" |
| 6372 | |
| 6373 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6374 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6375 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6376 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6377 | "$P_CLI dtls=1 \ |
| 6378 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6379 | 0 \ |
| 6380 | -c "Read from server: 1 bytes read" |
| 6381 | |
| 6382 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6383 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6384 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6385 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6386 | "$P_CLI dtls=1 \ |
| 6387 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6388 | 0 \ |
| 6389 | -c "Read from server: 1 bytes read" |
| 6390 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6391 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6392 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6393 | # How many fragments do we expect to write $1 bytes? |
| 6394 | fragments_for_write() { |
| 6395 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6396 | } |
| 6397 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6398 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6399 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6400 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6401 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6402 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6403 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6404 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6405 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6406 | 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] | 6407 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6408 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6409 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6410 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6411 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6412 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6414 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6415 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6416 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6417 | 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] | 6418 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6419 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6420 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6421 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6422 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6423 | 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] | 6424 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6425 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6426 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6427 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6428 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6429 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6430 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6431 | "$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] | 6432 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6433 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6434 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6435 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6436 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6437 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6438 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6439 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6440 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6441 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6442 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6443 | |
| 6444 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6445 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6446 | "$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] | 6447 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6448 | 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] | 6449 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6450 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6451 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6452 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6453 | 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] | 6454 | "$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] | 6455 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6456 | 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] | 6457 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6458 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6459 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6460 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6461 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6462 | "$P_SRV" \ |
| 6463 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6464 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6465 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6466 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6467 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6468 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6469 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6470 | "$P_SRV" \ |
| 6471 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6472 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6473 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6474 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6475 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6476 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6477 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6478 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6479 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6480 | 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] | 6481 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6482 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6483 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6484 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6485 | 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] | 6486 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6487 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6488 | 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] | 6489 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6490 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6491 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6492 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6493 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6494 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6495 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6496 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6497 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6498 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6499 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6500 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6501 | "$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] | 6502 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6503 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6504 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6505 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6506 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6507 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6508 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6509 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6510 | "$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] | 6511 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6512 | 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] | 6513 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6514 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6515 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6516 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6517 | 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] | 6518 | "$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] | 6519 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6520 | 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] | 6521 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6522 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6523 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6524 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6525 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6526 | "$P_SRV" \ |
| 6527 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6528 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6529 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6530 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6531 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6532 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6533 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6534 | "$P_SRV" \ |
| 6535 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6536 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6537 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6538 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6539 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6540 | 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] | 6541 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6542 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6543 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6544 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6545 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6546 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6547 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6548 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6549 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6550 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6551 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6552 | 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] | 6553 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6554 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6555 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6556 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6557 | 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] | 6558 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6559 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6560 | 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] | 6561 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6562 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6563 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6564 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6565 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6566 | "$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] | 6567 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6568 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6569 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6570 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6571 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6572 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6573 | 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] | 6574 | "$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] | 6575 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6576 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6577 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6578 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6579 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6580 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6581 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6582 | "$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] | 6583 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6584 | 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] | 6585 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6586 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6587 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6588 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6589 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6590 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6591 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6592 | 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] | 6593 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6594 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6595 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6596 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6597 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6598 | "$P_SRV" \ |
| 6599 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6600 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6601 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6602 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6603 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6604 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6605 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6606 | "$P_SRV" \ |
| 6607 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6608 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6609 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6610 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6611 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6612 | |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 6613 | # Checking next 3 tests logs for 1n-1 split against BEAST too |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6614 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6615 | "$P_SRV response_size=16384" \ |
| 6616 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6617 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6618 | 0 \ |
| 6619 | -c "Read from server: 1 bytes read"\ |
| 6620 | -c "16383 bytes read"\ |
| 6621 | -C "Read from server: 16384 bytes read" |
| 6622 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6623 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6624 | "$P_SRV response_size=16384" \ |
| 6625 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6626 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6627 | 0 \ |
| 6628 | -c "Read from server: 1 bytes read"\ |
| 6629 | -c "16383 bytes read"\ |
| 6630 | -C "Read from server: 16384 bytes read" |
| 6631 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6632 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6633 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6634 | "$P_SRV response_size=16384" \ |
| 6635 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6636 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6637 | trunc_hmac=1" \ |
| 6638 | 0 \ |
| 6639 | -c "Read from server: 1 bytes read"\ |
| 6640 | -c "16383 bytes read"\ |
| 6641 | -C "Read from server: 16384 bytes read" |
| 6642 | |
| 6643 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6644 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6645 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6646 | "$P_CLI force_version=tls1 \ |
| 6647 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6648 | trunc_hmac=1" \ |
| 6649 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6650 | -s "16384 bytes written in 1 fragments" \ |
| 6651 | -c "Read from server: 16384 bytes read" |
| 6652 | |
| 6653 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6654 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6655 | "$P_CLI force_version=tls1 \ |
| 6656 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6657 | 0 \ |
| 6658 | -s "16384 bytes written in 1 fragments" \ |
| 6659 | -c "Read from server: 16384 bytes read" |
| 6660 | |
| 6661 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6662 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6663 | "$P_CLI force_version=tls1 \ |
| 6664 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6665 | 0 \ |
| 6666 | -s "16384 bytes written in 1 fragments" \ |
| 6667 | -c "Read from server: 16384 bytes read" |
| 6668 | |
| 6669 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6670 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6671 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6672 | "$P_CLI force_version=tls1 \ |
| 6673 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6674 | 0 \ |
| 6675 | -s "16384 bytes written in 1 fragments" \ |
| 6676 | -c "Read from server: 16384 bytes read" |
| 6677 | |
| 6678 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6679 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6680 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6681 | "$P_CLI force_version=tls1 \ |
| 6682 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6683 | 0 \ |
| 6684 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6685 | -c "Read from server: 16384 bytes read" |
| 6686 | |
| 6687 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6688 | "$P_SRV response_size=16384" \ |
| 6689 | "$P_CLI force_version=tls1_1 \ |
| 6690 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6691 | 0 \ |
| 6692 | -c "Read from server: 16384 bytes read" |
| 6693 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6694 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6695 | "$P_SRV response_size=16384" \ |
| 6696 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6697 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6698 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6699 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6700 | -c "Read from server: 16384 bytes read" |
| 6701 | |
| 6702 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6703 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6704 | "$P_SRV response_size=16384" \ |
| 6705 | "$P_CLI force_version=tls1_1 \ |
| 6706 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6707 | trunc_hmac=1" \ |
| 6708 | 0 \ |
| 6709 | -c "Read from server: 16384 bytes read" |
| 6710 | |
| 6711 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6712 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6713 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6714 | "$P_CLI force_version=tls1_1 \ |
| 6715 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6716 | 0 \ |
| 6717 | -s "16384 bytes written in 1 fragments" \ |
| 6718 | -c "Read from server: 16384 bytes read" |
| 6719 | |
| 6720 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6721 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6722 | "$P_CLI force_version=tls1_1 \ |
| 6723 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6724 | 0 \ |
| 6725 | -c "Read from server: 16384 bytes read" |
| 6726 | |
| 6727 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6728 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6729 | "$P_CLI force_version=tls1_1 \ |
| 6730 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6731 | 0 \ |
| 6732 | -s "16384 bytes written in 1 fragments" \ |
| 6733 | -c "Read from server: 16384 bytes read" |
| 6734 | |
| 6735 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6736 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 6737 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6738 | "$P_CLI force_version=tls1_1 \ |
| 6739 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6740 | trunc_hmac=1" \ |
| 6741 | 0 \ |
| 6742 | -c "Read from server: 16384 bytes read" |
| 6743 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6744 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6745 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6746 | "$P_CLI force_version=tls1_1 \ |
| 6747 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6748 | 0 \ |
| 6749 | -s "16384 bytes written in 1 fragments" \ |
| 6750 | -c "Read from server: 16384 bytes read" |
| 6751 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6752 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6753 | "$P_SRV response_size=16384" \ |
| 6754 | "$P_CLI force_version=tls1_2 \ |
| 6755 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6756 | 0 \ |
| 6757 | -c "Read from server: 16384 bytes read" |
| 6758 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6759 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6760 | "$P_SRV response_size=16384" \ |
| 6761 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6762 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6763 | 0 \ |
| 6764 | -s "16384 bytes written in 1 fragments" \ |
| 6765 | -c "Read from server: 16384 bytes read" |
| 6766 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6767 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6768 | "$P_SRV response_size=16384" \ |
| 6769 | "$P_CLI force_version=tls1_2 \ |
| 6770 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6771 | 0 \ |
| 6772 | -c "Read from server: 16384 bytes read" |
| 6773 | |
| 6774 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6775 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6776 | "$P_SRV response_size=16384" \ |
| 6777 | "$P_CLI force_version=tls1_2 \ |
| 6778 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6779 | trunc_hmac=1" \ |
| 6780 | 0 \ |
| 6781 | -c "Read from server: 16384 bytes read" |
| 6782 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6783 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6784 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6785 | "$P_CLI force_version=tls1_2 \ |
| 6786 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6787 | 0 \ |
| 6788 | -s "16384 bytes written in 1 fragments" \ |
| 6789 | -c "Read from server: 16384 bytes read" |
| 6790 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6791 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 6792 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6793 | "$P_CLI force_version=tls1_2 \ |
| 6794 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6795 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6796 | -s "16384 bytes written in 1 fragments" \ |
| 6797 | -c "Read from server: 16384 bytes read" |
| 6798 | |
| 6799 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6800 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6801 | "$P_CLI force_version=tls1_2 \ |
| 6802 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6803 | 0 \ |
| 6804 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6805 | -c "Read from server: 16384 bytes read" |
| 6806 | |
| 6807 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6808 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 6809 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6810 | "$P_CLI force_version=tls1_2 \ |
| 6811 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6812 | trunc_hmac=1" \ |
| 6813 | 0 \ |
| 6814 | -c "Read from server: 16384 bytes read" |
| 6815 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6816 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6817 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6818 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6819 | "$P_CLI force_version=tls1_2 \ |
| 6820 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6821 | 0 \ |
| 6822 | -s "16384 bytes written in 1 fragments" \ |
| 6823 | -c "Read from server: 16384 bytes read" |
| 6824 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6825 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6826 | "$P_SRV response_size=16384" \ |
| 6827 | "$P_CLI force_version=tls1_2 \ |
| 6828 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6829 | 0 \ |
| 6830 | -c "Read from server: 16384 bytes read" |
| 6831 | |
| 6832 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6833 | "$P_SRV response_size=16384" \ |
| 6834 | "$P_CLI force_version=tls1_2 \ |
| 6835 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6836 | 0 \ |
| 6837 | -c "Read from server: 16384 bytes read" |
| 6838 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6839 | # Tests for restartable ECC |
| 6840 | |
| 6841 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6842 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6843 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6844 | "$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] | 6845 | 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] | 6846 | debug_level=1" \ |
| 6847 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6848 | -C "x509_verify_cert.*4b00" \ |
| 6849 | -C "mbedtls_pk_verify.*4b00" \ |
| 6850 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6851 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6852 | |
| 6853 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6854 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6855 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6856 | "$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] | 6857 | 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] | 6858 | debug_level=1 ec_max_ops=0" \ |
| 6859 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6860 | -C "x509_verify_cert.*4b00" \ |
| 6861 | -C "mbedtls_pk_verify.*4b00" \ |
| 6862 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6863 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6864 | |
| 6865 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6866 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6867 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6868 | "$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] | 6869 | 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] | 6870 | debug_level=1 ec_max_ops=65535" \ |
| 6871 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6872 | -C "x509_verify_cert.*4b00" \ |
| 6873 | -C "mbedtls_pk_verify.*4b00" \ |
| 6874 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6875 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6876 | |
| 6877 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6878 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6879 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6880 | "$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] | 6881 | 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] | 6882 | debug_level=1 ec_max_ops=1000" \ |
| 6883 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6884 | -c "x509_verify_cert.*4b00" \ |
| 6885 | -c "mbedtls_pk_verify.*4b00" \ |
| 6886 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6887 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6888 | |
| 6889 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6890 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 6891 | "$P_SRV auth_mode=required \ |
| 6892 | crt_file=data_files/server5-badsign.crt \ |
| 6893 | key_file=data_files/server5.key" \ |
| 6894 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6895 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6896 | debug_level=1 ec_max_ops=1000" \ |
| 6897 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6898 | -c "x509_verify_cert.*4b00" \ |
| 6899 | -C "mbedtls_pk_verify.*4b00" \ |
| 6900 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6901 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6902 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6903 | -c "! mbedtls_ssl_handshake returned" \ |
| 6904 | -c "X509 - Certificate verification failed" |
| 6905 | |
| 6906 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6907 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 6908 | "$P_SRV auth_mode=required \ |
| 6909 | crt_file=data_files/server5-badsign.crt \ |
| 6910 | key_file=data_files/server5.key" \ |
| 6911 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6912 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6913 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6914 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6915 | -c "x509_verify_cert.*4b00" \ |
| 6916 | -c "mbedtls_pk_verify.*4b00" \ |
| 6917 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6918 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6919 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6920 | -C "! mbedtls_ssl_handshake returned" \ |
| 6921 | -C "X509 - Certificate verification failed" |
| 6922 | |
| 6923 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6924 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6925 | "$P_SRV auth_mode=required \ |
| 6926 | crt_file=data_files/server5-badsign.crt \ |
| 6927 | key_file=data_files/server5.key" \ |
| 6928 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6929 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6930 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6931 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6932 | -C "x509_verify_cert.*4b00" \ |
| 6933 | -c "mbedtls_pk_verify.*4b00" \ |
| 6934 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6935 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6936 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6937 | -C "! mbedtls_ssl_handshake returned" \ |
| 6938 | -C "X509 - Certificate verification failed" |
| 6939 | |
| 6940 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6941 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6942 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6943 | "$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] | 6944 | 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] | 6945 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6946 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6947 | -c "x509_verify_cert.*4b00" \ |
| 6948 | -c "mbedtls_pk_verify.*4b00" \ |
| 6949 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6950 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6951 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6952 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6953 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6954 | "$P_SRV" \ |
| 6955 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6956 | debug_level=1 ec_max_ops=1000" \ |
| 6957 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6958 | -c "x509_verify_cert.*4b00" \ |
| 6959 | -c "mbedtls_pk_verify.*4b00" \ |
| 6960 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6961 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6962 | |
| 6963 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6964 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6965 | "$P_SRV psk=abc123" \ |
| 6966 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6967 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6968 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6969 | -C "x509_verify_cert.*4b00" \ |
| 6970 | -C "mbedtls_pk_verify.*4b00" \ |
| 6971 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6972 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6973 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6974 | # Tests of asynchronous private key support in SSL |
| 6975 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6976 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6977 | run_test "SSL async private: sign, delay=0" \ |
| 6978 | "$P_SRV \ |
| 6979 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6980 | "$P_CLI" \ |
| 6981 | 0 \ |
| 6982 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6983 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6984 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6985 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6986 | run_test "SSL async private: sign, delay=1" \ |
| 6987 | "$P_SRV \ |
| 6988 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6989 | "$P_CLI" \ |
| 6990 | 0 \ |
| 6991 | -s "Async sign callback: using key slot " \ |
| 6992 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6993 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6994 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6995 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6996 | run_test "SSL async private: sign, delay=2" \ |
| 6997 | "$P_SRV \ |
| 6998 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6999 | "$P_CLI" \ |
| 7000 | 0 \ |
| 7001 | -s "Async sign callback: using key slot " \ |
| 7002 | -U "Async sign callback: using key slot " \ |
| 7003 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7004 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7005 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7006 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7007 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7008 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7009 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7011 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7012 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7013 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7014 | "$P_CLI force_version=tls1_1" \ |
| 7015 | 0 \ |
| 7016 | -s "Async sign callback: using key slot " \ |
| 7017 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7018 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7019 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7020 | run_test "SSL async private: sign, SNI" \ |
| 7021 | "$P_SRV debug_level=3 \ |
| 7022 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7023 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7024 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7025 | "$P_CLI server_name=polarssl.example" \ |
| 7026 | 0 \ |
| 7027 | -s "Async sign callback: using key slot " \ |
| 7028 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7029 | -s "parse ServerName extension" \ |
| 7030 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7031 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7032 | |
| 7033 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7034 | run_test "SSL async private: decrypt, delay=0" \ |
| 7035 | "$P_SRV \ |
| 7036 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7037 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7038 | 0 \ |
| 7039 | -s "Async decrypt callback: using key slot " \ |
| 7040 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7041 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7042 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7043 | run_test "SSL async private: decrypt, delay=1" \ |
| 7044 | "$P_SRV \ |
| 7045 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7046 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7047 | 0 \ |
| 7048 | -s "Async decrypt callback: using key slot " \ |
| 7049 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7050 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7051 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7052 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7053 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7054 | "$P_SRV psk=abc123 \ |
| 7055 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7056 | "$P_CLI psk=abc123 \ |
| 7057 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7058 | 0 \ |
| 7059 | -s "Async decrypt callback: using key slot " \ |
| 7060 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7061 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7062 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7063 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7064 | "$P_SRV psk=abc123 \ |
| 7065 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7066 | "$P_CLI psk=abc123 \ |
| 7067 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7068 | 0 \ |
| 7069 | -s "Async decrypt callback: using key slot " \ |
| 7070 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7071 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7072 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7073 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7074 | run_test "SSL async private: sign callback not present" \ |
| 7075 | "$P_SRV \ |
| 7076 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7077 | "$P_CLI; [ \$? -eq 1 ] && |
| 7078 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7079 | 0 \ |
| 7080 | -S "Async sign callback" \ |
| 7081 | -s "! mbedtls_ssl_handshake returned" \ |
| 7082 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7083 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7084 | -s "Successful connection" |
| 7085 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7086 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7087 | run_test "SSL async private: decrypt callback not present" \ |
| 7088 | "$P_SRV debug_level=1 \ |
| 7089 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7090 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7091 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7092 | 0 \ |
| 7093 | -S "Async decrypt callback" \ |
| 7094 | -s "! mbedtls_ssl_handshake returned" \ |
| 7095 | -s "got no RSA private key" \ |
| 7096 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7097 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7098 | |
| 7099 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7100 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7101 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7102 | "$P_SRV \ |
| 7103 | async_operations=s async_private_delay1=1 \ |
| 7104 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7105 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7106 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7107 | 0 \ |
| 7108 | -s "Async sign callback: using key slot 0," \ |
| 7109 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7110 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7111 | |
| 7112 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7113 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7114 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7115 | "$P_SRV \ |
| 7116 | async_operations=s async_private_delay2=1 \ |
| 7117 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7118 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7119 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7120 | 0 \ |
| 7121 | -s "Async sign callback: using key slot 0," \ |
| 7122 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7123 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7124 | |
| 7125 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7126 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7127 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7128 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7129 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7130 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7131 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7132 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7133 | 0 \ |
| 7134 | -s "Async sign callback: using key slot 1," \ |
| 7135 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7136 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7137 | |
| 7138 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7139 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7140 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7141 | "$P_SRV \ |
| 7142 | async_operations=s async_private_delay1=1 \ |
| 7143 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7144 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7145 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7146 | 0 \ |
| 7147 | -s "Async sign callback: no key matches this certificate." |
| 7148 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7149 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7150 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7151 | "$P_SRV \ |
| 7152 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7153 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7154 | "$P_CLI" \ |
| 7155 | 1 \ |
| 7156 | -s "Async sign callback: injected error" \ |
| 7157 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7158 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7159 | -s "! mbedtls_ssl_handshake returned" |
| 7160 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7161 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7162 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7163 | "$P_SRV \ |
| 7164 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7165 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7166 | "$P_CLI" \ |
| 7167 | 1 \ |
| 7168 | -s "Async sign callback: using key slot " \ |
| 7169 | -S "Async resume" \ |
| 7170 | -s "Async cancel" |
| 7171 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7172 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7173 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7174 | "$P_SRV \ |
| 7175 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7176 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7177 | "$P_CLI" \ |
| 7178 | 1 \ |
| 7179 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7180 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7181 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7182 | -s "! mbedtls_ssl_handshake returned" |
| 7183 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7184 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7185 | run_test "SSL async private: decrypt, error in start" \ |
| 7186 | "$P_SRV \ |
| 7187 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7188 | async_private_error=1" \ |
| 7189 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7190 | 1 \ |
| 7191 | -s "Async decrypt callback: injected error" \ |
| 7192 | -S "Async resume" \ |
| 7193 | -S "Async cancel" \ |
| 7194 | -s "! mbedtls_ssl_handshake returned" |
| 7195 | |
| 7196 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7197 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7198 | "$P_SRV \ |
| 7199 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7200 | async_private_error=2" \ |
| 7201 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7202 | 1 \ |
| 7203 | -s "Async decrypt callback: using key slot " \ |
| 7204 | -S "Async resume" \ |
| 7205 | -s "Async cancel" |
| 7206 | |
| 7207 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7208 | run_test "SSL async private: decrypt, error in resume" \ |
| 7209 | "$P_SRV \ |
| 7210 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7211 | async_private_error=3" \ |
| 7212 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7213 | 1 \ |
| 7214 | -s "Async decrypt callback: using key slot " \ |
| 7215 | -s "Async resume callback: decrypt done but injected error" \ |
| 7216 | -S "Async cancel" \ |
| 7217 | -s "! mbedtls_ssl_handshake returned" |
| 7218 | |
| 7219 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7220 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7221 | "$P_SRV \ |
| 7222 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7223 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7224 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7225 | 0 \ |
| 7226 | -s "Async cancel" \ |
| 7227 | -s "! mbedtls_ssl_handshake returned" \ |
| 7228 | -s "Async resume" \ |
| 7229 | -s "Successful connection" |
| 7230 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7231 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7232 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7233 | "$P_SRV \ |
| 7234 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7235 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7236 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7237 | 0 \ |
| 7238 | -s "! mbedtls_ssl_handshake returned" \ |
| 7239 | -s "Async resume" \ |
| 7240 | -s "Successful connection" |
| 7241 | |
| 7242 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7243 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7244 | 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] | 7245 | "$P_SRV \ |
| 7246 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7247 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7248 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7249 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7250 | [ \$? -eq 1 ] && |
| 7251 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7252 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7253 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7254 | -S "Async resume" \ |
| 7255 | -s "Async cancel" \ |
| 7256 | -s "! mbedtls_ssl_handshake returned" \ |
| 7257 | -s "Async sign callback: no key matches this certificate." \ |
| 7258 | -s "Successful connection" |
| 7259 | |
| 7260 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7261 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7262 | 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] | 7263 | "$P_SRV \ |
| 7264 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7265 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7266 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7267 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7268 | [ \$? -eq 1 ] && |
| 7269 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7270 | 0 \ |
| 7271 | -s "Async resume" \ |
| 7272 | -s "! mbedtls_ssl_handshake returned" \ |
| 7273 | -s "Async sign callback: no key matches this certificate." \ |
| 7274 | -s "Successful connection" |
| 7275 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7276 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7277 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7278 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7279 | "$P_SRV \ |
| 7280 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7281 | exchanges=2 renegotiation=1" \ |
| 7282 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7283 | 0 \ |
| 7284 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7285 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7286 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7287 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7288 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7289 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7290 | "$P_SRV \ |
| 7291 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7292 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7293 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7294 | 0 \ |
| 7295 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7296 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7297 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7298 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7299 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7300 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7301 | "$P_SRV \ |
| 7302 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7303 | exchanges=2 renegotiation=1" \ |
| 7304 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7305 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7306 | 0 \ |
| 7307 | -s "Async decrypt callback: using key slot " \ |
| 7308 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7309 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7310 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7312 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7313 | "$P_SRV \ |
| 7314 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7315 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7316 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7317 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7318 | 0 \ |
| 7319 | -s "Async decrypt callback: using key slot " \ |
| 7320 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7321 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7322 | # Tests for ECC extensions (rfc 4492) |
| 7323 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7324 | requires_config_enabled MBEDTLS_AES_C |
| 7325 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7326 | requires_config_enabled MBEDTLS_SHA256_C |
| 7327 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7328 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7329 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7330 | "$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] | 7331 | 0 \ |
| 7332 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7333 | -C "client hello, adding supported_point_formats extension" \ |
| 7334 | -S "found supported elliptic curves extension" \ |
| 7335 | -S "found supported point formats extension" |
| 7336 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7337 | requires_config_enabled MBEDTLS_AES_C |
| 7338 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7339 | requires_config_enabled MBEDTLS_SHA256_C |
| 7340 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7341 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7342 | "$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] | 7343 | "$P_CLI debug_level=3" \ |
| 7344 | 0 \ |
| 7345 | -C "found supported_point_formats extension" \ |
| 7346 | -S "server hello, supported_point_formats extension" |
| 7347 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7348 | requires_config_enabled MBEDTLS_AES_C |
| 7349 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7350 | requires_config_enabled MBEDTLS_SHA256_C |
| 7351 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7352 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7353 | "$P_SRV debug_level=3" \ |
| 7354 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7355 | 0 \ |
| 7356 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7357 | -c "client hello, adding supported_point_formats extension" \ |
| 7358 | -s "found supported elliptic curves extension" \ |
| 7359 | -s "found supported point formats extension" |
| 7360 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7361 | requires_config_enabled MBEDTLS_AES_C |
| 7362 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7363 | requires_config_enabled MBEDTLS_SHA256_C |
| 7364 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7365 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7366 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7367 | "$P_CLI debug_level=3" \ |
| 7368 | 0 \ |
| 7369 | -c "found supported_point_formats extension" \ |
| 7370 | -s "server hello, supported_point_formats extension" |
| 7371 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7372 | # Tests for DTLS HelloVerifyRequest |
| 7373 | |
| 7374 | run_test "DTLS cookie: enabled" \ |
| 7375 | "$P_SRV dtls=1 debug_level=2" \ |
| 7376 | "$P_CLI dtls=1 debug_level=2" \ |
| 7377 | 0 \ |
| 7378 | -s "cookie verification failed" \ |
| 7379 | -s "cookie verification passed" \ |
| 7380 | -S "cookie verification skipped" \ |
| 7381 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7382 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7383 | -S "SSL - The requested feature is not available" |
| 7384 | |
| 7385 | run_test "DTLS cookie: disabled" \ |
| 7386 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7387 | "$P_CLI dtls=1 debug_level=2" \ |
| 7388 | 0 \ |
| 7389 | -S "cookie verification failed" \ |
| 7390 | -S "cookie verification passed" \ |
| 7391 | -s "cookie verification skipped" \ |
| 7392 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7393 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7394 | -S "SSL - The requested feature is not available" |
| 7395 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7396 | run_test "DTLS cookie: default (failing)" \ |
| 7397 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7398 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7399 | 1 \ |
| 7400 | -s "cookie verification failed" \ |
| 7401 | -S "cookie verification passed" \ |
| 7402 | -S "cookie verification skipped" \ |
| 7403 | -C "received hello verify request" \ |
| 7404 | -S "hello verification requested" \ |
| 7405 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7406 | |
| 7407 | requires_ipv6 |
| 7408 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7409 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7410 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7411 | 0 \ |
| 7412 | -s "cookie verification failed" \ |
| 7413 | -s "cookie verification passed" \ |
| 7414 | -S "cookie verification skipped" \ |
| 7415 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7416 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7417 | -S "SSL - The requested feature is not available" |
| 7418 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7419 | run_test "DTLS cookie: enabled, nbio" \ |
| 7420 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7421 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7422 | 0 \ |
| 7423 | -s "cookie verification failed" \ |
| 7424 | -s "cookie verification passed" \ |
| 7425 | -S "cookie verification skipped" \ |
| 7426 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7427 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7428 | -S "SSL - The requested feature is not available" |
| 7429 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7430 | # Tests for client reconnecting from the same port with DTLS |
| 7431 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7432 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7433 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7434 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7435 | "$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] | 7436 | 0 \ |
| 7437 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7438 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7439 | -S "Client initiated reconnection from same port" |
| 7440 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7441 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7442 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7443 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7444 | "$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] | 7445 | 0 \ |
| 7446 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7447 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7448 | -s "Client initiated reconnection from same port" |
| 7449 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7450 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7451 | 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] | 7452 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7453 | "$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] | 7454 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7455 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7456 | -s "Client initiated reconnection from same port" |
| 7457 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7458 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7459 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7460 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7461 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7462 | 0 \ |
| 7463 | -S "The operation timed out" \ |
| 7464 | -s "Client initiated reconnection from same port" |
| 7465 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7466 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7467 | "$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] | 7468 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7469 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7470 | -s "The operation timed out" \ |
| 7471 | -S "Client initiated reconnection from same port" |
| 7472 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7473 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7474 | -p "$P_PXY inject_clihlo=1" \ |
| 7475 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7476 | "$P_CLI dtls=1 exchanges=2" \ |
| 7477 | 0 \ |
| 7478 | -s "possible client reconnect from the same port" \ |
| 7479 | -S "Client initiated reconnection from same port" |
| 7480 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7481 | # Tests for various cases of client authentication with DTLS |
| 7482 | # (focused on handshake flows and message parsing) |
| 7483 | |
| 7484 | run_test "DTLS client auth: required" \ |
| 7485 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7486 | "$P_CLI dtls=1" \ |
| 7487 | 0 \ |
| 7488 | -s "Verifying peer X.509 certificate... ok" |
| 7489 | |
| 7490 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7491 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7492 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7493 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7494 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7495 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7496 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7497 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7498 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7499 | 0 \ |
| 7500 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7501 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7502 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7503 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7504 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7505 | "$P_CLI dtls=1 psk=abc124" \ |
| 7506 | 1 \ |
| 7507 | -s "SSL - Verification of the message MAC failed" \ |
| 7508 | -c "SSL - A fatal alert message was received from our peer" |
| 7509 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7510 | # Tests for receiving fragmented handshake messages with DTLS |
| 7511 | |
| 7512 | requires_gnutls |
| 7513 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7514 | "$G_SRV -u --mtu 2048 -a" \ |
| 7515 | "$P_CLI dtls=1 debug_level=2" \ |
| 7516 | 0 \ |
| 7517 | -C "found fragmented DTLS handshake message" \ |
| 7518 | -C "error" |
| 7519 | |
| 7520 | requires_gnutls |
| 7521 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7522 | "$G_SRV -u --mtu 512" \ |
| 7523 | "$P_CLI dtls=1 debug_level=2" \ |
| 7524 | 0 \ |
| 7525 | -c "found fragmented DTLS handshake message" \ |
| 7526 | -C "error" |
| 7527 | |
| 7528 | requires_gnutls |
| 7529 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7530 | "$G_SRV -u --mtu 128" \ |
| 7531 | "$P_CLI dtls=1 debug_level=2" \ |
| 7532 | 0 \ |
| 7533 | -c "found fragmented DTLS handshake message" \ |
| 7534 | -C "error" |
| 7535 | |
| 7536 | requires_gnutls |
| 7537 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7538 | "$G_SRV -u --mtu 128" \ |
| 7539 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7540 | 0 \ |
| 7541 | -c "found fragmented DTLS handshake message" \ |
| 7542 | -C "error" |
| 7543 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7544 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7545 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7546 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7547 | "$G_SRV -u --mtu 256" \ |
| 7548 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7549 | 0 \ |
| 7550 | -c "found fragmented DTLS handshake message" \ |
| 7551 | -c "client hello, adding renegotiation extension" \ |
| 7552 | -c "found renegotiation extension" \ |
| 7553 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7554 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7555 | -C "error" \ |
| 7556 | -s "Extra-header:" |
| 7557 | |
| 7558 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7559 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7560 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7561 | "$G_SRV -u --mtu 256" \ |
| 7562 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7563 | 0 \ |
| 7564 | -c "found fragmented DTLS handshake message" \ |
| 7565 | -c "client hello, adding renegotiation extension" \ |
| 7566 | -c "found renegotiation extension" \ |
| 7567 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7568 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7569 | -C "error" \ |
| 7570 | -s "Extra-header:" |
| 7571 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7572 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7573 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7574 | "$P_CLI dtls=1 debug_level=2" \ |
| 7575 | 0 \ |
| 7576 | -C "found fragmented DTLS handshake message" \ |
| 7577 | -C "error" |
| 7578 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7579 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7580 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7581 | "$P_CLI dtls=1 debug_level=2" \ |
| 7582 | 0 \ |
| 7583 | -c "found fragmented DTLS handshake message" \ |
| 7584 | -C "error" |
| 7585 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7586 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7587 | "$O_SRV -dtls1 -mtu 256" \ |
| 7588 | "$P_CLI dtls=1 debug_level=2" \ |
| 7589 | 0 \ |
| 7590 | -c "found fragmented DTLS handshake message" \ |
| 7591 | -C "error" |
| 7592 | |
| 7593 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7594 | "$O_SRV -dtls1 -mtu 256" \ |
| 7595 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7596 | 0 \ |
| 7597 | -c "found fragmented DTLS handshake message" \ |
| 7598 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7599 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7600 | # Tests for sending fragmented handshake messages with DTLS |
| 7601 | # |
| 7602 | # Use client auth when we need the client to send large messages, |
| 7603 | # and use large cert chains on both sides too (the long chains we have all use |
| 7604 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7605 | # Sizes reached (UDP payload): |
| 7606 | # - 2037B for server certificate |
| 7607 | # - 1542B for client certificate |
| 7608 | # - 1013B for newsessionticket |
| 7609 | # - all others below 512B |
| 7610 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7611 | |
| 7612 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7613 | requires_config_enabled MBEDTLS_RSA_C |
| 7614 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7615 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7616 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7617 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7618 | crt_file=data_files/server7_int-ca.crt \ |
| 7619 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7620 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7621 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7622 | "$P_CLI dtls=1 debug_level=2 \ |
| 7623 | crt_file=data_files/server8_int-ca2.crt \ |
| 7624 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7625 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7626 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7627 | 0 \ |
| 7628 | -S "found fragmented DTLS handshake message" \ |
| 7629 | -C "found fragmented DTLS handshake message" \ |
| 7630 | -C "error" |
| 7631 | |
| 7632 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7633 | requires_config_enabled MBEDTLS_RSA_C |
| 7634 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7635 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7636 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7637 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7638 | crt_file=data_files/server7_int-ca.crt \ |
| 7639 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7640 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7641 | max_frag_len=1024" \ |
| 7642 | "$P_CLI dtls=1 debug_level=2 \ |
| 7643 | crt_file=data_files/server8_int-ca2.crt \ |
| 7644 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7645 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7646 | max_frag_len=2048" \ |
| 7647 | 0 \ |
| 7648 | -S "found fragmented DTLS handshake message" \ |
| 7649 | -c "found fragmented DTLS handshake message" \ |
| 7650 | -C "error" |
| 7651 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7652 | # With the MFL extension, the server has no way of forcing |
| 7653 | # the client to not exceed a certain MTU; hence, the following |
| 7654 | # test can't be replicated with an MTU proxy such as the one |
| 7655 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7656 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7657 | requires_config_enabled MBEDTLS_RSA_C |
| 7658 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7659 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7660 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7661 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7662 | crt_file=data_files/server7_int-ca.crt \ |
| 7663 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7664 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7665 | max_frag_len=512" \ |
| 7666 | "$P_CLI dtls=1 debug_level=2 \ |
| 7667 | crt_file=data_files/server8_int-ca2.crt \ |
| 7668 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7669 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7670 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7671 | 0 \ |
| 7672 | -S "found fragmented DTLS handshake message" \ |
| 7673 | -c "found fragmented DTLS handshake message" \ |
| 7674 | -C "error" |
| 7675 | |
| 7676 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7677 | requires_config_enabled MBEDTLS_RSA_C |
| 7678 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7679 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7680 | 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] | 7681 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7682 | crt_file=data_files/server7_int-ca.crt \ |
| 7683 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7684 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7685 | max_frag_len=2048" \ |
| 7686 | "$P_CLI dtls=1 debug_level=2 \ |
| 7687 | crt_file=data_files/server8_int-ca2.crt \ |
| 7688 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7689 | hs_timeout=2500-60000 \ |
| 7690 | max_frag_len=1024" \ |
| 7691 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7692 | -S "found fragmented DTLS handshake message" \ |
| 7693 | -c "found fragmented DTLS handshake message" \ |
| 7694 | -C "error" |
| 7695 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7696 | # While not required by the standard defining the MFL extension |
| 7697 | # (according to which it only applies to records, not to datagrams), |
| 7698 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7699 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7700 | # to the peer. |
| 7701 | # The next test checks that no datagrams significantly larger than the |
| 7702 | # negotiated MFL are sent. |
| 7703 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7704 | requires_config_enabled MBEDTLS_RSA_C |
| 7705 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7706 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7707 | 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] | 7708 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7709 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7710 | crt_file=data_files/server7_int-ca.crt \ |
| 7711 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7712 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7713 | max_frag_len=2048" \ |
| 7714 | "$P_CLI dtls=1 debug_level=2 \ |
| 7715 | crt_file=data_files/server8_int-ca2.crt \ |
| 7716 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7717 | hs_timeout=2500-60000 \ |
| 7718 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7719 | 0 \ |
| 7720 | -S "found fragmented DTLS handshake message" \ |
| 7721 | -c "found fragmented DTLS handshake message" \ |
| 7722 | -C "error" |
| 7723 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7724 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7725 | requires_config_enabled MBEDTLS_RSA_C |
| 7726 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7727 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7728 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7729 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7730 | crt_file=data_files/server7_int-ca.crt \ |
| 7731 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7732 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7733 | max_frag_len=2048" \ |
| 7734 | "$P_CLI dtls=1 debug_level=2 \ |
| 7735 | crt_file=data_files/server8_int-ca2.crt \ |
| 7736 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7737 | hs_timeout=2500-60000 \ |
| 7738 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7739 | 0 \ |
| 7740 | -s "found fragmented DTLS handshake message" \ |
| 7741 | -c "found fragmented DTLS handshake message" \ |
| 7742 | -C "error" |
| 7743 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7744 | # While not required by the standard defining the MFL extension |
| 7745 | # (according to which it only applies to records, not to datagrams), |
| 7746 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7747 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7748 | # to the peer. |
| 7749 | # The next test checks that no datagrams significantly larger than the |
| 7750 | # negotiated MFL are sent. |
| 7751 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7752 | requires_config_enabled MBEDTLS_RSA_C |
| 7753 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7754 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7755 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7756 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7757 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7758 | crt_file=data_files/server7_int-ca.crt \ |
| 7759 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7760 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7761 | max_frag_len=2048" \ |
| 7762 | "$P_CLI dtls=1 debug_level=2 \ |
| 7763 | crt_file=data_files/server8_int-ca2.crt \ |
| 7764 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7765 | hs_timeout=2500-60000 \ |
| 7766 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7767 | 0 \ |
| 7768 | -s "found fragmented DTLS handshake message" \ |
| 7769 | -c "found fragmented DTLS handshake message" \ |
| 7770 | -C "error" |
| 7771 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7772 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7773 | requires_config_enabled MBEDTLS_RSA_C |
| 7774 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7775 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7776 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7777 | crt_file=data_files/server7_int-ca.crt \ |
| 7778 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7779 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7780 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7781 | "$P_CLI dtls=1 debug_level=2 \ |
| 7782 | crt_file=data_files/server8_int-ca2.crt \ |
| 7783 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7784 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7785 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7786 | 0 \ |
| 7787 | -S "found fragmented DTLS handshake message" \ |
| 7788 | -C "found fragmented DTLS handshake message" \ |
| 7789 | -C "error" |
| 7790 | |
| 7791 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7792 | requires_config_enabled MBEDTLS_RSA_C |
| 7793 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7794 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7795 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7796 | crt_file=data_files/server7_int-ca.crt \ |
| 7797 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7798 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7799 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7800 | "$P_CLI dtls=1 debug_level=2 \ |
| 7801 | crt_file=data_files/server8_int-ca2.crt \ |
| 7802 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7803 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7804 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7805 | 0 \ |
| 7806 | -s "found fragmented DTLS handshake message" \ |
| 7807 | -C "found fragmented DTLS handshake message" \ |
| 7808 | -C "error" |
| 7809 | |
| 7810 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7811 | requires_config_enabled MBEDTLS_RSA_C |
| 7812 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7813 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7814 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7815 | crt_file=data_files/server7_int-ca.crt \ |
| 7816 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7817 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7818 | mtu=512" \ |
| 7819 | "$P_CLI dtls=1 debug_level=2 \ |
| 7820 | crt_file=data_files/server8_int-ca2.crt \ |
| 7821 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7822 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7823 | mtu=2048" \ |
| 7824 | 0 \ |
| 7825 | -S "found fragmented DTLS handshake message" \ |
| 7826 | -c "found fragmented DTLS handshake message" \ |
| 7827 | -C "error" |
| 7828 | |
| 7829 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7830 | requires_config_enabled MBEDTLS_RSA_C |
| 7831 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7832 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7833 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7834 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7835 | crt_file=data_files/server7_int-ca.crt \ |
| 7836 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7837 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7838 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7839 | "$P_CLI dtls=1 debug_level=2 \ |
| 7840 | crt_file=data_files/server8_int-ca2.crt \ |
| 7841 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7842 | hs_timeout=2500-60000 \ |
| 7843 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7844 | 0 \ |
| 7845 | -s "found fragmented DTLS handshake message" \ |
| 7846 | -c "found fragmented DTLS handshake message" \ |
| 7847 | -C "error" |
| 7848 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7849 | # 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] | 7850 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7851 | requires_config_enabled MBEDTLS_RSA_C |
| 7852 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7853 | requires_config_enabled MBEDTLS_SHA256_C |
| 7854 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7855 | requires_config_enabled MBEDTLS_AES_C |
| 7856 | requires_config_enabled MBEDTLS_GCM_C |
| 7857 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7858 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7859 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7860 | crt_file=data_files/server7_int-ca.crt \ |
| 7861 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7862 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7863 | mtu=512" \ |
| 7864 | "$P_CLI dtls=1 debug_level=2 \ |
| 7865 | crt_file=data_files/server8_int-ca2.crt \ |
| 7866 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7867 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7868 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7869 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7870 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7871 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7872 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7873 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7874 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7875 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7876 | # 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] | 7877 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7878 | # retransmissions, but in some cases (like both the server and client using |
| 7879 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7880 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7881 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7882 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7883 | requires_config_enabled MBEDTLS_RSA_C |
| 7884 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7885 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7886 | requires_config_enabled MBEDTLS_AES_C |
| 7887 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7888 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7889 | -p "$P_PXY mtu=508" \ |
| 7890 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7891 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7892 | key_file=data_files/server7.key \ |
| 7893 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7894 | "$P_CLI dtls=1 debug_level=2 \ |
| 7895 | crt_file=data_files/server8_int-ca2.crt \ |
| 7896 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7897 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7898 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7899 | 0 \ |
| 7900 | -s "found fragmented DTLS handshake message" \ |
| 7901 | -c "found fragmented DTLS handshake message" \ |
| 7902 | -C "error" |
| 7903 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7904 | # 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] | 7905 | only_with_valgrind |
| 7906 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7907 | requires_config_enabled MBEDTLS_RSA_C |
| 7908 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7909 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7910 | requires_config_enabled MBEDTLS_AES_C |
| 7911 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7912 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7913 | -p "$P_PXY mtu=508" \ |
| 7914 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7915 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7916 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7917 | hs_timeout=250-10000" \ |
| 7918 | "$P_CLI dtls=1 debug_level=2 \ |
| 7919 | crt_file=data_files/server8_int-ca2.crt \ |
| 7920 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7921 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7922 | hs_timeout=250-10000" \ |
| 7923 | 0 \ |
| 7924 | -s "found fragmented DTLS handshake message" \ |
| 7925 | -c "found fragmented DTLS handshake message" \ |
| 7926 | -C "error" |
| 7927 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7928 | # 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] | 7929 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7930 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7931 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7932 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7933 | requires_config_enabled MBEDTLS_RSA_C |
| 7934 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7935 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7936 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7937 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7938 | crt_file=data_files/server7_int-ca.crt \ |
| 7939 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7940 | hs_timeout=10000-60000 \ |
| 7941 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7942 | "$P_CLI dtls=1 debug_level=2 \ |
| 7943 | crt_file=data_files/server8_int-ca2.crt \ |
| 7944 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7945 | hs_timeout=10000-60000 \ |
| 7946 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7947 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7948 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7949 | -s "found fragmented DTLS handshake message" \ |
| 7950 | -c "found fragmented DTLS handshake message" \ |
| 7951 | -C "error" |
| 7952 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7953 | # 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] | 7954 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7955 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7956 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7957 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7958 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7959 | requires_config_enabled MBEDTLS_RSA_C |
| 7960 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7961 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7962 | requires_config_enabled MBEDTLS_AES_C |
| 7963 | requires_config_enabled MBEDTLS_GCM_C |
| 7964 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7965 | -p "$P_PXY mtu=512" \ |
| 7966 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7967 | crt_file=data_files/server7_int-ca.crt \ |
| 7968 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7969 | hs_timeout=10000-60000 \ |
| 7970 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7971 | "$P_CLI dtls=1 debug_level=2 \ |
| 7972 | crt_file=data_files/server8_int-ca2.crt \ |
| 7973 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7974 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7975 | hs_timeout=10000-60000 \ |
| 7976 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7977 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7978 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7979 | -s "found fragmented DTLS handshake message" \ |
| 7980 | -c "found fragmented DTLS handshake message" \ |
| 7981 | -C "error" |
| 7982 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7983 | not_with_valgrind # spurious autoreduction due to timeout |
| 7984 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7985 | requires_config_enabled MBEDTLS_RSA_C |
| 7986 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7987 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7988 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7989 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7990 | crt_file=data_files/server7_int-ca.crt \ |
| 7991 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7992 | hs_timeout=10000-60000 \ |
| 7993 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7994 | "$P_CLI dtls=1 debug_level=2 \ |
| 7995 | crt_file=data_files/server8_int-ca2.crt \ |
| 7996 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7997 | hs_timeout=10000-60000 \ |
| 7998 | mtu=1024 nbio=2" \ |
| 7999 | 0 \ |
| 8000 | -S "autoreduction" \ |
| 8001 | -s "found fragmented DTLS handshake message" \ |
| 8002 | -c "found fragmented DTLS handshake message" \ |
| 8003 | -C "error" |
| 8004 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8005 | # 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] | 8006 | not_with_valgrind # spurious autoreduction due to timeout |
| 8007 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8008 | requires_config_enabled MBEDTLS_RSA_C |
| 8009 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8010 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8011 | requires_config_enabled MBEDTLS_AES_C |
| 8012 | requires_config_enabled MBEDTLS_GCM_C |
| 8013 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8014 | -p "$P_PXY mtu=512" \ |
| 8015 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8016 | crt_file=data_files/server7_int-ca.crt \ |
| 8017 | key_file=data_files/server7.key \ |
| 8018 | hs_timeout=10000-60000 \ |
| 8019 | mtu=512 nbio=2" \ |
| 8020 | "$P_CLI dtls=1 debug_level=2 \ |
| 8021 | crt_file=data_files/server8_int-ca2.crt \ |
| 8022 | key_file=data_files/server8.key \ |
| 8023 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8024 | hs_timeout=10000-60000 \ |
| 8025 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8026 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8027 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8028 | -s "found fragmented DTLS handshake message" \ |
| 8029 | -c "found fragmented DTLS handshake message" \ |
| 8030 | -C "error" |
| 8031 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8032 | # 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] | 8033 | # This ensures things still work after session_reset(). |
| 8034 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8035 | # Since we don't support reading fragmented ClientHello yet, |
| 8036 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8037 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8038 | # An autoreduction on the client-side might happen if the server is |
| 8039 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8040 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8041 | # resumed listening, which would result in a spurious autoreduction. |
| 8042 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8043 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8044 | requires_config_enabled MBEDTLS_RSA_C |
| 8045 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8046 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8047 | requires_config_enabled MBEDTLS_AES_C |
| 8048 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8049 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8050 | -p "$P_PXY mtu=1450" \ |
| 8051 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8052 | crt_file=data_files/server7_int-ca.crt \ |
| 8053 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8054 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8055 | mtu=1450" \ |
| 8056 | "$P_CLI dtls=1 debug_level=2 \ |
| 8057 | crt_file=data_files/server8_int-ca2.crt \ |
| 8058 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8059 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8060 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8061 | 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] | 8062 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8063 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8064 | -s "found fragmented DTLS handshake message" \ |
| 8065 | -c "found fragmented DTLS handshake message" \ |
| 8066 | -C "error" |
| 8067 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8068 | # An autoreduction on the client-side might happen if the server is |
| 8069 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8070 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8071 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8072 | requires_config_enabled MBEDTLS_RSA_C |
| 8073 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8074 | requires_config_enabled MBEDTLS_SHA256_C |
| 8075 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8076 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8077 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 8078 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8079 | -p "$P_PXY mtu=512" \ |
| 8080 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8081 | crt_file=data_files/server7_int-ca.crt \ |
| 8082 | key_file=data_files/server7.key \ |
| 8083 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8084 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8085 | mtu=512" \ |
| 8086 | "$P_CLI dtls=1 debug_level=2 \ |
| 8087 | crt_file=data_files/server8_int-ca2.crt \ |
| 8088 | key_file=data_files/server8.key \ |
| 8089 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8090 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8091 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8092 | mtu=512" \ |
| 8093 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8094 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8095 | -s "found fragmented DTLS handshake message" \ |
| 8096 | -c "found fragmented DTLS handshake message" \ |
| 8097 | -C "error" |
| 8098 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8099 | # An autoreduction on the client-side might happen if the server is |
| 8100 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8101 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8102 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8103 | requires_config_enabled MBEDTLS_RSA_C |
| 8104 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8105 | requires_config_enabled MBEDTLS_SHA256_C |
| 8106 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8107 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8108 | requires_config_enabled MBEDTLS_AES_C |
| 8109 | requires_config_enabled MBEDTLS_GCM_C |
| 8110 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8111 | -p "$P_PXY mtu=512" \ |
| 8112 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8113 | crt_file=data_files/server7_int-ca.crt \ |
| 8114 | key_file=data_files/server7.key \ |
| 8115 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8116 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8117 | mtu=512" \ |
| 8118 | "$P_CLI dtls=1 debug_level=2 \ |
| 8119 | crt_file=data_files/server8_int-ca2.crt \ |
| 8120 | key_file=data_files/server8.key \ |
| 8121 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8122 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8123 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8124 | mtu=512" \ |
| 8125 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8126 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8127 | -s "found fragmented DTLS handshake message" \ |
| 8128 | -c "found fragmented DTLS handshake message" \ |
| 8129 | -C "error" |
| 8130 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8131 | # An autoreduction on the client-side might happen if the server is |
| 8132 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8133 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8134 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8135 | requires_config_enabled MBEDTLS_RSA_C |
| 8136 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8137 | requires_config_enabled MBEDTLS_SHA256_C |
| 8138 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8139 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8140 | requires_config_enabled MBEDTLS_AES_C |
| 8141 | requires_config_enabled MBEDTLS_CCM_C |
| 8142 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8143 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8144 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8145 | crt_file=data_files/server7_int-ca.crt \ |
| 8146 | key_file=data_files/server7.key \ |
| 8147 | exchanges=2 renegotiation=1 \ |
| 8148 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8149 | hs_timeout=10000-60000 \ |
| 8150 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8151 | "$P_CLI dtls=1 debug_level=2 \ |
| 8152 | crt_file=data_files/server8_int-ca2.crt \ |
| 8153 | key_file=data_files/server8.key \ |
| 8154 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8155 | hs_timeout=10000-60000 \ |
| 8156 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8157 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8158 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8159 | -s "found fragmented DTLS handshake message" \ |
| 8160 | -c "found fragmented DTLS handshake message" \ |
| 8161 | -C "error" |
| 8162 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8163 | # An autoreduction on the client-side might happen if the server is |
| 8164 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8165 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8166 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8167 | requires_config_enabled MBEDTLS_RSA_C |
| 8168 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8169 | requires_config_enabled MBEDTLS_SHA256_C |
| 8170 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8171 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8172 | requires_config_enabled MBEDTLS_AES_C |
| 8173 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8174 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 8175 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8176 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8177 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8178 | crt_file=data_files/server7_int-ca.crt \ |
| 8179 | key_file=data_files/server7.key \ |
| 8180 | exchanges=2 renegotiation=1 \ |
| 8181 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8182 | hs_timeout=10000-60000 \ |
| 8183 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8184 | "$P_CLI dtls=1 debug_level=2 \ |
| 8185 | crt_file=data_files/server8_int-ca2.crt \ |
| 8186 | key_file=data_files/server8.key \ |
| 8187 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8188 | hs_timeout=10000-60000 \ |
| 8189 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8190 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8191 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8192 | -s "found fragmented DTLS handshake message" \ |
| 8193 | -c "found fragmented DTLS handshake message" \ |
| 8194 | -C "error" |
| 8195 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8196 | # An autoreduction on the client-side might happen if the server is |
| 8197 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8198 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8199 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8200 | requires_config_enabled MBEDTLS_RSA_C |
| 8201 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8202 | requires_config_enabled MBEDTLS_SHA256_C |
| 8203 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8204 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8205 | requires_config_enabled MBEDTLS_AES_C |
| 8206 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8207 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8208 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8209 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8210 | crt_file=data_files/server7_int-ca.crt \ |
| 8211 | key_file=data_files/server7.key \ |
| 8212 | exchanges=2 renegotiation=1 \ |
| 8213 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8214 | hs_timeout=10000-60000 \ |
| 8215 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8216 | "$P_CLI dtls=1 debug_level=2 \ |
| 8217 | crt_file=data_files/server8_int-ca2.crt \ |
| 8218 | key_file=data_files/server8.key \ |
| 8219 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8220 | hs_timeout=10000-60000 \ |
| 8221 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8222 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8223 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8224 | -s "found fragmented DTLS handshake message" \ |
| 8225 | -c "found fragmented DTLS handshake message" \ |
| 8226 | -C "error" |
| 8227 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8228 | # 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] | 8229 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8230 | requires_config_enabled MBEDTLS_RSA_C |
| 8231 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8232 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8233 | requires_config_enabled MBEDTLS_AES_C |
| 8234 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8235 | client_needs_more_time 2 |
| 8236 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8237 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8238 | "$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] | 8239 | crt_file=data_files/server7_int-ca.crt \ |
| 8240 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8241 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8242 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8243 | crt_file=data_files/server8_int-ca2.crt \ |
| 8244 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8245 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8246 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8247 | 0 \ |
| 8248 | -s "found fragmented DTLS handshake message" \ |
| 8249 | -c "found fragmented DTLS handshake message" \ |
| 8250 | -C "error" |
| 8251 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8252 | # 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] | 8253 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8254 | requires_config_enabled MBEDTLS_RSA_C |
| 8255 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8256 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8257 | requires_config_enabled MBEDTLS_AES_C |
| 8258 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8259 | client_needs_more_time 2 |
| 8260 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8261 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8262 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8263 | crt_file=data_files/server7_int-ca.crt \ |
| 8264 | key_file=data_files/server7.key \ |
| 8265 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8266 | "$P_CLI dtls=1 debug_level=2 \ |
| 8267 | crt_file=data_files/server8_int-ca2.crt \ |
| 8268 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8269 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8270 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8271 | 0 \ |
| 8272 | -s "found fragmented DTLS handshake message" \ |
| 8273 | -c "found fragmented DTLS handshake message" \ |
| 8274 | -C "error" |
| 8275 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8276 | # interop tests for DTLS fragmentating with reliable connection |
| 8277 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8278 | # here and below we just want to test that the we fragment in a way that |
| 8279 | # pleases other implementations, so we don't need the peer to fragment |
| 8280 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8281 | requires_config_enabled MBEDTLS_RSA_C |
| 8282 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8284 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8285 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8286 | "$G_SRV -u" \ |
| 8287 | "$P_CLI dtls=1 debug_level=2 \ |
| 8288 | crt_file=data_files/server8_int-ca2.crt \ |
| 8289 | key_file=data_files/server8.key \ |
| 8290 | mtu=512 force_version=dtls1_2" \ |
| 8291 | 0 \ |
| 8292 | -c "fragmenting handshake message" \ |
| 8293 | -C "error" |
| 8294 | |
| 8295 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8296 | requires_config_enabled MBEDTLS_RSA_C |
| 8297 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8299 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8300 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8301 | "$G_SRV -u" \ |
| 8302 | "$P_CLI dtls=1 debug_level=2 \ |
| 8303 | crt_file=data_files/server8_int-ca2.crt \ |
| 8304 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8305 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8306 | 0 \ |
| 8307 | -c "fragmenting handshake message" \ |
| 8308 | -C "error" |
| 8309 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8310 | # We use --insecure for the GnuTLS client because it expects |
| 8311 | # the hostname / IP it connects to to be the name used in the |
| 8312 | # certificate obtained from the server. Here, however, it |
| 8313 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8314 | # as the server name in the certificate. This will make the |
| 8315 | # certifiate validation fail, but passing --insecure makes |
| 8316 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8317 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8318 | requires_config_enabled MBEDTLS_RSA_C |
| 8319 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8321 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8322 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8323 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8324 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8325 | crt_file=data_files/server7_int-ca.crt \ |
| 8326 | key_file=data_files/server7.key \ |
| 8327 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8328 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8329 | 0 \ |
| 8330 | -s "fragmenting handshake message" |
| 8331 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8332 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8333 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8334 | requires_config_enabled MBEDTLS_RSA_C |
| 8335 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8337 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8338 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8339 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8340 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8341 | crt_file=data_files/server7_int-ca.crt \ |
| 8342 | key_file=data_files/server7.key \ |
| 8343 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8344 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8345 | 0 \ |
| 8346 | -s "fragmenting handshake message" |
| 8347 | |
| 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_SSL_PROTO_TLS1_2 |
| 8352 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8353 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8354 | "$P_CLI dtls=1 debug_level=2 \ |
| 8355 | crt_file=data_files/server8_int-ca2.crt \ |
| 8356 | key_file=data_files/server8.key \ |
| 8357 | mtu=512 force_version=dtls1_2" \ |
| 8358 | 0 \ |
| 8359 | -c "fragmenting handshake message" \ |
| 8360 | -C "error" |
| 8361 | |
| 8362 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8363 | requires_config_enabled MBEDTLS_RSA_C |
| 8364 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8366 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8367 | "$O_SRV -dtls1 -verify 10" \ |
| 8368 | "$P_CLI dtls=1 debug_level=2 \ |
| 8369 | crt_file=data_files/server8_int-ca2.crt \ |
| 8370 | key_file=data_files/server8.key \ |
| 8371 | mtu=512 force_version=dtls1" \ |
| 8372 | 0 \ |
| 8373 | -c "fragmenting handshake message" \ |
| 8374 | -C "error" |
| 8375 | |
| 8376 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8377 | requires_config_enabled MBEDTLS_RSA_C |
| 8378 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8380 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8381 | "$P_SRV dtls=1 debug_level=2 \ |
| 8382 | crt_file=data_files/server7_int-ca.crt \ |
| 8383 | key_file=data_files/server7.key \ |
| 8384 | mtu=512 force_version=dtls1_2" \ |
| 8385 | "$O_CLI -dtls1_2" \ |
| 8386 | 0 \ |
| 8387 | -s "fragmenting handshake message" |
| 8388 | |
| 8389 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8390 | requires_config_enabled MBEDTLS_RSA_C |
| 8391 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8393 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8394 | "$P_SRV dtls=1 debug_level=2 \ |
| 8395 | crt_file=data_files/server7_int-ca.crt \ |
| 8396 | key_file=data_files/server7.key \ |
| 8397 | mtu=512 force_version=dtls1" \ |
| 8398 | "$O_CLI -dtls1" \ |
| 8399 | 0 \ |
| 8400 | -s "fragmenting handshake message" |
| 8401 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8402 | # interop tests for DTLS fragmentating with unreliable connection |
| 8403 | # |
| 8404 | # again we just want to test that the we fragment in a way that |
| 8405 | # pleases other implementations, so we don't need the peer to fragment |
| 8406 | requires_gnutls_next |
| 8407 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8408 | requires_config_enabled MBEDTLS_RSA_C |
| 8409 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8410 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8411 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8412 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8413 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8414 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8415 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8416 | crt_file=data_files/server8_int-ca2.crt \ |
| 8417 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8418 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8419 | 0 \ |
| 8420 | -c "fragmenting handshake message" \ |
| 8421 | -C "error" |
| 8422 | |
| 8423 | requires_gnutls_next |
| 8424 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8425 | requires_config_enabled MBEDTLS_RSA_C |
| 8426 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8427 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8428 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8429 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8430 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8431 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8432 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8433 | crt_file=data_files/server8_int-ca2.crt \ |
| 8434 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8435 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8436 | 0 \ |
| 8437 | -c "fragmenting handshake message" \ |
| 8438 | -C "error" |
| 8439 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8440 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8441 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8442 | requires_config_enabled MBEDTLS_RSA_C |
| 8443 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8445 | client_needs_more_time 4 |
| 8446 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8447 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8448 | "$P_SRV dtls=1 debug_level=2 \ |
| 8449 | crt_file=data_files/server7_int-ca.crt \ |
| 8450 | key_file=data_files/server7.key \ |
| 8451 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8452 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8453 | 0 \ |
| 8454 | -s "fragmenting handshake message" |
| 8455 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8456 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8457 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8458 | requires_config_enabled MBEDTLS_RSA_C |
| 8459 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8461 | client_needs_more_time 4 |
| 8462 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8463 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8464 | "$P_SRV dtls=1 debug_level=2 \ |
| 8465 | crt_file=data_files/server7_int-ca.crt \ |
| 8466 | key_file=data_files/server7.key \ |
| 8467 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8468 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8469 | 0 \ |
| 8470 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8471 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8472 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8473 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8474 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8475 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8476 | ## (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] | 8477 | skip_next_test |
| 8478 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8479 | requires_config_enabled MBEDTLS_RSA_C |
| 8480 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8482 | client_needs_more_time 4 |
| 8483 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8484 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8485 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8486 | "$P_CLI dtls=1 debug_level=2 \ |
| 8487 | crt_file=data_files/server8_int-ca2.crt \ |
| 8488 | key_file=data_files/server8.key \ |
| 8489 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8490 | 0 \ |
| 8491 | -c "fragmenting handshake message" \ |
| 8492 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8493 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8494 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8495 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8496 | requires_config_enabled MBEDTLS_RSA_C |
| 8497 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8499 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8500 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8501 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8502 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8503 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8504 | crt_file=data_files/server8_int-ca2.crt \ |
| 8505 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8506 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8507 | 0 \ |
| 8508 | -c "fragmenting handshake message" \ |
| 8509 | -C "error" |
| 8510 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8511 | skip_next_test |
| 8512 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8513 | requires_config_enabled MBEDTLS_RSA_C |
| 8514 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8516 | client_needs_more_time 4 |
| 8517 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8518 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8519 | "$P_SRV dtls=1 debug_level=2 \ |
| 8520 | crt_file=data_files/server7_int-ca.crt \ |
| 8521 | key_file=data_files/server7.key \ |
| 8522 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8523 | "$O_CLI -dtls1_2" \ |
| 8524 | 0 \ |
| 8525 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8526 | |
| 8527 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8528 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8529 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +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 |
| 8533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8534 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8535 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8536 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8537 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8538 | crt_file=data_files/server7_int-ca.crt \ |
| 8539 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8540 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8541 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8542 | 0 \ |
| 8543 | -s "fragmenting handshake message" |
| 8544 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8545 | # Tests for DTLS-SRTP (RFC 5764) |
| 8546 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8547 | run_test "DTLS-SRTP all profiles supported" \ |
| 8548 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8549 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8550 | 0 \ |
| 8551 | -s "found use_srtp extension" \ |
| 8552 | -s "found srtp profile" \ |
| 8553 | -s "selected srtp profile" \ |
| 8554 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8555 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8556 | -c "client hello, adding use_srtp extension" \ |
| 8557 | -c "found use_srtp extension" \ |
| 8558 | -c "found srtp profile" \ |
| 8559 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8560 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8561 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8562 | -C "error" |
| 8563 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8564 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8565 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8566 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 8567 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8568 | "$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] | 8569 | 0 \ |
| 8570 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8571 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 8572 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8573 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8574 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8575 | -c "client hello, adding use_srtp extension" \ |
| 8576 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8577 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8578 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8579 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8580 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8581 | -C "error" |
| 8582 | |
| 8583 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8584 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8585 | "$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] | 8586 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8587 | 0 \ |
| 8588 | -s "found use_srtp extension" \ |
| 8589 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8590 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8591 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8592 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8593 | -c "client hello, adding use_srtp extension" \ |
| 8594 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8595 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8596 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8597 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8598 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8599 | -C "error" |
| 8600 | |
| 8601 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8602 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8603 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8604 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8605 | 0 \ |
| 8606 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8607 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8608 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8609 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8610 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8611 | -c "client hello, adding use_srtp extension" \ |
| 8612 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8613 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8614 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8615 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8616 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8617 | -C "error" |
| 8618 | |
| 8619 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8620 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8621 | "$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] | 8622 | "$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] | 8623 | 0 \ |
| 8624 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8625 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8626 | -S "selected srtp profile" \ |
| 8627 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8628 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8629 | -c "client hello, adding use_srtp extension" \ |
| 8630 | -C "found use_srtp extension" \ |
| 8631 | -C "found srtp profile" \ |
| 8632 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8633 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8634 | -C "error" |
| 8635 | |
| 8636 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8637 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8638 | "$P_SRV dtls=1 debug_level=3" \ |
| 8639 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8640 | 0 \ |
| 8641 | -s "found use_srtp extension" \ |
| 8642 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8643 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8644 | -c "client hello, adding use_srtp extension" \ |
| 8645 | -C "found use_srtp extension" \ |
| 8646 | -C "found srtp profile" \ |
| 8647 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8648 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8649 | -C "error" |
| 8650 | |
| 8651 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8652 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8653 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8654 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8655 | 0 \ |
| 8656 | -s "found use_srtp extension" \ |
| 8657 | -s "found srtp profile" \ |
| 8658 | -s "selected srtp profile" \ |
| 8659 | -s "server hello, adding use_srtp extension" \ |
| 8660 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8661 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8662 | -c "client hello, adding use_srtp extension" \ |
| 8663 | -c "found use_srtp extension" \ |
| 8664 | -c "found srtp profile" \ |
| 8665 | -c "selected srtp profile" \ |
| 8666 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8667 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8668 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8669 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8670 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8671 | -C "error" |
| 8672 | |
| 8673 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8674 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8675 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8676 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8677 | 0 \ |
| 8678 | -s "found use_srtp extension" \ |
| 8679 | -s "found srtp profile" \ |
| 8680 | -s "selected srtp profile" \ |
| 8681 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8682 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8683 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8684 | -S "dumping 'using mki' (8 bytes)" \ |
| 8685 | -c "client hello, adding use_srtp extension" \ |
| 8686 | -c "found use_srtp extension" \ |
| 8687 | -c "found srtp profile" \ |
| 8688 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8689 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8690 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8691 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8692 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8693 | -C "dumping 'received mki' (8 bytes)" \ |
| 8694 | -C "error" |
| 8695 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8696 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8697 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8698 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8699 | "$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] | 8700 | 0 \ |
| 8701 | -s "found use_srtp extension" \ |
| 8702 | -s "found srtp profile" \ |
| 8703 | -s "selected srtp profile" \ |
| 8704 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8705 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8706 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8707 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8708 | |
| 8709 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8710 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8711 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8712 | "$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] | 8713 | 0 \ |
| 8714 | -s "found use_srtp extension" \ |
| 8715 | -s "found srtp profile" \ |
| 8716 | -s "selected srtp profile" \ |
| 8717 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8718 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8719 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8720 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8721 | |
| 8722 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8723 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8724 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8725 | "$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] | 8726 | 0 \ |
| 8727 | -s "found use_srtp extension" \ |
| 8728 | -s "found srtp profile" \ |
| 8729 | -s "selected srtp profile" \ |
| 8730 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8731 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8732 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8733 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8734 | |
| 8735 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8736 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8737 | "$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] | 8738 | "$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] | 8739 | 0 \ |
| 8740 | -s "found use_srtp extension" \ |
| 8741 | -s "found srtp profile" \ |
| 8742 | -s "selected srtp profile" \ |
| 8743 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8744 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8745 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8746 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8747 | |
| 8748 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8749 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8750 | "$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] | 8751 | "$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] | 8752 | 0 \ |
| 8753 | -s "found use_srtp extension" \ |
| 8754 | -s "found srtp profile" \ |
| 8755 | -s "selected srtp profile" \ |
| 8756 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8757 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8758 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8759 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8760 | |
| 8761 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8762 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8763 | "$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] | 8764 | "$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] | 8765 | 0 \ |
| 8766 | -s "found use_srtp extension" \ |
| 8767 | -s "found srtp profile" \ |
| 8768 | -S "selected srtp profile" \ |
| 8769 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8770 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8771 | -C "SRTP Extension negotiated, profile" |
| 8772 | |
| 8773 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8774 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8775 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8776 | "$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] | 8777 | 0 \ |
| 8778 | -s "found use_srtp extension" \ |
| 8779 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8780 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8781 | -C "SRTP Extension negotiated, profile" |
| 8782 | |
| 8783 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8784 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8785 | "$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] | 8786 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8787 | 0 \ |
| 8788 | -c "client hello, adding use_srtp extension" \ |
| 8789 | -c "found use_srtp extension" \ |
| 8790 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8791 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8792 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8793 | -C "error" |
| 8794 | |
| 8795 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8796 | 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] | 8797 | "$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] | 8798 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8799 | 0 \ |
| 8800 | -c "client hello, adding use_srtp extension" \ |
| 8801 | -c "found use_srtp extension" \ |
| 8802 | -c "found srtp profile" \ |
| 8803 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8804 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8805 | -C "error" |
| 8806 | |
| 8807 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8808 | 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] | 8809 | "$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] | 8810 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8811 | 0 \ |
| 8812 | -c "client hello, adding use_srtp extension" \ |
| 8813 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8814 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8815 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8816 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8817 | -C "error" |
| 8818 | |
| 8819 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8820 | 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] | 8821 | "$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] | 8822 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8823 | 0 \ |
| 8824 | -c "client hello, adding use_srtp extension" \ |
| 8825 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8826 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8827 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8828 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8829 | -C "error" |
| 8830 | |
| 8831 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8832 | 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] | 8833 | "$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] | 8834 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8835 | 0 \ |
| 8836 | -c "client hello, adding use_srtp extension" \ |
| 8837 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8838 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8839 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8840 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8841 | -C "error" |
| 8842 | |
| 8843 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8844 | 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] | 8845 | "$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] | 8846 | "$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] | 8847 | 0 \ |
| 8848 | -c "client hello, adding use_srtp extension" \ |
| 8849 | -C "found use_srtp extension" \ |
| 8850 | -C "found srtp profile" \ |
| 8851 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8852 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8853 | -C "error" |
| 8854 | |
| 8855 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8856 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8857 | "$O_SRV -dtls1" \ |
| 8858 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8859 | 0 \ |
| 8860 | -c "client hello, adding use_srtp extension" \ |
| 8861 | -C "found use_srtp extension" \ |
| 8862 | -C "found srtp profile" \ |
| 8863 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8864 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8865 | -C "error" |
| 8866 | |
| 8867 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8868 | 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] | 8869 | "$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] | 8870 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8871 | 0 \ |
| 8872 | -c "client hello, adding use_srtp extension" \ |
| 8873 | -c "found use_srtp extension" \ |
| 8874 | -c "found srtp profile" \ |
| 8875 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8876 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8877 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8878 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8879 | -C "dumping 'received mki' (8 bytes)" \ |
| 8880 | -C "error" |
| 8881 | |
| 8882 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8883 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8884 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8885 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8886 | "$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] | 8887 | 0 \ |
| 8888 | -s "found use_srtp extension" \ |
| 8889 | -s "found srtp profile" \ |
| 8890 | -s "selected srtp profile" \ |
| 8891 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8892 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8893 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8894 | |
| 8895 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8896 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8897 | 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] | 8898 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8899 | "$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] | 8900 | 0 \ |
| 8901 | -s "found use_srtp extension" \ |
| 8902 | -s "found srtp profile" \ |
| 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 | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8906 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8907 | |
| 8908 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8909 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8910 | 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] | 8911 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8912 | "$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] | 8913 | 0 \ |
| 8914 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8915 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8916 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8917 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8918 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8919 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8920 | |
| 8921 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8922 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8923 | 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] | 8924 | "$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] | 8925 | "$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] | 8926 | 0 \ |
| 8927 | -s "found use_srtp extension" \ |
| 8928 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8929 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8930 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8931 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8932 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8933 | |
| 8934 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8935 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8936 | 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] | 8937 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8938 | "$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] | 8939 | 0 \ |
| 8940 | -s "found use_srtp extension" \ |
| 8941 | -s "found srtp profile" \ |
| 8942 | -s "selected srtp profile" \ |
| 8943 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8944 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8945 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8946 | |
| 8947 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8948 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8949 | 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] | 8950 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8951 | "$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] | 8952 | 0 \ |
| 8953 | -s "found use_srtp extension" \ |
| 8954 | -s "found srtp profile" \ |
| 8955 | -S "selected srtp profile" \ |
| 8956 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8957 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8958 | -C "SRTP profile:" |
| 8959 | |
| 8960 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8961 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8962 | 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] | 8963 | "$P_SRV dtls=1 debug_level=3" \ |
| 8964 | "$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] | 8965 | 0 \ |
| 8966 | -s "found use_srtp extension" \ |
| 8967 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8968 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8969 | -C "SRTP profile:" |
| 8970 | |
| 8971 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8972 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8973 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8974 | "$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" \ |
| 8975 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8976 | 0 \ |
| 8977 | -c "client hello, adding use_srtp extension" \ |
| 8978 | -c "found use_srtp extension" \ |
| 8979 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8980 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8981 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8982 | -C "error" |
| 8983 | |
| 8984 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8985 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8986 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8987 | "$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" \ |
| 8988 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8989 | 0 \ |
| 8990 | -c "client hello, adding use_srtp extension" \ |
| 8991 | -c "found use_srtp extension" \ |
| 8992 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8993 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8994 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8995 | -C "error" |
| 8996 | |
| 8997 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8998 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8999 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9000 | "$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" \ |
| 9001 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9002 | 0 \ |
| 9003 | -c "client hello, adding use_srtp extension" \ |
| 9004 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9005 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9006 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9007 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9008 | -C "error" |
| 9009 | |
| 9010 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9011 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9012 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9013 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9014 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9015 | 0 \ |
| 9016 | -c "client hello, adding use_srtp extension" \ |
| 9017 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9018 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9019 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9020 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9021 | -C "error" |
| 9022 | |
| 9023 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9024 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9025 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9026 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9027 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9028 | 0 \ |
| 9029 | -c "client hello, adding use_srtp extension" \ |
| 9030 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9031 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9032 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9033 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9034 | -C "error" |
| 9035 | |
| 9036 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9037 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9038 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9039 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9040 | "$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] | 9041 | 0 \ |
| 9042 | -c "client hello, adding use_srtp extension" \ |
| 9043 | -C "found use_srtp extension" \ |
| 9044 | -C "found srtp profile" \ |
| 9045 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9046 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9047 | -C "error" |
| 9048 | |
| 9049 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9050 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9051 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9052 | "$G_SRV -u" \ |
| 9053 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9054 | 0 \ |
| 9055 | -c "client hello, adding use_srtp extension" \ |
| 9056 | -C "found use_srtp extension" \ |
| 9057 | -C "found srtp profile" \ |
| 9058 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9059 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9060 | -C "error" |
| 9061 | |
| 9062 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9063 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9064 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9065 | "$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" \ |
| 9066 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9067 | 0 \ |
| 9068 | -c "client hello, adding use_srtp extension" \ |
| 9069 | -c "found use_srtp extension" \ |
| 9070 | -c "found srtp profile" \ |
| 9071 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9072 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9073 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9074 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9075 | -c "dumping 'received mki' (8 bytes)" \ |
| 9076 | -C "error" |
| 9077 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9078 | # Tests for specific things with "unreliable" UDP connection |
| 9079 | |
| 9080 | not_with_valgrind # spurious resend due to timeout |
| 9081 | run_test "DTLS proxy: reference" \ |
| 9082 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9083 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9084 | "$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] | 9085 | 0 \ |
| 9086 | -C "replayed record" \ |
| 9087 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9088 | -C "Buffer record from epoch" \ |
| 9089 | -S "Buffer record from epoch" \ |
| 9090 | -C "ssl_buffer_message" \ |
| 9091 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9092 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9093 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9094 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9095 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9096 | -c "HTTP/1.0 200 OK" |
| 9097 | |
| 9098 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9099 | run_test "DTLS proxy: duplicate every packet" \ |
| 9100 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9101 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9102 | "$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] | 9103 | 0 \ |
| 9104 | -c "replayed record" \ |
| 9105 | -s "replayed record" \ |
| 9106 | -c "record from another epoch" \ |
| 9107 | -s "record from another epoch" \ |
| 9108 | -S "resend" \ |
| 9109 | -s "Extra-header:" \ |
| 9110 | -c "HTTP/1.0 200 OK" |
| 9111 | |
| 9112 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9113 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9114 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9115 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9116 | 0 \ |
| 9117 | -c "replayed record" \ |
| 9118 | -S "replayed record" \ |
| 9119 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9120 | -s "record from another epoch" \ |
| 9121 | -c "resend" \ |
| 9122 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9123 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9124 | -c "HTTP/1.0 200 OK" |
| 9125 | |
| 9126 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9127 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9128 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9129 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9130 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9131 | -c "next record in same datagram" \ |
| 9132 | -s "next record in same datagram" |
| 9133 | |
| 9134 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9135 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9136 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9137 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9138 | 0 \ |
| 9139 | -c "next record in same datagram" \ |
| 9140 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9141 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9142 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9143 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9144 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9145 | "$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] | 9146 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9147 | -c "discarding invalid record (mac)" \ |
| 9148 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9149 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9150 | -c "HTTP/1.0 200 OK" \ |
| 9151 | -S "too many records with bad MAC" \ |
| 9152 | -S "Verification of the message MAC failed" |
| 9153 | |
| 9154 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9155 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9156 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9157 | "$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] | 9158 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9159 | -C "discarding invalid record (mac)" \ |
| 9160 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9161 | -S "Extra-header:" \ |
| 9162 | -C "HTTP/1.0 200 OK" \ |
| 9163 | -s "too many records with bad MAC" \ |
| 9164 | -s "Verification of the message MAC failed" |
| 9165 | |
| 9166 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9167 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9168 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9169 | "$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] | 9170 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9171 | -c "discarding invalid record (mac)" \ |
| 9172 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9173 | -s "Extra-header:" \ |
| 9174 | -c "HTTP/1.0 200 OK" \ |
| 9175 | -S "too many records with bad MAC" \ |
| 9176 | -S "Verification of the message MAC failed" |
| 9177 | |
| 9178 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9179 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9180 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9181 | "$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] | 9182 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9183 | -c "discarding invalid record (mac)" \ |
| 9184 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9185 | -s "Extra-header:" \ |
| 9186 | -c "HTTP/1.0 200 OK" \ |
| 9187 | -s "too many records with bad MAC" \ |
| 9188 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9189 | |
| 9190 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9191 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9192 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9193 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9194 | 0 \ |
| 9195 | -c "record from another epoch" \ |
| 9196 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9197 | -s "Extra-header:" \ |
| 9198 | -c "HTTP/1.0 200 OK" |
| 9199 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9200 | # Tests for reordering support with DTLS |
| 9201 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9202 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9203 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9204 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9205 | hs_timeout=2500-60000" \ |
| 9206 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9207 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9208 | 0 \ |
| 9209 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9210 | -c "Next handshake message has been buffered - load"\ |
| 9211 | -S "Buffering HS message" \ |
| 9212 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9213 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9214 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9215 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9216 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9217 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9218 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9219 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9220 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9221 | hs_timeout=2500-60000" \ |
| 9222 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9223 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9224 | 0 \ |
| 9225 | -c "Buffering HS message" \ |
| 9226 | -c "found fragmented DTLS handshake message"\ |
| 9227 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9228 | -c "Next handshake message has been buffered - load"\ |
| 9229 | -S "Buffering HS message" \ |
| 9230 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9231 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9232 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9233 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9234 | -S "Remember CCS message" |
| 9235 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9236 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9237 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9238 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9239 | # while keeping the ServerKeyExchange. |
| 9240 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 9241 | 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] | 9242 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9243 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9244 | hs_timeout=2500-60000" \ |
| 9245 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9246 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9247 | 0 \ |
| 9248 | -c "Buffering HS message" \ |
| 9249 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9250 | -C "attempt to make space by freeing buffered messages" \ |
| 9251 | -S "Buffering HS message" \ |
| 9252 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9253 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9254 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9255 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9256 | -S "Remember CCS message" |
| 9257 | |
| 9258 | # The size constraints ensure that the delayed certificate message can't |
| 9259 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9260 | # when dropping it first. |
| 9261 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9262 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 9263 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9264 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9265 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9266 | hs_timeout=2500-60000" \ |
| 9267 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9268 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9269 | 0 \ |
| 9270 | -c "Buffering HS message" \ |
| 9271 | -c "attempt to make space by freeing buffered future messages" \ |
| 9272 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9273 | -S "Buffering HS message" \ |
| 9274 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9275 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9276 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9277 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9278 | -S "Remember CCS message" |
| 9279 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9280 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9281 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9282 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9283 | hs_timeout=2500-60000" \ |
| 9284 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9285 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9286 | 0 \ |
| 9287 | -C "Buffering HS message" \ |
| 9288 | -C "Next handshake message has been buffered - load"\ |
| 9289 | -s "Buffering HS message" \ |
| 9290 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9291 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9292 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9293 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9294 | -S "Remember CCS message" |
| 9295 | |
| 9296 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9297 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9298 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9299 | hs_timeout=2500-60000" \ |
| 9300 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9301 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9302 | 0 \ |
| 9303 | -C "Buffering HS message" \ |
| 9304 | -C "Next handshake message has been buffered - load"\ |
| 9305 | -S "Buffering HS message" \ |
| 9306 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9307 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9308 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9309 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9310 | -S "Remember CCS message" |
| 9311 | |
| 9312 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9313 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9314 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9315 | hs_timeout=2500-60000" \ |
| 9316 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9317 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9318 | 0 \ |
| 9319 | -C "Buffering HS message" \ |
| 9320 | -C "Next handshake message has been buffered - load"\ |
| 9321 | -S "Buffering HS message" \ |
| 9322 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9323 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9324 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9325 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9326 | -s "Remember CCS message" |
| 9327 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9328 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9329 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9330 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9331 | hs_timeout=2500-60000" \ |
| 9332 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9333 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9334 | 0 \ |
| 9335 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9336 | -s "Found buffered record from current epoch - load" \ |
| 9337 | -c "Buffer record from epoch 1" \ |
| 9338 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9339 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9340 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9341 | # from the server are delayed, so that the encrypted Finished message |
| 9342 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9343 | # in afterwards, the encrypted Finished message must be freed in order |
| 9344 | # to make space for the NewSessionTicket to be reassembled. |
| 9345 | # This works only in very particular circumstances: |
| 9346 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9347 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9348 | # the encrypted Finished message. |
| 9349 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9350 | # needs to be fragmented. |
| 9351 | # - All messages sent by the server must be small enough to be either sent |
| 9352 | # without fragmentation or be reassembled within the bounds of |
| 9353 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9354 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9355 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9356 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9357 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9358 | -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] | 9359 | "$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] | 9360 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9361 | 0 \ |
| 9362 | -s "Buffer record from epoch 1" \ |
| 9363 | -s "Found buffered record from current epoch - load" \ |
| 9364 | -c "Buffer record from epoch 1" \ |
| 9365 | -C "Found buffered record from current epoch - load" \ |
| 9366 | -c "Enough space available after freeing future epoch record" |
| 9367 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9368 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9369 | |
| 9370 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9371 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9372 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9373 | "$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] | 9374 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9375 | "$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] | 9376 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9377 | 0 \ |
| 9378 | -s "Extra-header:" \ |
| 9379 | -c "HTTP/1.0 200 OK" |
| 9380 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9381 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9382 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9383 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9384 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9385 | "$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] | 9386 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9387 | 0 \ |
| 9388 | -s "Extra-header:" \ |
| 9389 | -c "HTTP/1.0 200 OK" |
| 9390 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9391 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9392 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9393 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9394 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9395 | "$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] | 9396 | 0 \ |
| 9397 | -s "Extra-header:" \ |
| 9398 | -c "HTTP/1.0 200 OK" |
| 9399 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9400 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9401 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9402 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9403 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9404 | "$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] | 9405 | 0 \ |
| 9406 | -s "Extra-header:" \ |
| 9407 | -c "HTTP/1.0 200 OK" |
| 9408 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9409 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9410 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9411 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9412 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9413 | "$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] | 9414 | 0 \ |
| 9415 | -s "Extra-header:" \ |
| 9416 | -c "HTTP/1.0 200 OK" |
| 9417 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9418 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9419 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9420 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9421 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9422 | "$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] | 9423 | 0 \ |
| 9424 | -s "Extra-header:" \ |
| 9425 | -c "HTTP/1.0 200 OK" |
| 9426 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9427 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9428 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9429 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9430 | "$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] | 9431 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9432 | "$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] | 9433 | 0 \ |
| 9434 | -s "Extra-header:" \ |
| 9435 | -c "HTTP/1.0 200 OK" |
| 9436 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9437 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9438 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9439 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9440 | "$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] | 9441 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9442 | "$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] | 9443 | 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] | 9444 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9445 | 0 \ |
| 9446 | -s "a session has been resumed" \ |
| 9447 | -c "a session has been resumed" \ |
| 9448 | -s "Extra-header:" \ |
| 9449 | -c "HTTP/1.0 200 OK" |
| 9450 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9451 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9452 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9453 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9454 | "$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] | 9455 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9456 | "$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] | 9457 | 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] | 9458 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9459 | 0 \ |
| 9460 | -s "a session has been resumed" \ |
| 9461 | -c "a session has been resumed" \ |
| 9462 | -s "Extra-header:" \ |
| 9463 | -c "HTTP/1.0 200 OK" |
| 9464 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9465 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9466 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9467 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9468 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9469 | "$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] | 9470 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9471 | "$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] | 9472 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9473 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9474 | 0 \ |
| 9475 | -c "=> renegotiate" \ |
| 9476 | -s "=> renegotiate" \ |
| 9477 | -s "Extra-header:" \ |
| 9478 | -c "HTTP/1.0 200 OK" |
| 9479 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9480 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9481 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9482 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9483 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9484 | "$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] | 9485 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9486 | "$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] | 9487 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9488 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9489 | 0 \ |
| 9490 | -c "=> renegotiate" \ |
| 9491 | -s "=> renegotiate" \ |
| 9492 | -s "Extra-header:" \ |
| 9493 | -c "HTTP/1.0 200 OK" |
| 9494 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9495 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9496 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9497 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9498 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9499 | "$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] | 9500 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9501 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9502 | "$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] | 9503 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9504 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9505 | 0 \ |
| 9506 | -c "=> renegotiate" \ |
| 9507 | -s "=> renegotiate" \ |
| 9508 | -s "Extra-header:" \ |
| 9509 | -c "HTTP/1.0 200 OK" |
| 9510 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9511 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9512 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9513 | 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] | 9514 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9515 | "$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] | 9516 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9517 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9518 | "$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] | 9519 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9520 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9521 | 0 \ |
| 9522 | -c "=> renegotiate" \ |
| 9523 | -s "=> renegotiate" \ |
| 9524 | -s "Extra-header:" \ |
| 9525 | -c "HTTP/1.0 200 OK" |
| 9526 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9527 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9528 | ## all versions installed on the CI machines), reported here: |
| 9529 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9530 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9531 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9532 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9533 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9534 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9535 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9536 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9537 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9538 | "$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] | 9539 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9540 | -c "HTTP/1.0 200 OK" |
| 9541 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9542 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9543 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9544 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9545 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9546 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9547 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9548 | "$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] | 9549 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9550 | -c "HTTP/1.0 200 OK" |
| 9551 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9552 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9553 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9554 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9555 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9556 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9557 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9558 | "$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] | 9559 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9560 | -c "HTTP/1.0 200 OK" |
| 9561 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9562 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9563 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9564 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9565 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9566 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9567 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9568 | "$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] | 9569 | 0 \ |
| 9570 | -s "Extra-header:" \ |
| 9571 | -c "Extra-header:" |
| 9572 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9573 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9574 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9575 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9576 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9577 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9578 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9579 | "$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] | 9580 | 0 \ |
| 9581 | -s "Extra-header:" \ |
| 9582 | -c "Extra-header:" |
| 9583 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9584 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9585 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9586 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9587 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9588 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9589 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9590 | "$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] | 9591 | 0 \ |
| 9592 | -s "Extra-header:" \ |
| 9593 | -c "Extra-header:" |
| 9594 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9595 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 9596 | run_test "export keys functionality" \ |
| 9597 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9598 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9599 | 0 \ |
| 9600 | -s "exported maclen is " \ |
| 9601 | -s "exported keylen is " \ |
| 9602 | -s "exported ivlen is " \ |
| 9603 | -c "exported maclen is " \ |
| 9604 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9605 | -c "exported ivlen is " \ |
| 9606 | -c "EAP-TLS key material is:"\ |
| 9607 | -s "EAP-TLS key material is:"\ |
| 9608 | -c "EAP-TLS IV is:" \ |
| 9609 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9610 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9611 | # Test heap memory usage after handshake |
| 9612 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9613 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9614 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 9615 | run_tests_memory_after_hanshake |
| 9616 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9617 | # Final report |
| 9618 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9619 | echo "------------------------------------------------------------------------" |
| 9620 | |
| 9621 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9622 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9623 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9624 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9625 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9626 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9627 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9628 | |
| 9629 | exit $FAILS |