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 |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 773 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 774 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 775 | if [ -n "$PXY_CMD" ]; then |
| 776 | kill $PXY_PID >/dev/null 2>&1 |
| 777 | wait $PXY_PID |
| 778 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 779 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 780 | # retry only on timeouts |
| 781 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 782 | printf "RETRY " |
| 783 | else |
| 784 | TIMES_LEFT=0 |
| 785 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 786 | done |
| 787 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 788 | # 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] | 789 | # (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] | 790 | # expected client exit to incorrectly succeed in case of catastrophic |
| 791 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 792 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 793 | 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] | 794 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 795 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 796 | return |
| 797 | fi |
| 798 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 799 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 800 | 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] | 801 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 802 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 803 | return |
| 804 | fi |
| 805 | fi |
| 806 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame^] | 807 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 808 | # exit with status 0 when interrupted by a signal, and we don't really |
| 809 | # care anyway), in case e.g. the server reports a memory leak. |
| 810 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 811 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 812 | return |
| 813 | fi |
| 814 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 815 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 816 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 817 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 818 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 819 | 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] | 820 | return |
| 821 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 822 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 823 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 824 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 825 | # 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] | 826 | while [ $# -gt 0 ] |
| 827 | do |
| 828 | case $1 in |
| 829 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 830 | 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] | 831 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 832 | return |
| 833 | fi |
| 834 | ;; |
| 835 | |
| 836 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 837 | 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] | 838 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 839 | return |
| 840 | fi |
| 841 | ;; |
| 842 | |
| 843 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 844 | 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] | 845 | 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] | 846 | return |
| 847 | fi |
| 848 | ;; |
| 849 | |
| 850 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 851 | 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] | 852 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 853 | return |
| 854 | fi |
| 855 | ;; |
| 856 | |
| 857 | # The filtering in the following two options (-u and -U) do the following |
| 858 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 859 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 860 | # - keep one of each non-unique line |
| 861 | # - count how many lines remain |
| 862 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 863 | # if there were no duplicates. |
| 864 | "-U") |
| 865 | 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 |
| 866 | fail "lines following pattern '$2' must be unique in Server output" |
| 867 | return |
| 868 | fi |
| 869 | ;; |
| 870 | |
| 871 | "-u") |
| 872 | 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 |
| 873 | 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] | 874 | return |
| 875 | fi |
| 876 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 877 | "-F") |
| 878 | if ! $2 "$SRV_OUT"; then |
| 879 | fail "function call to '$2' failed on Server output" |
| 880 | return |
| 881 | fi |
| 882 | ;; |
| 883 | "-f") |
| 884 | if ! $2 "$CLI_OUT"; then |
| 885 | fail "function call to '$2' failed on Client output" |
| 886 | return |
| 887 | fi |
| 888 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 889 | "-g") |
| 890 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 891 | fail "function call to '$2' failed on Server and Client output" |
| 892 | return |
| 893 | fi |
| 894 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 895 | |
| 896 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 897 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 898 | exit 1 |
| 899 | esac |
| 900 | shift 2 |
| 901 | done |
| 902 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 903 | # check valgrind's results |
| 904 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 905 | 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] | 906 | fail "Server has memory errors" |
| 907 | return |
| 908 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 909 | 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] | 910 | fail "Client has memory errors" |
| 911 | return |
| 912 | fi |
| 913 | fi |
| 914 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 915 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 916 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 917 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 918 | mv $SRV_OUT o-srv-${TESTS}.log |
| 919 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 920 | if [ -n "$PXY_CMD" ]; then |
| 921 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 922 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 923 | fi |
| 924 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 925 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 926 | } |
| 927 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 928 | run_test_psa() { |
| 929 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 930 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 931 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 932 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 933 | 0 \ |
| 934 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 935 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 936 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 937 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 938 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 939 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 940 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 941 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 942 | -C "Failed to setup PSA-based cipher context"\ |
| 943 | -S "Failed to setup PSA-based cipher context"\ |
| 944 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 945 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 946 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 947 | -S "error" \ |
| 948 | -C "error" |
| 949 | } |
| 950 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 951 | run_test_psa_force_curve() { |
| 952 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 953 | run_test "PSA - ECDH with $1" \ |
| 954 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 955 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 956 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 957 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 958 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 959 | -c "PSA calc verify" \ |
| 960 | -c "calc PSA finished" \ |
| 961 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 962 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 963 | -s "PSA calc verify" \ |
| 964 | -s "calc PSA finished" \ |
| 965 | -C "Failed to setup PSA-based cipher context"\ |
| 966 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 967 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 968 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 969 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 970 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 971 | -C "error" |
| 972 | } |
| 973 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 974 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 975 | # a maximum fragment length. |
| 976 | # first argument ($1) is MFL for SSL client |
| 977 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 978 | run_test_memory_after_hanshake_with_mfl() |
| 979 | { |
| 980 | # The test passes if the difference is around 2*(16k-MFL) |
| 981 | local MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
| 982 | |
| 983 | # Leave some margin for robustness |
| 984 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 985 | |
| 986 | run_test "Handshake memory usage (MFL $1)" \ |
| 987 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 988 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 989 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 990 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 991 | 0 \ |
| 992 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 993 | } |
| 994 | |
| 995 | |
| 996 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 997 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 998 | run_tests_memory_after_hanshake() |
| 999 | { |
| 1000 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1001 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1002 | |
| 1003 | # first test with default MFU is to get reference memory usage |
| 1004 | MEMORY_USAGE_MFL_16K=0 |
| 1005 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1006 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1007 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1008 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1009 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1010 | 0 \ |
| 1011 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1012 | |
| 1013 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1014 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1015 | |
| 1016 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1017 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1018 | |
| 1019 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1020 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1021 | |
| 1022 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1023 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1024 | } |
| 1025 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1026 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1027 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1028 | rm -f context_srv.txt |
| 1029 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1030 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1031 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1032 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1033 | 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] | 1034 | exit 1 |
| 1035 | } |
| 1036 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1037 | # |
| 1038 | # MAIN |
| 1039 | # |
| 1040 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1041 | get_options "$@" |
| 1042 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1043 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1044 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1045 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1046 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1047 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1048 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1049 | exit 1 |
| 1050 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1051 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1052 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1053 | exit 1 |
| 1054 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1055 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1056 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1057 | exit 1 |
| 1058 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1059 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1060 | if which valgrind >/dev/null 2>&1; then :; else |
| 1061 | echo "Memcheck not possible. Valgrind not found" |
| 1062 | exit 1 |
| 1063 | fi |
| 1064 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1065 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1066 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1067 | exit 1 |
| 1068 | fi |
| 1069 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1070 | # used by watchdog |
| 1071 | MAIN_PID="$$" |
| 1072 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1073 | # We use somewhat arbitrary delays for tests: |
| 1074 | # - how long do we wait for the server to start (when lsof not available)? |
| 1075 | # - how long do we allow for the client to finish? |
| 1076 | # (not to check performance, just to avoid waiting indefinitely) |
| 1077 | # Things are slower with valgrind, so give extra time here. |
| 1078 | # |
| 1079 | # Note: without lsof, there is a trade-off between the running time of this |
| 1080 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1081 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1082 | # 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] | 1083 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1084 | START_DELAY=6 |
| 1085 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1086 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1087 | START_DELAY=2 |
| 1088 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1089 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1090 | |
| 1091 | # some particular tests need more time: |
| 1092 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1093 | # - for the server, we sleep for a number of seconds after the client exits |
| 1094 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1095 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1096 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1097 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1098 | # 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] | 1099 | # +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] | 1100 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1101 | 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] | 1102 | 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] | 1103 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1104 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1105 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1106 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1107 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1108 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1109 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1110 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1111 | fi |
| 1112 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1113 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1114 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1115 | fi |
| 1116 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1117 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1118 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1119 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1120 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1121 | # Allow SHA-1, because many of our test certificates use it |
| 1122 | P_SRV="$P_SRV allow_sha1=1" |
| 1123 | P_CLI="$P_CLI allow_sha1=1" |
| 1124 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1125 | # Also pick a unique name for intermediate files |
| 1126 | SRV_OUT="srv_out.$$" |
| 1127 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1128 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1129 | SESSION="session.$$" |
| 1130 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1131 | SKIP_NEXT="NO" |
| 1132 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1133 | trap cleanup INT TERM HUP |
| 1134 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1135 | # Basic test |
| 1136 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1137 | # Checks that: |
| 1138 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1139 | # - the expected (highest security) parameters are selected |
| 1140 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1141 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1142 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1143 | "$P_CLI" \ |
| 1144 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1145 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1146 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1147 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1148 | -s "ECDHE curve: secp521r1" \ |
| 1149 | -S "error" \ |
| 1150 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1151 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1152 | run_test "Default, DTLS" \ |
| 1153 | "$P_SRV dtls=1" \ |
| 1154 | "$P_CLI dtls=1" \ |
| 1155 | 0 \ |
| 1156 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1157 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1158 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1159 | run_test "TLS client auth: required" \ |
| 1160 | "$P_SRV auth_mode=required" \ |
| 1161 | "$P_CLI" \ |
| 1162 | 0 \ |
| 1163 | -s "Verifying peer X.509 certificate... ok" |
| 1164 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1165 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1166 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1167 | requires_config_enabled MBEDTLS_SHA256_C |
| 1168 | run_test "TLS: password protected client key" \ |
| 1169 | "$P_SRV auth_mode=required" \ |
| 1170 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1171 | 0 |
| 1172 | |
| 1173 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1174 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1175 | requires_config_enabled MBEDTLS_SHA256_C |
| 1176 | run_test "TLS: password protected server key" \ |
| 1177 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1178 | "$P_CLI" \ |
| 1179 | 0 |
| 1180 | |
| 1181 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1182 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1183 | requires_config_enabled MBEDTLS_RSA_C |
| 1184 | requires_config_enabled MBEDTLS_SHA256_C |
| 1185 | run_test "TLS: password protected server key, two certificates" \ |
| 1186 | "$P_SRV \ |
| 1187 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1188 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1189 | "$P_CLI" \ |
| 1190 | 0 |
| 1191 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1192 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1193 | run_test "Default (compression enabled)" \ |
| 1194 | "$P_SRV debug_level=3" \ |
| 1195 | "$P_CLI debug_level=3" \ |
| 1196 | 0 \ |
| 1197 | -s "Allocating compression buffer" \ |
| 1198 | -c "Allocating compression buffer" \ |
| 1199 | -s "Record expansion is unknown (compression)" \ |
| 1200 | -c "Record expansion is unknown (compression)" \ |
| 1201 | -S "error" \ |
| 1202 | -C "error" |
| 1203 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1204 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1205 | run_test "CA callback on client" \ |
| 1206 | "$P_SRV debug_level=3" \ |
| 1207 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1208 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1209 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1210 | -S "error" \ |
| 1211 | -C "error" |
| 1212 | |
| 1213 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 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 "CA callback on server" \ |
| 1218 | "$P_SRV auth_mode=required" \ |
| 1219 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1220 | key_file=data_files/server5.key" \ |
| 1221 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1222 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1223 | -s "Verifying peer X.509 certificate... ok" \ |
| 1224 | -S "error" \ |
| 1225 | -C "error" |
| 1226 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1227 | # Test using an opaque private key for client authentication |
| 1228 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1229 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1230 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1231 | requires_config_enabled MBEDTLS_SHA256_C |
| 1232 | run_test "Opaque key for client authentication" \ |
| 1233 | "$P_SRV auth_mode=required" \ |
| 1234 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1235 | key_file=data_files/server5.key" \ |
| 1236 | 0 \ |
| 1237 | -c "key type: Opaque" \ |
| 1238 | -s "Verifying peer X.509 certificate... ok" \ |
| 1239 | -S "error" \ |
| 1240 | -C "error" |
| 1241 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1242 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1243 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1244 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1245 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1246 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1247 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1248 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1249 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1250 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1251 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1252 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1253 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1254 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1255 | run_test_psa_force_curve "secp521r1" |
| 1256 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1257 | run_test_psa_force_curve "brainpoolP512r1" |
| 1258 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1259 | run_test_psa_force_curve "secp384r1" |
| 1260 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1261 | run_test_psa_force_curve "brainpoolP384r1" |
| 1262 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1263 | run_test_psa_force_curve "secp256r1" |
| 1264 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1265 | run_test_psa_force_curve "secp256k1" |
| 1266 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1267 | run_test_psa_force_curve "brainpoolP256r1" |
| 1268 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1269 | run_test_psa_force_curve "secp224r1" |
| 1270 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1271 | run_test_psa_force_curve "secp224k1" |
| 1272 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1273 | run_test_psa_force_curve "secp192r1" |
| 1274 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1275 | run_test_psa_force_curve "secp192k1" |
| 1276 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1277 | # Test current time in ServerHello |
| 1278 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1279 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1280 | "$P_SRV debug_level=3" \ |
| 1281 | "$P_CLI debug_level=3" \ |
| 1282 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1283 | -f "check_server_hello_time" \ |
| 1284 | -F "check_server_hello_time" |
| 1285 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1286 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1287 | run_test "Unique IV in GCM" \ |
| 1288 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1289 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1290 | 0 \ |
| 1291 | -u "IV used" \ |
| 1292 | -U "IV used" |
| 1293 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1294 | # Tests for certificate verification callback |
| 1295 | run_test "Configuration-specific CRT verification callback" \ |
| 1296 | "$P_SRV debug_level=3" \ |
| 1297 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1298 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1299 | -S "error" \ |
| 1300 | -c "Verify requested for " \ |
| 1301 | -c "Use configuration-specific verification callback" \ |
| 1302 | -C "Use context-specific verification callback" \ |
| 1303 | -C "error" |
| 1304 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1305 | run_test "Context-specific CRT verification callback" \ |
| 1306 | "$P_SRV debug_level=3" \ |
| 1307 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1308 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1309 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1310 | -c "Verify requested for " \ |
| 1311 | -c "Use context-specific verification callback" \ |
| 1312 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1313 | -C "error" |
| 1314 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1315 | # Tests for rc4 option |
| 1316 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1317 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1318 | run_test "RC4: server disabled, client enabled" \ |
| 1319 | "$P_SRV" \ |
| 1320 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1321 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1322 | -s "SSL - The server has no ciphersuites in common" |
| 1323 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1324 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1325 | run_test "RC4: server half, client enabled" \ |
| 1326 | "$P_SRV arc4=1" \ |
| 1327 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1328 | 1 \ |
| 1329 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1330 | |
| 1331 | run_test "RC4: server enabled, client disabled" \ |
| 1332 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1333 | "$P_CLI" \ |
| 1334 | 1 \ |
| 1335 | -s "SSL - The server has no ciphersuites in common" |
| 1336 | |
| 1337 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1338 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1339 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1340 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1341 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1342 | -S "SSL - The server has no ciphersuites in common" |
| 1343 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1344 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1345 | |
| 1346 | requires_gnutls |
| 1347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1348 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1349 | "$G_SRV"\ |
| 1350 | "$P_CLI force_version=tls1_1" \ |
| 1351 | 0 |
| 1352 | |
| 1353 | requires_gnutls |
| 1354 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1355 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1356 | "$G_SRV"\ |
| 1357 | "$P_CLI force_version=tls1" \ |
| 1358 | 0 |
| 1359 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1360 | # Tests for SHA-1 support |
| 1361 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1362 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1363 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1364 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1365 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1366 | 1 \ |
| 1367 | -c "The certificate is signed with an unacceptable hash" |
| 1368 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1369 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1370 | run_test "SHA-1 allowed by default in server certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1371 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1372 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1373 | 0 |
| 1374 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1375 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1376 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1377 | "$P_CLI allow_sha1=1" \ |
| 1378 | 0 |
| 1379 | |
| 1380 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1381 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1382 | "$P_CLI allow_sha1=0" \ |
| 1383 | 0 |
| 1384 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1385 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1386 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1387 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1388 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1389 | 1 \ |
| 1390 | -s "The certificate is signed with an unacceptable hash" |
| 1391 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1392 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1393 | run_test "SHA-1 allowed by default in client certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1394 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1395 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1396 | 0 |
| 1397 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1398 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1399 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1400 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1401 | 0 |
| 1402 | |
| 1403 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1404 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1405 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1406 | 0 |
| 1407 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1408 | # Tests for datagram packing |
| 1409 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1410 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1411 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1412 | 0 \ |
| 1413 | -c "next record in same datagram" \ |
| 1414 | -s "next record in same datagram" |
| 1415 | |
| 1416 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1417 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1418 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1419 | 0 \ |
| 1420 | -s "next record in same datagram" \ |
| 1421 | -C "next record in same datagram" |
| 1422 | |
| 1423 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1424 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1425 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1426 | 0 \ |
| 1427 | -S "next record in same datagram" \ |
| 1428 | -c "next record in same datagram" |
| 1429 | |
| 1430 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1431 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1432 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1433 | 0 \ |
| 1434 | -S "next record in same datagram" \ |
| 1435 | -C "next record in same datagram" |
| 1436 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1437 | # Tests for Truncated HMAC extension |
| 1438 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1439 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1440 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1441 | "$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] | 1442 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1443 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1444 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1445 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1446 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1447 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1448 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1449 | "$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] | 1450 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1451 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1452 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1453 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1454 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1455 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1456 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1457 | "$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] | 1458 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1459 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1460 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1461 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1462 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1463 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1464 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1465 | "$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] | 1466 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1467 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1468 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1469 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1470 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1471 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1472 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1473 | "$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] | 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 |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1479 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1480 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1481 | "$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] | 1482 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1483 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1484 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1485 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1486 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1487 | "$P_SRV dtls=1 debug_level=4" \ |
| 1488 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1489 | 0 \ |
| 1490 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1491 | -S "dumping 'expected mac' (10 bytes)" |
| 1492 | |
| 1493 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1494 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1495 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1496 | "$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] | 1497 | 0 \ |
| 1498 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1499 | -S "dumping 'expected mac' (10 bytes)" |
| 1500 | |
| 1501 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1502 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1503 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1504 | "$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] | 1505 | 0 \ |
| 1506 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1507 | -S "dumping 'expected mac' (10 bytes)" |
| 1508 | |
| 1509 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1510 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1511 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1512 | "$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] | 1513 | 0 \ |
| 1514 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1515 | -S "dumping 'expected mac' (10 bytes)" |
| 1516 | |
| 1517 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1518 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1519 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1520 | "$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] | 1521 | 0 \ |
| 1522 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1523 | -S "dumping 'expected mac' (10 bytes)" |
| 1524 | |
| 1525 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1526 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1527 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1528 | "$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] | 1529 | 0 \ |
| 1530 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1531 | -s "dumping 'expected mac' (10 bytes)" |
| 1532 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1533 | # Tests for Context serialization |
| 1534 | |
| 1535 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1536 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1537 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1538 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1539 | 0 \ |
| 1540 | -c "Deserializing connection..." \ |
| 1541 | -S "Deserializing connection..." |
| 1542 | |
| 1543 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1544 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1545 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1546 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1547 | 0 \ |
| 1548 | -c "Deserializing connection..." \ |
| 1549 | -S "Deserializing connection..." |
| 1550 | |
| 1551 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1552 | run_test "Context serialization, client serializes, GCM" \ |
| 1553 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1554 | "$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] | 1555 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1556 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1557 | -S "Deserializing connection..." |
| 1558 | |
| 1559 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1560 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1561 | run_test "Context serialization, client serializes, with CID" \ |
| 1562 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1563 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1564 | 0 \ |
| 1565 | -c "Deserializing connection..." \ |
| 1566 | -S "Deserializing connection..." |
| 1567 | |
| 1568 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1569 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1570 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1571 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1572 | 0 \ |
| 1573 | -C "Deserializing connection..." \ |
| 1574 | -s "Deserializing connection..." |
| 1575 | |
| 1576 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1577 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1578 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1579 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1580 | 0 \ |
| 1581 | -C "Deserializing connection..." \ |
| 1582 | -s "Deserializing connection..." |
| 1583 | |
| 1584 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1585 | run_test "Context serialization, server serializes, GCM" \ |
| 1586 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1587 | "$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] | 1588 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1589 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1590 | -s "Deserializing connection..." |
| 1591 | |
| 1592 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1593 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1594 | run_test "Context serialization, server serializes, with CID" \ |
| 1595 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1596 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1597 | 0 \ |
| 1598 | -C "Deserializing connection..." \ |
| 1599 | -s "Deserializing connection..." |
| 1600 | |
| 1601 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1602 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1603 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1604 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1605 | 0 \ |
| 1606 | -c "Deserializing connection..." \ |
| 1607 | -s "Deserializing connection..." |
| 1608 | |
| 1609 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1610 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1611 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1612 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1613 | 0 \ |
| 1614 | -c "Deserializing connection..." \ |
| 1615 | -s "Deserializing connection..." |
| 1616 | |
| 1617 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1618 | run_test "Context serialization, both serialize, GCM" \ |
| 1619 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1620 | "$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] | 1621 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1622 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1623 | -s "Deserializing connection..." |
| 1624 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1625 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1626 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1627 | run_test "Context serialization, both serialize, with CID" \ |
| 1628 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1629 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1630 | 0 \ |
| 1631 | -c "Deserializing connection..." \ |
| 1632 | -s "Deserializing connection..." |
| 1633 | |
| 1634 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1635 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1636 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1637 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1638 | 0 \ |
| 1639 | -c "Deserializing connection..." \ |
| 1640 | -S "Deserializing connection..." |
| 1641 | |
| 1642 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1643 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1644 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1645 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1646 | 0 \ |
| 1647 | -c "Deserializing connection..." \ |
| 1648 | -S "Deserializing connection..." |
| 1649 | |
| 1650 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1651 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1652 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1653 | "$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] | 1654 | 0 \ |
| 1655 | -c "Deserializing connection..." \ |
| 1656 | -S "Deserializing connection..." |
| 1657 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1658 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1659 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1660 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1661 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1662 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1663 | 0 \ |
| 1664 | -c "Deserializing connection..." \ |
| 1665 | -S "Deserializing connection..." |
| 1666 | |
| 1667 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1668 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1669 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1670 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1671 | 0 \ |
| 1672 | -C "Deserializing connection..." \ |
| 1673 | -s "Deserializing connection..." |
| 1674 | |
| 1675 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1676 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1677 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1678 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1679 | 0 \ |
| 1680 | -C "Deserializing connection..." \ |
| 1681 | -s "Deserializing connection..." |
| 1682 | |
| 1683 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1684 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1685 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1686 | "$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] | 1687 | 0 \ |
| 1688 | -C "Deserializing connection..." \ |
| 1689 | -s "Deserializing connection..." |
| 1690 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1691 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1692 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1693 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1694 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1695 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1696 | 0 \ |
| 1697 | -C "Deserializing connection..." \ |
| 1698 | -s "Deserializing connection..." |
| 1699 | |
| 1700 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1701 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1702 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1703 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1704 | 0 \ |
| 1705 | -c "Deserializing connection..." \ |
| 1706 | -s "Deserializing connection..." |
| 1707 | |
| 1708 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1709 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1710 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1711 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1712 | 0 \ |
| 1713 | -c "Deserializing connection..." \ |
| 1714 | -s "Deserializing connection..." |
| 1715 | |
| 1716 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1717 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1718 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1719 | "$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] | 1720 | 0 \ |
| 1721 | -c "Deserializing connection..." \ |
| 1722 | -s "Deserializing connection..." |
| 1723 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1724 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1725 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1726 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1727 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1728 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1729 | 0 \ |
| 1730 | -c "Deserializing connection..." \ |
| 1731 | -s "Deserializing connection..." |
| 1732 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1733 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1734 | run_test "Saving the serialized context to a file" \ |
| 1735 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1736 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1737 | 0 \ |
| 1738 | -s "Save serialized context to a file... ok" \ |
| 1739 | -c "Save serialized context to a file... ok" |
| 1740 | rm -f context_srv.txt |
| 1741 | rm -f context_cli.txt |
| 1742 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1743 | # Tests for DTLS Connection ID extension |
| 1744 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1745 | # So far, the CID API isn't implemented, so we can't |
| 1746 | # grep for output witnessing its use. This needs to be |
| 1747 | # changed once the CID extension is implemented. |
| 1748 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1749 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1750 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1751 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1752 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1753 | 0 \ |
| 1754 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1755 | -s "found CID extension" \ |
| 1756 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1757 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1758 | -c "client hello, adding 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" \ |
| 1763 | -c "Use of Connection ID was rejected by the server" |
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 disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1767 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1768 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1769 | 0 \ |
| 1770 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1771 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1772 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1773 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1774 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1775 | -C "found CID extension" \ |
| 1776 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1777 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1778 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1779 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1780 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1781 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1782 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1783 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1784 | 0 \ |
| 1785 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1786 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1787 | -c "client hello, adding CID extension" \ |
| 1788 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1789 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1790 | -s "server hello, adding CID extension" \ |
| 1791 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1792 | -c "Use of CID extension negotiated" \ |
| 1793 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1794 | -c "Copy CIDs into SSL transform" \ |
| 1795 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1796 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1797 | -s "Use of Connection ID has been negotiated" \ |
| 1798 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1799 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1800 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1801 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1802 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1803 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1804 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1805 | 0 \ |
| 1806 | -c "Enable use of CID extension." \ |
| 1807 | -s "Enable use of CID extension." \ |
| 1808 | -c "client hello, adding CID extension" \ |
| 1809 | -s "found CID extension" \ |
| 1810 | -s "Use of CID extension negotiated" \ |
| 1811 | -s "server hello, adding CID extension" \ |
| 1812 | -c "found CID extension" \ |
| 1813 | -c "Use of CID extension negotiated" \ |
| 1814 | -s "Copy CIDs into SSL transform" \ |
| 1815 | -c "Copy CIDs into SSL transform" \ |
| 1816 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1817 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1818 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1819 | -c "Use of Connection ID has been negotiated" \ |
| 1820 | -c "ignoring unexpected CID" \ |
| 1821 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1822 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1823 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1824 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1825 | -p "$P_PXY mtu=800" \ |
| 1826 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1827 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1828 | 0 \ |
| 1829 | -c "Enable use of CID extension." \ |
| 1830 | -s "Enable use of CID extension." \ |
| 1831 | -c "client hello, adding CID extension" \ |
| 1832 | -s "found CID extension" \ |
| 1833 | -s "Use of CID extension negotiated" \ |
| 1834 | -s "server hello, adding CID extension" \ |
| 1835 | -c "found CID extension" \ |
| 1836 | -c "Use of CID extension negotiated" \ |
| 1837 | -s "Copy CIDs into SSL transform" \ |
| 1838 | -c "Copy CIDs into SSL transform" \ |
| 1839 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1840 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1841 | -s "Use of Connection ID has been negotiated" \ |
| 1842 | -c "Use of Connection ID has been negotiated" |
| 1843 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1844 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1845 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1846 | -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] | 1847 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1848 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1849 | 0 \ |
| 1850 | -c "Enable use of CID extension." \ |
| 1851 | -s "Enable use of CID extension." \ |
| 1852 | -c "client hello, adding CID extension" \ |
| 1853 | -s "found CID extension" \ |
| 1854 | -s "Use of CID extension negotiated" \ |
| 1855 | -s "server hello, adding CID extension" \ |
| 1856 | -c "found CID extension" \ |
| 1857 | -c "Use of CID extension negotiated" \ |
| 1858 | -s "Copy CIDs into SSL transform" \ |
| 1859 | -c "Copy CIDs into SSL transform" \ |
| 1860 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1861 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1862 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1863 | -c "Use of Connection ID has been negotiated" \ |
| 1864 | -c "ignoring unexpected CID" \ |
| 1865 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1866 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1867 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1868 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1869 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1870 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1871 | 0 \ |
| 1872 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1873 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1874 | -c "client hello, adding CID extension" \ |
| 1875 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1876 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1877 | -s "server hello, adding CID extension" \ |
| 1878 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1879 | -c "Use of CID extension negotiated" \ |
| 1880 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1881 | -c "Copy CIDs into SSL transform" \ |
| 1882 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1883 | -s "Peer CID (length 0 Bytes):" \ |
| 1884 | -s "Use of Connection ID has been negotiated" \ |
| 1885 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1886 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1887 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1888 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1889 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1890 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1891 | 0 \ |
| 1892 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1893 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1894 | -c "client hello, adding CID extension" \ |
| 1895 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1896 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1897 | -s "server hello, adding CID extension" \ |
| 1898 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1899 | -c "Use of CID extension negotiated" \ |
| 1900 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1901 | -c "Copy CIDs into SSL transform" \ |
| 1902 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1903 | -c "Peer CID (length 0 Bytes):" \ |
| 1904 | -s "Use of Connection ID has been negotiated" \ |
| 1905 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1906 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1907 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1908 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1909 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1910 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1911 | 0 \ |
| 1912 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1913 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1914 | -c "client hello, adding CID extension" \ |
| 1915 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1916 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1917 | -s "server hello, adding CID extension" \ |
| 1918 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1919 | -c "Use of CID extension negotiated" \ |
| 1920 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1921 | -c "Copy CIDs into SSL transform" \ |
| 1922 | -S "Use of Connection ID has been negotiated" \ |
| 1923 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1924 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1925 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1926 | 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] | 1927 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1928 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1929 | 0 \ |
| 1930 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1931 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1932 | -c "client hello, adding CID extension" \ |
| 1933 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1934 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1935 | -s "server hello, adding CID extension" \ |
| 1936 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1937 | -c "Use of CID extension negotiated" \ |
| 1938 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1939 | -c "Copy CIDs into SSL transform" \ |
| 1940 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1941 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1942 | -s "Use of Connection ID has been negotiated" \ |
| 1943 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1944 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1945 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1946 | 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] | 1947 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1948 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1949 | 0 \ |
| 1950 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1951 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1952 | -c "client hello, adding CID extension" \ |
| 1953 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1954 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1955 | -s "server hello, adding CID extension" \ |
| 1956 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1957 | -c "Use of CID extension negotiated" \ |
| 1958 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1959 | -c "Copy CIDs into SSL transform" \ |
| 1960 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1961 | -s "Peer CID (length 0 Bytes):" \ |
| 1962 | -s "Use of Connection ID has been negotiated" \ |
| 1963 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1964 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1965 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1966 | 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] | 1967 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1968 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1969 | 0 \ |
| 1970 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1971 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1972 | -c "client hello, adding CID extension" \ |
| 1973 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1974 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1975 | -s "server hello, adding CID extension" \ |
| 1976 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1977 | -c "Use of CID extension negotiated" \ |
| 1978 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1979 | -c "Copy CIDs into SSL transform" \ |
| 1980 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1981 | -c "Peer CID (length 0 Bytes):" \ |
| 1982 | -s "Use of Connection ID has been negotiated" \ |
| 1983 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1984 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1985 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1986 | 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] | 1987 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1988 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1989 | 0 \ |
| 1990 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1991 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1992 | -c "client hello, adding CID extension" \ |
| 1993 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1994 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1995 | -s "server hello, adding CID extension" \ |
| 1996 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1997 | -c "Use of CID extension negotiated" \ |
| 1998 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1999 | -c "Copy CIDs into SSL transform" \ |
| 2000 | -S "Use of Connection ID has been negotiated" \ |
| 2001 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2002 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2003 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2004 | 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] | 2005 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2006 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2007 | 0 \ |
| 2008 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2009 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2010 | -c "client hello, adding CID extension" \ |
| 2011 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2012 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2013 | -s "server hello, adding CID extension" \ |
| 2014 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2015 | -c "Use of CID extension negotiated" \ |
| 2016 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2017 | -c "Copy CIDs into SSL transform" \ |
| 2018 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2019 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2020 | -s "Use of Connection ID has been negotiated" \ |
| 2021 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2022 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2023 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2024 | 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] | 2025 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2026 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2027 | 0 \ |
| 2028 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2029 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2030 | -c "client hello, adding CID extension" \ |
| 2031 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2032 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2033 | -s "server hello, adding CID extension" \ |
| 2034 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2035 | -c "Use of CID extension negotiated" \ |
| 2036 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2037 | -c "Copy CIDs into SSL transform" \ |
| 2038 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2039 | -s "Peer CID (length 0 Bytes):" \ |
| 2040 | -s "Use of Connection ID has been negotiated" \ |
| 2041 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2042 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2043 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2044 | 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] | 2045 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2046 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2047 | 0 \ |
| 2048 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2049 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2050 | -c "client hello, adding CID extension" \ |
| 2051 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2052 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2053 | -s "server hello, adding CID extension" \ |
| 2054 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2055 | -c "Use of CID extension negotiated" \ |
| 2056 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2057 | -c "Copy CIDs into SSL transform" \ |
| 2058 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2059 | -c "Peer CID (length 0 Bytes):" \ |
| 2060 | -s "Use of Connection ID has been negotiated" \ |
| 2061 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2062 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2063 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2064 | 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] | 2065 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2066 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2067 | 0 \ |
| 2068 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2069 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2070 | -c "client hello, adding CID extension" \ |
| 2071 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2072 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2073 | -s "server hello, adding CID extension" \ |
| 2074 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2075 | -c "Use of CID extension negotiated" \ |
| 2076 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2077 | -c "Copy CIDs into SSL transform" \ |
| 2078 | -S "Use of Connection ID has been negotiated" \ |
| 2079 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2080 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2081 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +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 without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2084 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2085 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2086 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 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): de ad" \ |
| 2092 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 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 | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2098 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2099 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2100 | "$P_CLI debug_level=3 dtls=1 cid=1 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 | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2112 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2113 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2114 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2115 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2116 | 0 \ |
| 2117 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2118 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2119 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2120 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2121 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2122 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2123 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2124 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2125 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2126 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2127 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2128 | 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] | 2129 | -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] | 2130 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2131 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2132 | 0 \ |
| 2133 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2134 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2135 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2136 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2137 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2138 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2139 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2140 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2141 | -c "ignoring unexpected CID" \ |
| 2142 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2143 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2144 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2145 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2146 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2147 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2148 | "$P_CLI debug_level=3 dtls=1 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 | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2160 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2161 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2162 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2163 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2164 | 0 \ |
| 2165 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2166 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2167 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2168 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2169 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2170 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2171 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2172 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2173 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2174 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2175 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2176 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2177 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2178 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2179 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2180 | 0 \ |
| 2181 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2182 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 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" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2188 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2189 | -c "ignoring unexpected CID" \ |
| 2190 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2191 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2192 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2193 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2194 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2195 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2196 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2197 | 0 \ |
| 2198 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2199 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2200 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2201 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2202 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2203 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2204 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2205 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2206 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2207 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2208 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2209 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2210 | 0 \ |
| 2211 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2212 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2213 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2214 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2215 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2216 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2217 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2218 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2219 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2220 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2221 | -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] | 2222 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2223 | "$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" \ |
| 2224 | 0 \ |
| 2225 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2226 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2227 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2228 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2229 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2230 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2231 | -c "ignoring unexpected CID" \ |
| 2232 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2233 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2234 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2235 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2236 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2237 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2238 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2239 | 0 \ |
| 2240 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2241 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2242 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2243 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2244 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2245 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2246 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2247 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2248 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2249 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2250 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2251 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2252 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2253 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2254 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2255 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2256 | 0 \ |
| 2257 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2258 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2259 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2260 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2261 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2262 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2263 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2264 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2265 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2266 | -c "ignoring unexpected CID" \ |
| 2267 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2268 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2269 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2270 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2271 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2272 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2273 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2274 | 0 \ |
| 2275 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2276 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2277 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2278 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2279 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2280 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2281 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2282 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2283 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2284 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2285 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2286 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2287 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2288 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2289 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2290 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2291 | 0 \ |
| 2292 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2293 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2294 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2295 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2296 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2297 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2298 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2299 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2300 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2301 | -c "ignoring unexpected CID" \ |
| 2302 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2303 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2304 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2305 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2306 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2307 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2308 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2309 | 0 \ |
| 2310 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2311 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2312 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2313 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2314 | -s "Reallocating in_buf" \ |
| 2315 | -s "Reallocating out_buf" |
| 2316 | |
| 2317 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2318 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2319 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2320 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2321 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2322 | 0 \ |
| 2323 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2324 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2325 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2326 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2327 | -s "Reallocating in_buf" \ |
| 2328 | -s "Reallocating out_buf" |
| 2329 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2330 | # Tests for Encrypt-then-MAC extension |
| 2331 | |
| 2332 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2333 | "$P_SRV debug_level=3 \ |
| 2334 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2335 | "$P_CLI debug_level=3" \ |
| 2336 | 0 \ |
| 2337 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2338 | -s "found encrypt then mac extension" \ |
| 2339 | -s "server hello, adding encrypt then mac extension" \ |
| 2340 | -c "found encrypt_then_mac extension" \ |
| 2341 | -c "using encrypt then mac" \ |
| 2342 | -s "using encrypt then mac" |
| 2343 | |
| 2344 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2345 | "$P_SRV debug_level=3 etm=0 \ |
| 2346 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2347 | "$P_CLI debug_level=3 etm=1" \ |
| 2348 | 0 \ |
| 2349 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2350 | -s "found encrypt then mac extension" \ |
| 2351 | -S "server hello, adding encrypt then mac extension" \ |
| 2352 | -C "found encrypt_then_mac extension" \ |
| 2353 | -C "using encrypt then mac" \ |
| 2354 | -S "using encrypt then mac" |
| 2355 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2356 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2357 | "$P_SRV debug_level=3 etm=1 \ |
| 2358 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2359 | "$P_CLI debug_level=3 etm=1" \ |
| 2360 | 0 \ |
| 2361 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2362 | -s "found encrypt then mac extension" \ |
| 2363 | -S "server hello, adding encrypt then mac extension" \ |
| 2364 | -C "found encrypt_then_mac extension" \ |
| 2365 | -C "using encrypt then mac" \ |
| 2366 | -S "using encrypt then mac" |
| 2367 | |
| 2368 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2369 | "$P_SRV debug_level=3 etm=1 \ |
| 2370 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2371 | "$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] | 2372 | 0 \ |
| 2373 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2374 | -s "found encrypt then mac extension" \ |
| 2375 | -S "server hello, adding encrypt then mac extension" \ |
| 2376 | -C "found encrypt_then_mac extension" \ |
| 2377 | -C "using encrypt then mac" \ |
| 2378 | -S "using encrypt then mac" |
| 2379 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2380 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2381 | "$P_SRV debug_level=3 etm=1 \ |
| 2382 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2383 | "$P_CLI debug_level=3 etm=0" \ |
| 2384 | 0 \ |
| 2385 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2386 | -S "found encrypt then mac extension" \ |
| 2387 | -S "server hello, adding encrypt then mac extension" \ |
| 2388 | -C "found encrypt_then_mac extension" \ |
| 2389 | -C "using encrypt then mac" \ |
| 2390 | -S "using encrypt then mac" |
| 2391 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2392 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2393 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2394 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2395 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2396 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2397 | 0 \ |
| 2398 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2399 | -S "found encrypt then mac extension" \ |
| 2400 | -S "server hello, adding encrypt then mac extension" \ |
| 2401 | -C "found encrypt_then_mac extension" \ |
| 2402 | -C "using encrypt then mac" \ |
| 2403 | -S "using encrypt then mac" |
| 2404 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2405 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2406 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2407 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2408 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2409 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2410 | 0 \ |
| 2411 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2412 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2413 | -S "server hello, adding encrypt then mac extension" \ |
| 2414 | -C "found encrypt_then_mac extension" \ |
| 2415 | -C "using encrypt then mac" \ |
| 2416 | -S "using encrypt then mac" |
| 2417 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2418 | # Tests for Extended Master Secret extension |
| 2419 | |
| 2420 | run_test "Extended Master Secret: default" \ |
| 2421 | "$P_SRV debug_level=3" \ |
| 2422 | "$P_CLI debug_level=3" \ |
| 2423 | 0 \ |
| 2424 | -c "client hello, adding extended_master_secret extension" \ |
| 2425 | -s "found extended master secret extension" \ |
| 2426 | -s "server hello, adding extended master secret extension" \ |
| 2427 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2428 | -c "session hash for extended master secret" \ |
| 2429 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2430 | |
| 2431 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2432 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2433 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2434 | 0 \ |
| 2435 | -c "client hello, adding extended_master_secret extension" \ |
| 2436 | -s "found extended master secret extension" \ |
| 2437 | -S "server hello, adding extended master secret extension" \ |
| 2438 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2439 | -C "session hash for extended master secret" \ |
| 2440 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2441 | |
| 2442 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2443 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2444 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2445 | 0 \ |
| 2446 | -C "client hello, adding extended_master_secret extension" \ |
| 2447 | -S "found extended master secret extension" \ |
| 2448 | -S "server hello, adding extended master secret extension" \ |
| 2449 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2450 | -C "session hash for extended master secret" \ |
| 2451 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2452 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2453 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2454 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2455 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2456 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2457 | 0 \ |
| 2458 | -C "client hello, adding extended_master_secret extension" \ |
| 2459 | -S "found extended master secret extension" \ |
| 2460 | -S "server hello, adding extended master secret extension" \ |
| 2461 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2462 | -C "session hash for extended master secret" \ |
| 2463 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2464 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2465 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2466 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2467 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2468 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2469 | 0 \ |
| 2470 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2471 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2472 | -S "server hello, adding extended master secret extension" \ |
| 2473 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2474 | -C "session hash for extended master secret" \ |
| 2475 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2476 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2477 | # Tests for FALLBACK_SCSV |
| 2478 | |
| 2479 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2480 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2481 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2482 | 0 \ |
| 2483 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2484 | -S "received FALLBACK_SCSV" \ |
| 2485 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2486 | -C "is a fatal alert message (msg 86)" |
| 2487 | |
| 2488 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2489 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2490 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2491 | 0 \ |
| 2492 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2493 | -S "received FALLBACK_SCSV" \ |
| 2494 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2495 | -C "is a fatal alert message (msg 86)" |
| 2496 | |
| 2497 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2498 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2499 | "$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] | 2500 | 1 \ |
| 2501 | -c "adding FALLBACK_SCSV" \ |
| 2502 | -s "received FALLBACK_SCSV" \ |
| 2503 | -s "inapropriate fallback" \ |
| 2504 | -c "is a fatal alert message (msg 86)" |
| 2505 | |
| 2506 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2507 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2508 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2509 | 0 \ |
| 2510 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2511 | -s "received FALLBACK_SCSV" \ |
| 2512 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2513 | -C "is a fatal alert message (msg 86)" |
| 2514 | |
| 2515 | requires_openssl_with_fallback_scsv |
| 2516 | run_test "Fallback SCSV: default, openssl server" \ |
| 2517 | "$O_SRV" \ |
| 2518 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2519 | 0 \ |
| 2520 | -C "adding FALLBACK_SCSV" \ |
| 2521 | -C "is a fatal alert message (msg 86)" |
| 2522 | |
| 2523 | requires_openssl_with_fallback_scsv |
| 2524 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2525 | "$O_SRV" \ |
| 2526 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2527 | 1 \ |
| 2528 | -c "adding FALLBACK_SCSV" \ |
| 2529 | -c "is a fatal alert message (msg 86)" |
| 2530 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2531 | requires_openssl_with_fallback_scsv |
| 2532 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2533 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2534 | "$O_CLI -tls1_1" \ |
| 2535 | 0 \ |
| 2536 | -S "received FALLBACK_SCSV" \ |
| 2537 | -S "inapropriate fallback" |
| 2538 | |
| 2539 | requires_openssl_with_fallback_scsv |
| 2540 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2541 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2542 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2543 | 1 \ |
| 2544 | -s "received FALLBACK_SCSV" \ |
| 2545 | -s "inapropriate fallback" |
| 2546 | |
| 2547 | requires_openssl_with_fallback_scsv |
| 2548 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2549 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2550 | "$O_CLI -fallback_scsv" \ |
| 2551 | 0 \ |
| 2552 | -s "received FALLBACK_SCSV" \ |
| 2553 | -S "inapropriate fallback" |
| 2554 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2555 | # Test sending and receiving empty application data records |
| 2556 | |
| 2557 | run_test "Encrypt then MAC: empty application data record" \ |
| 2558 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2559 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2560 | 0 \ |
| 2561 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2562 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2563 | -c "0 bytes written in 1 fragments" |
| 2564 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2565 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2566 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2567 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2568 | 0 \ |
| 2569 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2570 | -c "0 bytes written in 1 fragments" |
| 2571 | |
| 2572 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2573 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2574 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2575 | 0 \ |
| 2576 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2577 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2578 | -c "0 bytes written in 1 fragments" |
| 2579 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2580 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2581 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2582 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2583 | 0 \ |
| 2584 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2585 | -c "0 bytes written in 1 fragments" |
| 2586 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2587 | ## ClientHello generated with |
| 2588 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2589 | ## then manually twiddling the ciphersuite list. |
| 2590 | ## The ClientHello content is spelled out below as a hex string as |
| 2591 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2592 | ## The expected response is an inappropriate_fallback alert. |
| 2593 | requires_openssl_with_fallback_scsv |
| 2594 | run_test "Fallback SCSV: beginning of list" \ |
| 2595 | "$P_SRV debug_level=2" \ |
| 2596 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2597 | 0 \ |
| 2598 | -s "received FALLBACK_SCSV" \ |
| 2599 | -s "inapropriate fallback" |
| 2600 | |
| 2601 | requires_openssl_with_fallback_scsv |
| 2602 | run_test "Fallback SCSV: end of list" \ |
| 2603 | "$P_SRV debug_level=2" \ |
| 2604 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2605 | 0 \ |
| 2606 | -s "received FALLBACK_SCSV" \ |
| 2607 | -s "inapropriate fallback" |
| 2608 | |
| 2609 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2610 | requires_openssl_with_fallback_scsv |
| 2611 | run_test "Fallback SCSV: not in list" \ |
| 2612 | "$P_SRV debug_level=2" \ |
| 2613 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2614 | 0 \ |
| 2615 | -S "received FALLBACK_SCSV" \ |
| 2616 | -S "inapropriate fallback" |
| 2617 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2618 | # Tests for CBC 1/n-1 record splitting |
| 2619 | |
| 2620 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2621 | "$P_SRV" \ |
| 2622 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2623 | request_size=123 force_version=tls1_2" \ |
| 2624 | 0 \ |
| 2625 | -s "Read from client: 123 bytes read" \ |
| 2626 | -S "Read from client: 1 bytes read" \ |
| 2627 | -S "122 bytes read" |
| 2628 | |
| 2629 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2630 | "$P_SRV" \ |
| 2631 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2632 | request_size=123 force_version=tls1_1" \ |
| 2633 | 0 \ |
| 2634 | -s "Read from client: 123 bytes read" \ |
| 2635 | -S "Read from client: 1 bytes read" \ |
| 2636 | -S "122 bytes read" |
| 2637 | |
| 2638 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2639 | "$P_SRV" \ |
| 2640 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2641 | request_size=123 force_version=tls1" \ |
| 2642 | 0 \ |
| 2643 | -S "Read from client: 123 bytes read" \ |
| 2644 | -s "Read from client: 1 bytes read" \ |
| 2645 | -s "122 bytes read" |
| 2646 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2647 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2648 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2649 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2650 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2651 | request_size=123 force_version=ssl3" \ |
| 2652 | 0 \ |
| 2653 | -S "Read from client: 123 bytes read" \ |
| 2654 | -s "Read from client: 1 bytes read" \ |
| 2655 | -s "122 bytes read" |
| 2656 | |
| 2657 | 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] | 2658 | "$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] | 2659 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2660 | request_size=123 force_version=tls1" \ |
| 2661 | 0 \ |
| 2662 | -s "Read from client: 123 bytes read" \ |
| 2663 | -S "Read from client: 1 bytes read" \ |
| 2664 | -S "122 bytes read" |
| 2665 | |
| 2666 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2667 | "$P_SRV" \ |
| 2668 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2669 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2670 | 0 \ |
| 2671 | -s "Read from client: 123 bytes read" \ |
| 2672 | -S "Read from client: 1 bytes read" \ |
| 2673 | -S "122 bytes read" |
| 2674 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2675 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2676 | "$P_SRV nbio=2" \ |
| 2677 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2678 | request_size=123 force_version=tls1" \ |
| 2679 | 0 \ |
| 2680 | -S "Read from client: 123 bytes read" \ |
| 2681 | -s "Read from client: 1 bytes read" \ |
| 2682 | -s "122 bytes read" |
| 2683 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2684 | # Tests for Session Tickets |
| 2685 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2686 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2687 | "$P_SRV debug_level=3 tickets=1" \ |
| 2688 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2689 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2690 | -c "client hello, adding session ticket extension" \ |
| 2691 | -s "found session ticket extension" \ |
| 2692 | -s "server hello, adding session ticket extension" \ |
| 2693 | -c "found session_ticket extension" \ |
| 2694 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2695 | -S "session successfully restored from cache" \ |
| 2696 | -s "session successfully restored from ticket" \ |
| 2697 | -s "a session has been resumed" \ |
| 2698 | -c "a session has been resumed" |
| 2699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2700 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2701 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2702 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2703 | 0 \ |
| 2704 | -c "client hello, adding session ticket extension" \ |
| 2705 | -s "found session ticket extension" \ |
| 2706 | -s "server hello, adding session ticket extension" \ |
| 2707 | -c "found session_ticket extension" \ |
| 2708 | -c "parse new session ticket" \ |
| 2709 | -S "session successfully restored from cache" \ |
| 2710 | -s "session successfully restored from ticket" \ |
| 2711 | -s "a session has been resumed" \ |
| 2712 | -c "a session has been resumed" |
| 2713 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2714 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2715 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2716 | "$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] | 2717 | 0 \ |
| 2718 | -c "client hello, adding session ticket extension" \ |
| 2719 | -s "found session ticket extension" \ |
| 2720 | -s "server hello, adding session ticket extension" \ |
| 2721 | -c "found session_ticket extension" \ |
| 2722 | -c "parse new session ticket" \ |
| 2723 | -S "session successfully restored from cache" \ |
| 2724 | -S "session successfully restored from ticket" \ |
| 2725 | -S "a session has been resumed" \ |
| 2726 | -C "a session has been resumed" |
| 2727 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2728 | run_test "Session resume using tickets: session copy" \ |
| 2729 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2730 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2731 | 0 \ |
| 2732 | -c "client hello, adding session ticket extension" \ |
| 2733 | -s "found session ticket extension" \ |
| 2734 | -s "server hello, adding session ticket extension" \ |
| 2735 | -c "found session_ticket extension" \ |
| 2736 | -c "parse new session ticket" \ |
| 2737 | -S "session successfully restored from cache" \ |
| 2738 | -s "session successfully restored from ticket" \ |
| 2739 | -s "a session has been resumed" \ |
| 2740 | -c "a session has been resumed" |
| 2741 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2742 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2743 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2744 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2745 | 0 \ |
| 2746 | -c "client hello, adding session ticket extension" \ |
| 2747 | -c "found session_ticket extension" \ |
| 2748 | -c "parse new session ticket" \ |
| 2749 | -c "a session has been resumed" |
| 2750 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2751 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2752 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2753 | "( $O_CLI -sess_out $SESSION; \ |
| 2754 | $O_CLI -sess_in $SESSION; \ |
| 2755 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2756 | 0 \ |
| 2757 | -s "found session ticket extension" \ |
| 2758 | -s "server hello, adding session ticket extension" \ |
| 2759 | -S "session successfully restored from cache" \ |
| 2760 | -s "session successfully restored from ticket" \ |
| 2761 | -s "a session has been resumed" |
| 2762 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2763 | # Tests for Session Tickets with DTLS |
| 2764 | |
| 2765 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2766 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2767 | "$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] | 2768 | 0 \ |
| 2769 | -c "client hello, adding session ticket extension" \ |
| 2770 | -s "found session ticket extension" \ |
| 2771 | -s "server hello, adding session ticket extension" \ |
| 2772 | -c "found session_ticket extension" \ |
| 2773 | -c "parse new session ticket" \ |
| 2774 | -S "session successfully restored from cache" \ |
| 2775 | -s "session successfully restored from ticket" \ |
| 2776 | -s "a session has been resumed" \ |
| 2777 | -c "a session has been resumed" |
| 2778 | |
| 2779 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2780 | "$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] | 2781 | "$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] | 2782 | 0 \ |
| 2783 | -c "client hello, adding session ticket extension" \ |
| 2784 | -s "found session ticket extension" \ |
| 2785 | -s "server hello, adding session ticket extension" \ |
| 2786 | -c "found session_ticket extension" \ |
| 2787 | -c "parse new session ticket" \ |
| 2788 | -S "session successfully restored from cache" \ |
| 2789 | -s "session successfully restored from ticket" \ |
| 2790 | -s "a session has been resumed" \ |
| 2791 | -c "a session has been resumed" |
| 2792 | |
| 2793 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2794 | "$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] | 2795 | "$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] | 2796 | 0 \ |
| 2797 | -c "client hello, adding session ticket extension" \ |
| 2798 | -s "found session ticket extension" \ |
| 2799 | -s "server hello, adding session ticket extension" \ |
| 2800 | -c "found session_ticket extension" \ |
| 2801 | -c "parse new session ticket" \ |
| 2802 | -S "session successfully restored from cache" \ |
| 2803 | -S "session successfully restored from ticket" \ |
| 2804 | -S "a session has been resumed" \ |
| 2805 | -C "a session has been resumed" |
| 2806 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2807 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2808 | "$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] | 2809 | "$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] | 2810 | 0 \ |
| 2811 | -c "client hello, adding session ticket extension" \ |
| 2812 | -s "found session ticket extension" \ |
| 2813 | -s "server hello, adding session ticket extension" \ |
| 2814 | -c "found session_ticket extension" \ |
| 2815 | -c "parse new session ticket" \ |
| 2816 | -S "session successfully restored from cache" \ |
| 2817 | -s "session successfully restored from ticket" \ |
| 2818 | -s "a session has been resumed" \ |
| 2819 | -c "a session has been resumed" |
| 2820 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2821 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2822 | "$O_SRV -dtls1" \ |
| 2823 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2824 | 0 \ |
| 2825 | -c "client hello, adding session ticket extension" \ |
| 2826 | -c "found session_ticket extension" \ |
| 2827 | -c "parse new session ticket" \ |
| 2828 | -c "a session has been resumed" |
| 2829 | |
| 2830 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2831 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2832 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2833 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2834 | rm -f $SESSION )" \ |
| 2835 | 0 \ |
| 2836 | -s "found session ticket extension" \ |
| 2837 | -s "server hello, adding session ticket extension" \ |
| 2838 | -S "session successfully restored from cache" \ |
| 2839 | -s "session successfully restored from ticket" \ |
| 2840 | -s "a session has been resumed" |
| 2841 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2842 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2843 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2844 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2845 | "$P_SRV debug_level=3 tickets=0" \ |
| 2846 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2847 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2848 | -c "client hello, adding session ticket extension" \ |
| 2849 | -s "found session ticket extension" \ |
| 2850 | -S "server hello, adding session ticket extension" \ |
| 2851 | -C "found session_ticket extension" \ |
| 2852 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2853 | -s "session successfully restored from cache" \ |
| 2854 | -S "session successfully restored from ticket" \ |
| 2855 | -s "a session has been resumed" \ |
| 2856 | -c "a session has been resumed" |
| 2857 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2858 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2859 | "$P_SRV debug_level=3 tickets=1" \ |
| 2860 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2861 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2862 | -C "client hello, adding session ticket extension" \ |
| 2863 | -S "found session ticket extension" \ |
| 2864 | -S "server hello, adding session ticket extension" \ |
| 2865 | -C "found session_ticket extension" \ |
| 2866 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2867 | -s "session successfully restored from cache" \ |
| 2868 | -S "session successfully restored from ticket" \ |
| 2869 | -s "a session has been resumed" \ |
| 2870 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2871 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2872 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2873 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2874 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2875 | 0 \ |
| 2876 | -S "session successfully restored from cache" \ |
| 2877 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2878 | -S "a session has been resumed" \ |
| 2879 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2880 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2881 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2882 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2883 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2884 | 0 \ |
| 2885 | -s "session successfully restored from cache" \ |
| 2886 | -S "session successfully restored from ticket" \ |
| 2887 | -s "a session has been resumed" \ |
| 2888 | -c "a session has been resumed" |
| 2889 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2890 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2891 | "$P_SRV debug_level=3 tickets=0" \ |
| 2892 | "$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] | 2893 | 0 \ |
| 2894 | -s "session successfully restored from cache" \ |
| 2895 | -S "session successfully restored from ticket" \ |
| 2896 | -s "a session has been resumed" \ |
| 2897 | -c "a session has been resumed" |
| 2898 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2899 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2900 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2901 | "$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] | 2902 | 0 \ |
| 2903 | -S "session successfully restored from cache" \ |
| 2904 | -S "session successfully restored from ticket" \ |
| 2905 | -S "a session has been resumed" \ |
| 2906 | -C "a session has been resumed" |
| 2907 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2908 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2909 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2910 | "$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] | 2911 | 0 \ |
| 2912 | -s "session successfully restored from cache" \ |
| 2913 | -S "session successfully restored from ticket" \ |
| 2914 | -s "a session has been resumed" \ |
| 2915 | -c "a session has been resumed" |
| 2916 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2917 | run_test "Session resume using cache: session copy" \ |
| 2918 | "$P_SRV debug_level=3 tickets=0" \ |
| 2919 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2920 | 0 \ |
| 2921 | -s "session successfully restored from cache" \ |
| 2922 | -S "session successfully restored from ticket" \ |
| 2923 | -s "a session has been resumed" \ |
| 2924 | -c "a session has been resumed" |
| 2925 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2926 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2927 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2928 | "( $O_CLI -sess_out $SESSION; \ |
| 2929 | $O_CLI -sess_in $SESSION; \ |
| 2930 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2931 | 0 \ |
| 2932 | -s "found session ticket extension" \ |
| 2933 | -S "server hello, adding session ticket extension" \ |
| 2934 | -s "session successfully restored from cache" \ |
| 2935 | -S "session successfully restored from ticket" \ |
| 2936 | -s "a session has been resumed" |
| 2937 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2938 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2939 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2940 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2941 | 0 \ |
| 2942 | -C "found session_ticket extension" \ |
| 2943 | -C "parse new session ticket" \ |
| 2944 | -c "a session has been resumed" |
| 2945 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2946 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2947 | |
| 2948 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2949 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2950 | "$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] | 2951 | 0 \ |
| 2952 | -c "client hello, adding session ticket extension" \ |
| 2953 | -s "found session ticket extension" \ |
| 2954 | -S "server hello, adding session ticket extension" \ |
| 2955 | -C "found session_ticket extension" \ |
| 2956 | -C "parse new session ticket" \ |
| 2957 | -s "session successfully restored from cache" \ |
| 2958 | -S "session successfully restored from ticket" \ |
| 2959 | -s "a session has been resumed" \ |
| 2960 | -c "a session has been resumed" |
| 2961 | |
| 2962 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2963 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2964 | "$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] | 2965 | 0 \ |
| 2966 | -C "client hello, adding session ticket extension" \ |
| 2967 | -S "found session ticket extension" \ |
| 2968 | -S "server hello, adding session ticket extension" \ |
| 2969 | -C "found session_ticket extension" \ |
| 2970 | -C "parse new session ticket" \ |
| 2971 | -s "session successfully restored from cache" \ |
| 2972 | -S "session successfully restored from ticket" \ |
| 2973 | -s "a session has been resumed" \ |
| 2974 | -c "a session has been resumed" |
| 2975 | |
| 2976 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2977 | "$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] | 2978 | "$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] | 2979 | 0 \ |
| 2980 | -S "session successfully restored from cache" \ |
| 2981 | -S "session successfully restored from ticket" \ |
| 2982 | -S "a session has been resumed" \ |
| 2983 | -C "a session has been resumed" |
| 2984 | |
| 2985 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2986 | "$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] | 2987 | "$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] | 2988 | 0 \ |
| 2989 | -s "session successfully restored from cache" \ |
| 2990 | -S "session successfully restored from ticket" \ |
| 2991 | -s "a session has been resumed" \ |
| 2992 | -c "a session has been resumed" |
| 2993 | |
| 2994 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2995 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2996 | "$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] | 2997 | 0 \ |
| 2998 | -s "session successfully restored from cache" \ |
| 2999 | -S "session successfully restored from ticket" \ |
| 3000 | -s "a session has been resumed" \ |
| 3001 | -c "a session has been resumed" |
| 3002 | |
| 3003 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3004 | "$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] | 3005 | "$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] | 3006 | 0 \ |
| 3007 | -S "session successfully restored from cache" \ |
| 3008 | -S "session successfully restored from ticket" \ |
| 3009 | -S "a session has been resumed" \ |
| 3010 | -C "a session has been resumed" |
| 3011 | |
| 3012 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3013 | "$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] | 3014 | "$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] | 3015 | 0 \ |
| 3016 | -s "session successfully restored from cache" \ |
| 3017 | -S "session successfully restored from ticket" \ |
| 3018 | -s "a session has been resumed" \ |
| 3019 | -c "a session has been resumed" |
| 3020 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3021 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3022 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3023 | "$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] | 3024 | 0 \ |
| 3025 | -s "session successfully restored from cache" \ |
| 3026 | -S "session successfully restored from ticket" \ |
| 3027 | -s "a session has been resumed" \ |
| 3028 | -c "a session has been resumed" |
| 3029 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3030 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3031 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 3032 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 3033 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 3034 | rm -f $SESSION )" \ |
| 3035 | 0 \ |
| 3036 | -s "found session ticket extension" \ |
| 3037 | -S "server hello, adding session ticket extension" \ |
| 3038 | -s "session successfully restored from cache" \ |
| 3039 | -S "session successfully restored from ticket" \ |
| 3040 | -s "a session has been resumed" |
| 3041 | |
| 3042 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3043 | "$O_SRV -dtls1" \ |
| 3044 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3045 | 0 \ |
| 3046 | -C "found session_ticket extension" \ |
| 3047 | -C "parse new session ticket" \ |
| 3048 | -c "a session has been resumed" |
| 3049 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3050 | # Tests for Max Fragment Length extension |
| 3051 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3052 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3053 | 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] | 3054 | exit 1 |
| 3055 | fi |
| 3056 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3057 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3058 | echo "Using non-default maximum content length $MAX_CONTENT_LEN" |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3059 | fi |
| 3060 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3061 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3062 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3063 | "$P_SRV debug_level=3" \ |
| 3064 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3065 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3066 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3067 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3068 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3069 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3070 | -C "client hello, adding max_fragment_length extension" \ |
| 3071 | -S "found max fragment length extension" \ |
| 3072 | -S "server hello, max_fragment_length extension" \ |
| 3073 | -C "found max_fragment_length extension" |
| 3074 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3075 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3076 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3077 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3078 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3079 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3080 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3081 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3082 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3083 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3084 | -C "client hello, adding max_fragment_length extension" \ |
| 3085 | -S "found max fragment length extension" \ |
| 3086 | -S "server hello, max_fragment_length extension" \ |
| 3087 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3088 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3089 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3090 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3091 | |
| 3092 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3093 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3094 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3095 | "$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] | 3096 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3097 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3098 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3099 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3100 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3101 | -C "client hello, adding max_fragment_length extension" \ |
| 3102 | -S "found max fragment length extension" \ |
| 3103 | -S "server hello, max_fragment_length extension" \ |
| 3104 | -C "found max_fragment_length extension" \ |
| 3105 | -c "fragment larger than.*maximum " |
| 3106 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3107 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3108 | # (session fragment length will be 16384 regardless of mbedtls |
| 3109 | # content length configuration.) |
| 3110 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3111 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3112 | run_test "Max fragment length: disabled, larger message" \ |
| 3113 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3114 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3115 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3116 | -C "Maximum input fragment length is 16384" \ |
| 3117 | -C "Maximum output fragment length is 16384" \ |
| 3118 | -S "Maximum input fragment length is 16384" \ |
| 3119 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3120 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3121 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3122 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3123 | |
| 3124 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3125 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 3126 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3127 | "$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] | 3128 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3129 | -C "Maximum input fragment length is 16384" \ |
| 3130 | -C "Maximum output fragment length is 16384" \ |
| 3131 | -S "Maximum input fragment length is 16384" \ |
| 3132 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3133 | -c "fragment larger than.*maximum " |
| 3134 | |
| 3135 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3136 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3137 | "$P_SRV debug_level=3" \ |
| 3138 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3139 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3140 | -c "Maximum input fragment length is 4096" \ |
| 3141 | -c "Maximum output fragment length is 4096" \ |
| 3142 | -s "Maximum input fragment length is 4096" \ |
| 3143 | -s "Maximum output fragment length is 4096" \ |
| 3144 | -c "client hello, adding max_fragment_length extension" \ |
| 3145 | -s "found max fragment length extension" \ |
| 3146 | -s "server hello, max_fragment_length extension" \ |
| 3147 | -c "found max_fragment_length extension" |
| 3148 | |
| 3149 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3150 | run_test "Max fragment length: client 512, server 1024" \ |
| 3151 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3152 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3153 | 0 \ |
| 3154 | -c "Maximum input fragment length is 512" \ |
| 3155 | -c "Maximum output fragment length is 512" \ |
| 3156 | -s "Maximum input fragment length is 512" \ |
| 3157 | -s "Maximum output fragment length is 512" \ |
| 3158 | -c "client hello, adding max_fragment_length extension" \ |
| 3159 | -s "found max fragment length extension" \ |
| 3160 | -s "server hello, max_fragment_length extension" \ |
| 3161 | -c "found max_fragment_length extension" |
| 3162 | |
| 3163 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3164 | run_test "Max fragment length: client 512, server 2048" \ |
| 3165 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3166 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3167 | 0 \ |
| 3168 | -c "Maximum input fragment length is 512" \ |
| 3169 | -c "Maximum output fragment length is 512" \ |
| 3170 | -s "Maximum input fragment length is 512" \ |
| 3171 | -s "Maximum output fragment length is 512" \ |
| 3172 | -c "client hello, adding max_fragment_length extension" \ |
| 3173 | -s "found max fragment length extension" \ |
| 3174 | -s "server hello, max_fragment_length extension" \ |
| 3175 | -c "found max_fragment_length extension" |
| 3176 | |
| 3177 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3178 | run_test "Max fragment length: client 512, server 4096" \ |
| 3179 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3180 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3181 | 0 \ |
| 3182 | -c "Maximum input fragment length is 512" \ |
| 3183 | -c "Maximum output fragment length is 512" \ |
| 3184 | -s "Maximum input fragment length is 512" \ |
| 3185 | -s "Maximum output fragment length is 512" \ |
| 3186 | -c "client hello, adding max_fragment_length extension" \ |
| 3187 | -s "found max fragment length extension" \ |
| 3188 | -s "server hello, max_fragment_length extension" \ |
| 3189 | -c "found max_fragment_length extension" |
| 3190 | |
| 3191 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3192 | run_test "Max fragment length: client 1024, server 512" \ |
| 3193 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3194 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3195 | 0 \ |
| 3196 | -c "Maximum input fragment length is 1024" \ |
| 3197 | -c "Maximum output fragment length is 1024" \ |
| 3198 | -s "Maximum input fragment length is 1024" \ |
| 3199 | -s "Maximum output fragment length is 512" \ |
| 3200 | -c "client hello, adding max_fragment_length extension" \ |
| 3201 | -s "found max fragment length extension" \ |
| 3202 | -s "server hello, max_fragment_length extension" \ |
| 3203 | -c "found max_fragment_length extension" |
| 3204 | |
| 3205 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3206 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3207 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3208 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3209 | 0 \ |
| 3210 | -c "Maximum input fragment length is 1024" \ |
| 3211 | -c "Maximum output fragment length is 1024" \ |
| 3212 | -s "Maximum input fragment length is 1024" \ |
| 3213 | -s "Maximum output fragment length is 1024" \ |
| 3214 | -c "client hello, adding max_fragment_length extension" \ |
| 3215 | -s "found max fragment length extension" \ |
| 3216 | -s "server hello, max_fragment_length extension" \ |
| 3217 | -c "found max_fragment_length extension" |
| 3218 | |
| 3219 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3220 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3221 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3222 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3223 | 0 \ |
| 3224 | -c "Maximum input fragment length is 1024" \ |
| 3225 | -c "Maximum output fragment length is 1024" \ |
| 3226 | -s "Maximum input fragment length is 1024" \ |
| 3227 | -s "Maximum output fragment length is 1024" \ |
| 3228 | -c "client hello, adding max_fragment_length extension" \ |
| 3229 | -s "found max fragment length extension" \ |
| 3230 | -s "server hello, max_fragment_length extension" \ |
| 3231 | -c "found max_fragment_length extension" |
| 3232 | |
| 3233 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3234 | run_test "Max fragment length: client 2048, server 512" \ |
| 3235 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3236 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3237 | 0 \ |
| 3238 | -c "Maximum input fragment length is 2048" \ |
| 3239 | -c "Maximum output fragment length is 2048" \ |
| 3240 | -s "Maximum input fragment length is 2048" \ |
| 3241 | -s "Maximum output fragment length is 512" \ |
| 3242 | -c "client hello, adding max_fragment_length extension" \ |
| 3243 | -s "found max fragment length extension" \ |
| 3244 | -s "server hello, max_fragment_length extension" \ |
| 3245 | -c "found max_fragment_length extension" |
| 3246 | |
| 3247 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3248 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3249 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3250 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3251 | 0 \ |
| 3252 | -c "Maximum input fragment length is 2048" \ |
| 3253 | -c "Maximum output fragment length is 2048" \ |
| 3254 | -s "Maximum input fragment length is 2048" \ |
| 3255 | -s "Maximum output fragment length is 1024" \ |
| 3256 | -c "client hello, adding max_fragment_length extension" \ |
| 3257 | -s "found max fragment length extension" \ |
| 3258 | -s "server hello, max_fragment_length extension" \ |
| 3259 | -c "found max_fragment_length extension" |
| 3260 | |
| 3261 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3262 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3263 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3264 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3265 | 0 \ |
| 3266 | -c "Maximum input fragment length is 2048" \ |
| 3267 | -c "Maximum output fragment length is 2048" \ |
| 3268 | -s "Maximum input fragment length is 2048" \ |
| 3269 | -s "Maximum output fragment length is 2048" \ |
| 3270 | -c "client hello, adding max_fragment_length extension" \ |
| 3271 | -s "found max fragment length extension" \ |
| 3272 | -s "server hello, max_fragment_length extension" \ |
| 3273 | -c "found max_fragment_length extension" |
| 3274 | |
| 3275 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3276 | run_test "Max fragment length: client 4096, server 512" \ |
| 3277 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3278 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3279 | 0 \ |
| 3280 | -c "Maximum input fragment length is 4096" \ |
| 3281 | -c "Maximum output fragment length is 4096" \ |
| 3282 | -s "Maximum input fragment length is 4096" \ |
| 3283 | -s "Maximum output fragment length is 512" \ |
| 3284 | -c "client hello, adding max_fragment_length extension" \ |
| 3285 | -s "found max fragment length extension" \ |
| 3286 | -s "server hello, max_fragment_length extension" \ |
| 3287 | -c "found max_fragment_length extension" |
| 3288 | |
| 3289 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3290 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3291 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3292 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3293 | 0 \ |
| 3294 | -c "Maximum input fragment length is 4096" \ |
| 3295 | -c "Maximum output fragment length is 4096" \ |
| 3296 | -s "Maximum input fragment length is 4096" \ |
| 3297 | -s "Maximum output fragment length is 1024" \ |
| 3298 | -c "client hello, adding max_fragment_length extension" \ |
| 3299 | -s "found max fragment length extension" \ |
| 3300 | -s "server hello, max_fragment_length extension" \ |
| 3301 | -c "found max_fragment_length extension" |
| 3302 | |
| 3303 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3304 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3305 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3306 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3307 | 0 \ |
| 3308 | -c "Maximum input fragment length is 4096" \ |
| 3309 | -c "Maximum output fragment length is 4096" \ |
| 3310 | -s "Maximum input fragment length is 4096" \ |
| 3311 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3312 | -c "client hello, adding max_fragment_length extension" \ |
| 3313 | -s "found max fragment length extension" \ |
| 3314 | -s "server hello, max_fragment_length extension" \ |
| 3315 | -c "found max_fragment_length extension" |
| 3316 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3318 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3319 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3320 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3321 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3322 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3323 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3324 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3325 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3326 | -C "client hello, adding max_fragment_length extension" \ |
| 3327 | -S "found max fragment length extension" \ |
| 3328 | -S "server hello, max_fragment_length extension" \ |
| 3329 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3330 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3331 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3332 | requires_gnutls |
| 3333 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3334 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3335 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3336 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3337 | -c "Maximum input fragment length is 4096" \ |
| 3338 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3339 | -c "client hello, adding max_fragment_length extension" \ |
| 3340 | -c "found max_fragment_length extension" |
| 3341 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3342 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3343 | run_test "Max fragment length: client, message just fits" \ |
| 3344 | "$P_SRV debug_level=3" \ |
| 3345 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3346 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3347 | -c "Maximum input fragment length is 2048" \ |
| 3348 | -c "Maximum output fragment length is 2048" \ |
| 3349 | -s "Maximum input fragment length is 2048" \ |
| 3350 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3351 | -c "client hello, adding max_fragment_length extension" \ |
| 3352 | -s "found max fragment length extension" \ |
| 3353 | -s "server hello, max_fragment_length extension" \ |
| 3354 | -c "found max_fragment_length extension" \ |
| 3355 | -c "2048 bytes written in 1 fragments" \ |
| 3356 | -s "2048 bytes read" |
| 3357 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3358 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3359 | run_test "Max fragment length: client, larger message" \ |
| 3360 | "$P_SRV debug_level=3" \ |
| 3361 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3362 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3363 | -c "Maximum input fragment length is 2048" \ |
| 3364 | -c "Maximum output fragment length is 2048" \ |
| 3365 | -s "Maximum input fragment length is 2048" \ |
| 3366 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3367 | -c "client hello, adding max_fragment_length extension" \ |
| 3368 | -s "found max fragment length extension" \ |
| 3369 | -s "server hello, max_fragment_length extension" \ |
| 3370 | -c "found max_fragment_length extension" \ |
| 3371 | -c "2345 bytes written in 2 fragments" \ |
| 3372 | -s "2048 bytes read" \ |
| 3373 | -s "297 bytes read" |
| 3374 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3375 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3376 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3377 | "$P_SRV debug_level=3 dtls=1" \ |
| 3378 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3379 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3380 | -c "Maximum input fragment length is 2048" \ |
| 3381 | -c "Maximum output fragment length is 2048" \ |
| 3382 | -s "Maximum input fragment length is 2048" \ |
| 3383 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3384 | -c "client hello, adding max_fragment_length extension" \ |
| 3385 | -s "found max fragment length extension" \ |
| 3386 | -s "server hello, max_fragment_length extension" \ |
| 3387 | -c "found max_fragment_length extension" \ |
| 3388 | -c "fragment larger than.*maximum" |
| 3389 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3390 | # Tests for renegotiation |
| 3391 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3392 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3393 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3394 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3395 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3396 | 0 \ |
| 3397 | -C "client hello, adding renegotiation extension" \ |
| 3398 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3399 | -S "found renegotiation extension" \ |
| 3400 | -s "server hello, secure renegotiation extension" \ |
| 3401 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3402 | -C "=> renegotiate" \ |
| 3403 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3404 | -S "write hello request" |
| 3405 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3406 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3407 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3408 | "$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] | 3409 | "$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] | 3410 | 0 \ |
| 3411 | -c "client hello, adding renegotiation extension" \ |
| 3412 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3413 | -s "found renegotiation extension" \ |
| 3414 | -s "server hello, secure renegotiation extension" \ |
| 3415 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3416 | -c "=> renegotiate" \ |
| 3417 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3418 | -S "write hello request" |
| 3419 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3420 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3421 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3422 | "$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] | 3423 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3424 | 0 \ |
| 3425 | -c "client hello, adding renegotiation extension" \ |
| 3426 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3427 | -s "found renegotiation extension" \ |
| 3428 | -s "server hello, secure renegotiation extension" \ |
| 3429 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3430 | -c "=> renegotiate" \ |
| 3431 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3432 | -s "write hello request" |
| 3433 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3434 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3435 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3436 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3437 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3438 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3439 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3440 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3441 | 0 \ |
| 3442 | -c "client hello, adding renegotiation extension" \ |
| 3443 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3444 | -s "found renegotiation extension" \ |
| 3445 | -s "server hello, secure renegotiation extension" \ |
| 3446 | -c "found renegotiation extension" \ |
| 3447 | -c "=> renegotiate" \ |
| 3448 | -s "=> renegotiate" \ |
| 3449 | -S "write hello request" \ |
| 3450 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3451 | |
| 3452 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3453 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3454 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3455 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3456 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3457 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3458 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3459 | 0 \ |
| 3460 | -c "client hello, adding renegotiation extension" \ |
| 3461 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3462 | -s "found renegotiation extension" \ |
| 3463 | -s "server hello, secure renegotiation extension" \ |
| 3464 | -c "found renegotiation extension" \ |
| 3465 | -c "=> renegotiate" \ |
| 3466 | -s "=> renegotiate" \ |
| 3467 | -s "write hello request" \ |
| 3468 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3469 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3471 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3472 | "$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] | 3473 | "$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] | 3474 | 0 \ |
| 3475 | -c "client hello, adding renegotiation extension" \ |
| 3476 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3477 | -s "found renegotiation extension" \ |
| 3478 | -s "server hello, secure renegotiation extension" \ |
| 3479 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3480 | -c "=> renegotiate" \ |
| 3481 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3482 | -s "write hello request" |
| 3483 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3484 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3486 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3487 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3488 | "$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" \ |
| 3489 | 0 \ |
| 3490 | -c "Maximum input fragment length is 2048" \ |
| 3491 | -c "Maximum output fragment length is 2048" \ |
| 3492 | -s "Maximum input fragment length is 2048" \ |
| 3493 | -s "Maximum output fragment length is 512" \ |
| 3494 | -c "client hello, adding max_fragment_length extension" \ |
| 3495 | -s "found max fragment length extension" \ |
| 3496 | -s "server hello, max_fragment_length extension" \ |
| 3497 | -c "found max_fragment_length extension" \ |
| 3498 | -c "client hello, adding renegotiation extension" \ |
| 3499 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3500 | -s "found renegotiation extension" \ |
| 3501 | -s "server hello, secure renegotiation extension" \ |
| 3502 | -c "found renegotiation extension" \ |
| 3503 | -c "=> renegotiate" \ |
| 3504 | -s "=> renegotiate" \ |
| 3505 | -s "write hello request" |
| 3506 | |
| 3507 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3508 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3509 | "$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] | 3510 | "$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] | 3511 | 1 \ |
| 3512 | -c "client hello, adding renegotiation extension" \ |
| 3513 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3514 | -S "found renegotiation extension" \ |
| 3515 | -s "server hello, secure renegotiation extension" \ |
| 3516 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3517 | -c "=> renegotiate" \ |
| 3518 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3519 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3520 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3521 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3522 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3523 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3524 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3525 | "$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] | 3526 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3527 | 0 \ |
| 3528 | -C "client hello, adding renegotiation extension" \ |
| 3529 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3530 | -S "found renegotiation extension" \ |
| 3531 | -s "server hello, secure renegotiation extension" \ |
| 3532 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3533 | -C "=> renegotiate" \ |
| 3534 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3535 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3536 | -S "SSL - An unexpected message was received from our peer" \ |
| 3537 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3538 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3540 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3541 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3542 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3543 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3544 | 0 \ |
| 3545 | -C "client hello, adding renegotiation extension" \ |
| 3546 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3547 | -S "found renegotiation extension" \ |
| 3548 | -s "server hello, secure renegotiation extension" \ |
| 3549 | -c "found renegotiation extension" \ |
| 3550 | -C "=> renegotiate" \ |
| 3551 | -S "=> renegotiate" \ |
| 3552 | -s "write hello request" \ |
| 3553 | -S "SSL - An unexpected message was received from our peer" \ |
| 3554 | -S "failed" |
| 3555 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3556 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3558 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3559 | "$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] | 3560 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3561 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3562 | 0 \ |
| 3563 | -C "client hello, adding renegotiation extension" \ |
| 3564 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3565 | -S "found renegotiation extension" \ |
| 3566 | -s "server hello, secure renegotiation extension" \ |
| 3567 | -c "found renegotiation extension" \ |
| 3568 | -C "=> renegotiate" \ |
| 3569 | -S "=> renegotiate" \ |
| 3570 | -s "write hello request" \ |
| 3571 | -S "SSL - An unexpected message was received from our peer" \ |
| 3572 | -S "failed" |
| 3573 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3574 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3575 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3576 | "$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] | 3577 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3578 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3579 | 0 \ |
| 3580 | -C "client hello, adding renegotiation extension" \ |
| 3581 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3582 | -S "found renegotiation extension" \ |
| 3583 | -s "server hello, secure renegotiation extension" \ |
| 3584 | -c "found renegotiation extension" \ |
| 3585 | -C "=> renegotiate" \ |
| 3586 | -S "=> renegotiate" \ |
| 3587 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3588 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3589 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3590 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3591 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3592 | "$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] | 3593 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3594 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3595 | 0 \ |
| 3596 | -c "client hello, adding renegotiation extension" \ |
| 3597 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3598 | -s "found renegotiation extension" \ |
| 3599 | -s "server hello, secure renegotiation extension" \ |
| 3600 | -c "found renegotiation extension" \ |
| 3601 | -c "=> renegotiate" \ |
| 3602 | -s "=> renegotiate" \ |
| 3603 | -s "write hello request" \ |
| 3604 | -S "SSL - An unexpected message was received from our peer" \ |
| 3605 | -S "failed" |
| 3606 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3607 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3608 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3609 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3610 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3611 | 0 \ |
| 3612 | -C "client hello, adding renegotiation extension" \ |
| 3613 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3614 | -S "found renegotiation extension" \ |
| 3615 | -s "server hello, secure renegotiation extension" \ |
| 3616 | -c "found renegotiation extension" \ |
| 3617 | -S "record counter limit reached: renegotiate" \ |
| 3618 | -C "=> renegotiate" \ |
| 3619 | -S "=> renegotiate" \ |
| 3620 | -S "write hello request" \ |
| 3621 | -S "SSL - An unexpected message was received from our peer" \ |
| 3622 | -S "failed" |
| 3623 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3624 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3625 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3626 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3627 | "$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] | 3628 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3629 | 0 \ |
| 3630 | -c "client hello, adding renegotiation extension" \ |
| 3631 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3632 | -s "found renegotiation extension" \ |
| 3633 | -s "server hello, secure renegotiation extension" \ |
| 3634 | -c "found renegotiation extension" \ |
| 3635 | -s "record counter limit reached: renegotiate" \ |
| 3636 | -c "=> renegotiate" \ |
| 3637 | -s "=> renegotiate" \ |
| 3638 | -s "write hello request" \ |
| 3639 | -S "SSL - An unexpected message was received from our peer" \ |
| 3640 | -S "failed" |
| 3641 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3642 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3643 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3644 | "$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] | 3645 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3646 | 0 \ |
| 3647 | -c "client hello, adding renegotiation extension" \ |
| 3648 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3649 | -s "found renegotiation extension" \ |
| 3650 | -s "server hello, secure renegotiation extension" \ |
| 3651 | -c "found renegotiation extension" \ |
| 3652 | -s "record counter limit reached: renegotiate" \ |
| 3653 | -c "=> renegotiate" \ |
| 3654 | -s "=> renegotiate" \ |
| 3655 | -s "write hello request" \ |
| 3656 | -S "SSL - An unexpected message was received from our peer" \ |
| 3657 | -S "failed" |
| 3658 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3659 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3660 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3661 | "$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] | 3662 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3663 | 0 \ |
| 3664 | -C "client hello, adding renegotiation extension" \ |
| 3665 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3666 | -S "found renegotiation extension" \ |
| 3667 | -s "server hello, secure renegotiation extension" \ |
| 3668 | -c "found renegotiation extension" \ |
| 3669 | -S "record counter limit reached: renegotiate" \ |
| 3670 | -C "=> renegotiate" \ |
| 3671 | -S "=> renegotiate" \ |
| 3672 | -S "write hello request" \ |
| 3673 | -S "SSL - An unexpected message was received from our peer" \ |
| 3674 | -S "failed" |
| 3675 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3676 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3677 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3678 | "$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] | 3679 | "$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] | 3680 | 0 \ |
| 3681 | -c "client hello, adding renegotiation extension" \ |
| 3682 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3683 | -s "found renegotiation extension" \ |
| 3684 | -s "server hello, secure renegotiation extension" \ |
| 3685 | -c "found renegotiation extension" \ |
| 3686 | -c "=> renegotiate" \ |
| 3687 | -s "=> renegotiate" \ |
| 3688 | -S "write hello request" |
| 3689 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3690 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3691 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3692 | "$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] | 3693 | "$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] | 3694 | 0 \ |
| 3695 | -c "client hello, adding renegotiation extension" \ |
| 3696 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3697 | -s "found renegotiation extension" \ |
| 3698 | -s "server hello, secure renegotiation extension" \ |
| 3699 | -c "found renegotiation extension" \ |
| 3700 | -c "=> renegotiate" \ |
| 3701 | -s "=> renegotiate" \ |
| 3702 | -s "write hello request" |
| 3703 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3704 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3705 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3706 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3707 | "$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] | 3708 | 0 \ |
| 3709 | -c "client hello, adding renegotiation extension" \ |
| 3710 | -c "found renegotiation extension" \ |
| 3711 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3712 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3713 | -C "error" \ |
| 3714 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3715 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3716 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3717 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3718 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3719 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3720 | "$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] | 3721 | 0 \ |
| 3722 | -c "client hello, adding renegotiation extension" \ |
| 3723 | -c "found renegotiation extension" \ |
| 3724 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3725 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3726 | -C "error" \ |
| 3727 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3728 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3729 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3730 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3731 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3732 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3733 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3734 | 1 \ |
| 3735 | -c "client hello, adding renegotiation extension" \ |
| 3736 | -C "found renegotiation extension" \ |
| 3737 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3738 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3739 | -c "error" \ |
| 3740 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3741 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3742 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3743 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3744 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3745 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3746 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3747 | allow_legacy=0" \ |
| 3748 | 1 \ |
| 3749 | -c "client hello, adding renegotiation extension" \ |
| 3750 | -C "found renegotiation extension" \ |
| 3751 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3752 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3753 | -c "error" \ |
| 3754 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3755 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3756 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3757 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3758 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3759 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3760 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3761 | allow_legacy=1" \ |
| 3762 | 0 \ |
| 3763 | -c "client hello, adding renegotiation extension" \ |
| 3764 | -C "found renegotiation extension" \ |
| 3765 | -c "=> renegotiate" \ |
| 3766 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3767 | -C "error" \ |
| 3768 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3769 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3770 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3771 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3772 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3773 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3774 | 0 \ |
| 3775 | -c "client hello, adding renegotiation extension" \ |
| 3776 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3777 | -s "found renegotiation extension" \ |
| 3778 | -s "server hello, secure renegotiation extension" \ |
| 3779 | -c "found renegotiation extension" \ |
| 3780 | -c "=> renegotiate" \ |
| 3781 | -s "=> renegotiate" \ |
| 3782 | -S "write hello request" |
| 3783 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3784 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3785 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3786 | "$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] | 3787 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3788 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3789 | 0 \ |
| 3790 | -c "client hello, adding renegotiation extension" \ |
| 3791 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3792 | -s "found renegotiation extension" \ |
| 3793 | -s "server hello, secure renegotiation extension" \ |
| 3794 | -c "found renegotiation extension" \ |
| 3795 | -c "=> renegotiate" \ |
| 3796 | -s "=> renegotiate" \ |
| 3797 | -s "write hello request" |
| 3798 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3799 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3800 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3801 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3802 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3803 | 0 \ |
| 3804 | -c "client hello, adding renegotiation extension" \ |
| 3805 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3806 | -s "found renegotiation extension" \ |
| 3807 | -s "server hello, secure renegotiation extension" \ |
| 3808 | -s "record counter limit reached: renegotiate" \ |
| 3809 | -c "=> renegotiate" \ |
| 3810 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3811 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3812 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3813 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3814 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3815 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3816 | "$G_SRV -u --mtu 4096" \ |
| 3817 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3818 | 0 \ |
| 3819 | -c "client hello, adding renegotiation extension" \ |
| 3820 | -c "found renegotiation extension" \ |
| 3821 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3822 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3823 | -C "error" \ |
| 3824 | -s "Extra-header:" |
| 3825 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3826 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3827 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3828 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3829 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3830 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3831 | "$P_CLI debug_level=3" \ |
| 3832 | 0 \ |
| 3833 | -c "found renegotiation extension" \ |
| 3834 | -C "error" \ |
| 3835 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3836 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3837 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3838 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3839 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3840 | "$P_CLI debug_level=3" \ |
| 3841 | 0 \ |
| 3842 | -C "found renegotiation extension" \ |
| 3843 | -C "error" \ |
| 3844 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3845 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3846 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3847 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3848 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3849 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3850 | 1 \ |
| 3851 | -C "found renegotiation extension" \ |
| 3852 | -c "error" \ |
| 3853 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3854 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3855 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3856 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3857 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3858 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3859 | 0 \ |
| 3860 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3861 | -s "server hello, secure renegotiation extension" |
| 3862 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3863 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3864 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3865 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3866 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3867 | 0 \ |
| 3868 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3869 | -S "server hello, secure renegotiation extension" |
| 3870 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3871 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3872 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3873 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3874 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3875 | 1 \ |
| 3876 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3877 | -S "server hello, secure renegotiation extension" |
| 3878 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3879 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3880 | |
| 3881 | requires_gnutls |
| 3882 | run_test "DER format: no trailing bytes" \ |
| 3883 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3884 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3885 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3886 | 0 \ |
| 3887 | -c "Handshake was completed" \ |
| 3888 | |
| 3889 | requires_gnutls |
| 3890 | run_test "DER format: with a trailing zero byte" \ |
| 3891 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3892 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3893 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3894 | 0 \ |
| 3895 | -c "Handshake was completed" \ |
| 3896 | |
| 3897 | requires_gnutls |
| 3898 | run_test "DER format: with a trailing random byte" \ |
| 3899 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3900 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3901 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3902 | 0 \ |
| 3903 | -c "Handshake was completed" \ |
| 3904 | |
| 3905 | requires_gnutls |
| 3906 | run_test "DER format: with 2 trailing random bytes" \ |
| 3907 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3908 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3909 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3910 | 0 \ |
| 3911 | -c "Handshake was completed" \ |
| 3912 | |
| 3913 | requires_gnutls |
| 3914 | run_test "DER format: with 4 trailing random bytes" \ |
| 3915 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3916 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3917 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3918 | 0 \ |
| 3919 | -c "Handshake was completed" \ |
| 3920 | |
| 3921 | requires_gnutls |
| 3922 | run_test "DER format: with 8 trailing random bytes" \ |
| 3923 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3924 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3925 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3926 | 0 \ |
| 3927 | -c "Handshake was completed" \ |
| 3928 | |
| 3929 | requires_gnutls |
| 3930 | run_test "DER format: with 9 trailing random bytes" \ |
| 3931 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3932 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3933 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3934 | 0 \ |
| 3935 | -c "Handshake was completed" \ |
| 3936 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3937 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3938 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3939 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3940 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3941 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3942 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3943 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3944 | 1 \ |
| 3945 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3946 | -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] | 3947 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3948 | -c "X509 - Certificate verification failed" |
| 3949 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3950 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3951 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3952 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3953 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3954 | 0 \ |
| 3955 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3956 | -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] | 3957 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3958 | -C "X509 - Certificate verification failed" |
| 3959 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3960 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3961 | "$P_SRV" \ |
| 3962 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3963 | 0 \ |
| 3964 | -c "x509_verify_cert() returned" \ |
| 3965 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3966 | -c "! Certificate verification flags"\ |
| 3967 | -C "! mbedtls_ssl_handshake returned" \ |
| 3968 | -C "X509 - Certificate verification failed" \ |
| 3969 | -C "SSL - No CA Chain is set, but required to operate" |
| 3970 | |
| 3971 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3972 | "$P_SRV" \ |
| 3973 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3974 | 1 \ |
| 3975 | -c "x509_verify_cert() returned" \ |
| 3976 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3977 | -c "! Certificate verification flags"\ |
| 3978 | -c "! mbedtls_ssl_handshake returned" \ |
| 3979 | -c "SSL - No CA Chain is set, but required to operate" |
| 3980 | |
| 3981 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3982 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3983 | # the client informs the server about the supported curves - it does, though, in the |
| 3984 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3985 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3986 | # different means to have the server ignoring the client's supported curve list. |
| 3987 | |
| 3988 | requires_config_enabled MBEDTLS_ECP_C |
| 3989 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3990 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3991 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3992 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3993 | 1 \ |
| 3994 | -c "bad certificate (EC key curve)"\ |
| 3995 | -c "! Certificate verification flags"\ |
| 3996 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3997 | |
| 3998 | requires_config_enabled MBEDTLS_ECP_C |
| 3999 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4000 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4001 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4002 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4003 | 1 \ |
| 4004 | -c "bad certificate (EC key curve)"\ |
| 4005 | -c "! Certificate verification flags"\ |
| 4006 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4007 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4008 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4009 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4010 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4011 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4012 | 0 \ |
| 4013 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4014 | -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] | 4015 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4016 | -C "X509 - Certificate verification failed" |
| 4017 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4018 | run_test "Authentication: client SHA256, server required" \ |
| 4019 | "$P_SRV auth_mode=required" \ |
| 4020 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4021 | key_file=data_files/server6.key \ |
| 4022 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4023 | 0 \ |
| 4024 | -c "Supported Signature Algorithm found: 4," \ |
| 4025 | -c "Supported Signature Algorithm found: 5," |
| 4026 | |
| 4027 | run_test "Authentication: client SHA384, server required" \ |
| 4028 | "$P_SRV auth_mode=required" \ |
| 4029 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4030 | key_file=data_files/server6.key \ |
| 4031 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4032 | 0 \ |
| 4033 | -c "Supported Signature Algorithm found: 4," \ |
| 4034 | -c "Supported Signature Algorithm found: 5," |
| 4035 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4036 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4037 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4038 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4039 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4040 | key_file=data_files/server5.key" \ |
| 4041 | 1 \ |
| 4042 | -S "skip write certificate request" \ |
| 4043 | -C "skip parse certificate request" \ |
| 4044 | -c "got a certificate request" \ |
| 4045 | -c "got no certificate to send" \ |
| 4046 | -S "x509_verify_cert() returned" \ |
| 4047 | -s "client has no certificate" \ |
| 4048 | -s "! mbedtls_ssl_handshake returned" \ |
| 4049 | -c "! mbedtls_ssl_handshake returned" \ |
| 4050 | -s "No client certification received from the client, but required by the authentication mode" |
| 4051 | |
| 4052 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4053 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4054 | "$P_CLI debug_level=3 crt_file=none \ |
| 4055 | key_file=data_files/server5.key" \ |
| 4056 | 1 \ |
| 4057 | -S "skip write certificate request" \ |
| 4058 | -C "skip parse certificate request" \ |
| 4059 | -c "got a certificate request" \ |
| 4060 | -c "= write certificate$" \ |
| 4061 | -C "skip write certificate$" \ |
| 4062 | -S "x509_verify_cert() returned" \ |
| 4063 | -s "client has no certificate" \ |
| 4064 | -s "! mbedtls_ssl_handshake returned" \ |
| 4065 | -c "! mbedtls_ssl_handshake returned" \ |
| 4066 | -s "No client certification received from the client, but required by the authentication mode" |
| 4067 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4068 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4069 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4070 | "$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] | 4071 | key_file=data_files/server5.key" \ |
| 4072 | 1 \ |
| 4073 | -S "skip write certificate request" \ |
| 4074 | -C "skip parse certificate request" \ |
| 4075 | -c "got a certificate request" \ |
| 4076 | -C "skip write certificate" \ |
| 4077 | -C "skip write certificate verify" \ |
| 4078 | -S "skip parse certificate verify" \ |
| 4079 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4080 | -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] | 4081 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4082 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4083 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4084 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4085 | # We don't check that the client receives the alert because it might |
| 4086 | # detect that its write end of the connection is closed and abort |
| 4087 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4088 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4089 | run_test "Authentication: client cert not trusted, server required" \ |
| 4090 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4091 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4092 | key_file=data_files/server5.key" \ |
| 4093 | 1 \ |
| 4094 | -S "skip write certificate request" \ |
| 4095 | -C "skip parse certificate request" \ |
| 4096 | -c "got a certificate request" \ |
| 4097 | -C "skip write certificate" \ |
| 4098 | -C "skip write certificate verify" \ |
| 4099 | -S "skip parse certificate verify" \ |
| 4100 | -s "x509_verify_cert() returned" \ |
| 4101 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4102 | -s "! mbedtls_ssl_handshake returned" \ |
| 4103 | -c "! mbedtls_ssl_handshake returned" \ |
| 4104 | -s "X509 - Certificate verification failed" |
| 4105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4106 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4107 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4108 | "$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] | 4109 | key_file=data_files/server5.key" \ |
| 4110 | 0 \ |
| 4111 | -S "skip write certificate request" \ |
| 4112 | -C "skip parse certificate request" \ |
| 4113 | -c "got a certificate request" \ |
| 4114 | -C "skip write certificate" \ |
| 4115 | -C "skip write certificate verify" \ |
| 4116 | -S "skip parse certificate verify" \ |
| 4117 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4118 | -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] | 4119 | -S "! mbedtls_ssl_handshake returned" \ |
| 4120 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4121 | -S "X509 - Certificate verification failed" |
| 4122 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4123 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4124 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4125 | "$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] | 4126 | key_file=data_files/server5.key" \ |
| 4127 | 0 \ |
| 4128 | -s "skip write certificate request" \ |
| 4129 | -C "skip parse certificate request" \ |
| 4130 | -c "got no certificate request" \ |
| 4131 | -c "skip write certificate" \ |
| 4132 | -c "skip write certificate verify" \ |
| 4133 | -s "skip parse certificate verify" \ |
| 4134 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4135 | -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] | 4136 | -S "! mbedtls_ssl_handshake returned" \ |
| 4137 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4138 | -S "X509 - Certificate verification failed" |
| 4139 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4140 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4141 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4142 | "$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] | 4143 | 0 \ |
| 4144 | -S "skip write certificate request" \ |
| 4145 | -C "skip parse certificate request" \ |
| 4146 | -c "got a certificate request" \ |
| 4147 | -C "skip write certificate$" \ |
| 4148 | -C "got no certificate to send" \ |
| 4149 | -S "SSLv3 client has no certificate" \ |
| 4150 | -c "skip write certificate verify" \ |
| 4151 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4152 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4153 | -S "! mbedtls_ssl_handshake returned" \ |
| 4154 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4155 | -S "X509 - Certificate verification failed" |
| 4156 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4157 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4158 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4159 | "$O_CLI" \ |
| 4160 | 0 \ |
| 4161 | -S "skip write certificate request" \ |
| 4162 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4163 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4164 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4165 | -S "X509 - Certificate verification failed" |
| 4166 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4167 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4168 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4169 | "$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] | 4170 | 0 \ |
| 4171 | -C "skip parse certificate request" \ |
| 4172 | -c "got a certificate request" \ |
| 4173 | -C "skip write certificate$" \ |
| 4174 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4175 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4176 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4177 | run_test "Authentication: client no cert, openssl server required" \ |
| 4178 | "$O_SRV -Verify 10" \ |
| 4179 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4180 | 1 \ |
| 4181 | -C "skip parse certificate request" \ |
| 4182 | -c "got a certificate request" \ |
| 4183 | -C "skip write certificate$" \ |
| 4184 | -c "skip write certificate verify" \ |
| 4185 | -c "! mbedtls_ssl_handshake returned" |
| 4186 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4187 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4188 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4189 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4190 | "$P_CLI debug_level=3 crt_file=none key_file=none min_version=ssl3" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4191 | 0 \ |
| 4192 | -S "skip write certificate request" \ |
| 4193 | -C "skip parse certificate request" \ |
| 4194 | -c "got a certificate request" \ |
| 4195 | -C "skip write certificate$" \ |
| 4196 | -c "skip write certificate verify" \ |
| 4197 | -c "got no certificate to send" \ |
| 4198 | -s "SSLv3 client has no certificate" \ |
| 4199 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4200 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4201 | -S "! mbedtls_ssl_handshake returned" \ |
| 4202 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4203 | -S "X509 - Certificate verification failed" |
| 4204 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 4205 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 4206 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4207 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4208 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 4209 | 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] | 4210 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4211 | 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] | 4212 | cat <<EOF |
| 4213 | ${CONFIG_H} contains a value for the configuration of |
| 4214 | MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script's |
| 4215 | test value of ${MAX_IM_CA}. |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4216 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 4217 | The tests assume this value and if it changes, the tests in this |
| 4218 | script should also be adjusted. |
| 4219 | EOF |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4220 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4221 | fi |
| 4222 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4223 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4224 | run_test "Authentication: server max_int chain, client default" \ |
| 4225 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4226 | key_file=data_files/dir-maxpath/09.key" \ |
| 4227 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4228 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4229 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4230 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4231 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4232 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4233 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4234 | key_file=data_files/dir-maxpath/10.key" \ |
| 4235 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4236 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4237 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4238 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4239 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4240 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4241 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4242 | key_file=data_files/dir-maxpath/10.key" \ |
| 4243 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4244 | auth_mode=optional" \ |
| 4245 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4246 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4247 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4248 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4249 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4250 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4251 | key_file=data_files/dir-maxpath/10.key" \ |
| 4252 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4253 | auth_mode=none" \ |
| 4254 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4255 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4256 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4257 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4258 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4259 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4260 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4261 | key_file=data_files/dir-maxpath/10.key" \ |
| 4262 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4263 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4264 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4265 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4266 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4267 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4268 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4269 | key_file=data_files/dir-maxpath/10.key" \ |
| 4270 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4271 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4272 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4273 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4274 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4275 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4276 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4277 | key_file=data_files/dir-maxpath/10.key" \ |
| 4278 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4279 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4280 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4281 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4282 | run_test "Authentication: client max_int chain, server required" \ |
| 4283 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4284 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4285 | key_file=data_files/dir-maxpath/09.key" \ |
| 4286 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4287 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4288 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4289 | # Tests for CA list in CertificateRequest messages |
| 4290 | |
| 4291 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4292 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4293 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4294 | key_file=data_files/server6.key" \ |
| 4295 | 0 \ |
| 4296 | -s "requested DN" |
| 4297 | |
| 4298 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4299 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4300 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4301 | key_file=data_files/server6.key" \ |
| 4302 | 0 \ |
| 4303 | -S "requested DN" |
| 4304 | |
| 4305 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4306 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4307 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4308 | key_file=data_files/server5.key" \ |
| 4309 | 1 \ |
| 4310 | -S "requested DN" \ |
| 4311 | -s "x509_verify_cert() returned" \ |
| 4312 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4313 | -s "! mbedtls_ssl_handshake returned" \ |
| 4314 | -c "! mbedtls_ssl_handshake returned" \ |
| 4315 | -s "X509 - Certificate verification failed" |
| 4316 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4317 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4318 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4319 | |
| 4320 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4321 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4322 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4323 | key_file=data_files/server5.key" \ |
| 4324 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4325 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4326 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4327 | -c "x509_verify_cert() returned" \ |
| 4328 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4329 | -c "! mbedtls_ssl_handshake returned" \ |
| 4330 | -c "X509 - Certificate verification failed" |
| 4331 | |
| 4332 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4333 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4334 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4335 | key_file=data_files/server5.key" \ |
| 4336 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4337 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4338 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4339 | -c "x509_verify_cert() returned" \ |
| 4340 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4341 | -C "! mbedtls_ssl_handshake returned" \ |
| 4342 | -C "X509 - Certificate verification failed" |
| 4343 | |
| 4344 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4345 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4346 | # the client informs the server about the supported curves - it does, though, in the |
| 4347 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4348 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4349 | # different means to have the server ignoring the client's supported curve list. |
| 4350 | |
| 4351 | requires_config_enabled MBEDTLS_ECP_C |
| 4352 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4353 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4354 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4355 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4356 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4357 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4358 | -c "use CA callback for X.509 CRT verification" \ |
| 4359 | -c "bad certificate (EC key curve)" \ |
| 4360 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4361 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4362 | |
| 4363 | requires_config_enabled MBEDTLS_ECP_C |
| 4364 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4365 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4366 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4367 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4368 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4369 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4370 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4371 | -c "bad certificate (EC key curve)"\ |
| 4372 | -c "! Certificate verification flags"\ |
| 4373 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4374 | |
| 4375 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4376 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4377 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4378 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4379 | key_file=data_files/server6.key \ |
| 4380 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4381 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4382 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4383 | -c "Supported Signature Algorithm found: 4," \ |
| 4384 | -c "Supported Signature Algorithm found: 5," |
| 4385 | |
| 4386 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4387 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4388 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4389 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4390 | key_file=data_files/server6.key \ |
| 4391 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4392 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4393 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4394 | -c "Supported Signature Algorithm found: 4," \ |
| 4395 | -c "Supported Signature Algorithm found: 5," |
| 4396 | |
| 4397 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4398 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4399 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4400 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4401 | key_file=data_files/server5.key" \ |
| 4402 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4403 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4404 | -S "skip write certificate request" \ |
| 4405 | -C "skip parse certificate request" \ |
| 4406 | -c "got a certificate request" \ |
| 4407 | -C "skip write certificate" \ |
| 4408 | -C "skip write certificate verify" \ |
| 4409 | -S "skip parse certificate verify" \ |
| 4410 | -s "x509_verify_cert() returned" \ |
| 4411 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4412 | -s "! mbedtls_ssl_handshake returned" \ |
| 4413 | -s "send alert level=2 message=48" \ |
| 4414 | -c "! mbedtls_ssl_handshake returned" \ |
| 4415 | -s "X509 - Certificate verification failed" |
| 4416 | # We don't check that the client receives the alert because it might |
| 4417 | # detect that its write end of the connection is closed and abort |
| 4418 | # before reading the alert message. |
| 4419 | |
| 4420 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4421 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4422 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4423 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4424 | key_file=data_files/server5.key" \ |
| 4425 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4426 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4427 | -S "skip write certificate request" \ |
| 4428 | -C "skip parse certificate request" \ |
| 4429 | -c "got a certificate request" \ |
| 4430 | -C "skip write certificate" \ |
| 4431 | -C "skip write certificate verify" \ |
| 4432 | -S "skip parse certificate verify" \ |
| 4433 | -s "x509_verify_cert() returned" \ |
| 4434 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4435 | -s "! mbedtls_ssl_handshake returned" \ |
| 4436 | -c "! mbedtls_ssl_handshake returned" \ |
| 4437 | -s "X509 - Certificate verification failed" |
| 4438 | |
| 4439 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4440 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4441 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4442 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4443 | key_file=data_files/server5.key" \ |
| 4444 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4445 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4446 | -S "skip write certificate request" \ |
| 4447 | -C "skip parse certificate request" \ |
| 4448 | -c "got a certificate request" \ |
| 4449 | -C "skip write certificate" \ |
| 4450 | -C "skip write certificate verify" \ |
| 4451 | -S "skip parse certificate verify" \ |
| 4452 | -s "x509_verify_cert() returned" \ |
| 4453 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4454 | -S "! mbedtls_ssl_handshake returned" \ |
| 4455 | -C "! mbedtls_ssl_handshake returned" \ |
| 4456 | -S "X509 - Certificate verification failed" |
| 4457 | |
| 4458 | requires_full_size_output_buffer |
| 4459 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4460 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4461 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4462 | key_file=data_files/dir-maxpath/09.key" \ |
| 4463 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4464 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4465 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4466 | -C "X509 - A fatal error occurred" |
| 4467 | |
| 4468 | requires_full_size_output_buffer |
| 4469 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4470 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4471 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4472 | key_file=data_files/dir-maxpath/10.key" \ |
| 4473 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4474 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4475 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4476 | -c "X509 - A fatal error occurred" |
| 4477 | |
| 4478 | requires_full_size_output_buffer |
| 4479 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4480 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4481 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4482 | key_file=data_files/dir-maxpath/10.key" \ |
| 4483 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4484 | debug_level=3 auth_mode=optional" \ |
| 4485 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4486 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4487 | -c "X509 - A fatal error occurred" |
| 4488 | |
| 4489 | requires_full_size_output_buffer |
| 4490 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4491 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4492 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4493 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4494 | key_file=data_files/dir-maxpath/10.key" \ |
| 4495 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4496 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4497 | -s "X509 - A fatal error occurred" |
| 4498 | |
| 4499 | requires_full_size_output_buffer |
| 4500 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4501 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4502 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4503 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4504 | key_file=data_files/dir-maxpath/10.key" \ |
| 4505 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4506 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4507 | -s "X509 - A fatal error occurred" |
| 4508 | |
| 4509 | requires_full_size_output_buffer |
| 4510 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4511 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4512 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4513 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4514 | key_file=data_files/dir-maxpath/09.key" \ |
| 4515 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4516 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4517 | -S "X509 - A fatal error occurred" |
| 4518 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4519 | # Tests for certificate selection based on SHA verson |
| 4520 | |
| 4521 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4522 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4523 | key_file=data_files/server5.key \ |
| 4524 | crt_file2=data_files/server5-sha1.crt \ |
| 4525 | key_file2=data_files/server5.key" \ |
| 4526 | "$P_CLI force_version=tls1_2" \ |
| 4527 | 0 \ |
| 4528 | -c "signed using.*ECDSA with SHA256" \ |
| 4529 | -C "signed using.*ECDSA with SHA1" |
| 4530 | |
| 4531 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4532 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4533 | key_file=data_files/server5.key \ |
| 4534 | crt_file2=data_files/server5-sha1.crt \ |
| 4535 | key_file2=data_files/server5.key" \ |
| 4536 | "$P_CLI force_version=tls1_1" \ |
| 4537 | 0 \ |
| 4538 | -C "signed using.*ECDSA with SHA256" \ |
| 4539 | -c "signed using.*ECDSA with SHA1" |
| 4540 | |
| 4541 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4542 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4543 | key_file=data_files/server5.key \ |
| 4544 | crt_file2=data_files/server5-sha1.crt \ |
| 4545 | key_file2=data_files/server5.key" \ |
| 4546 | "$P_CLI force_version=tls1" \ |
| 4547 | 0 \ |
| 4548 | -C "signed using.*ECDSA with SHA256" \ |
| 4549 | -c "signed using.*ECDSA with SHA1" |
| 4550 | |
| 4551 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4552 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4553 | key_file=data_files/server5.key \ |
| 4554 | crt_file2=data_files/server6.crt \ |
| 4555 | key_file2=data_files/server6.key" \ |
| 4556 | "$P_CLI force_version=tls1_1" \ |
| 4557 | 0 \ |
| 4558 | -c "serial number.*09" \ |
| 4559 | -c "signed using.*ECDSA with SHA256" \ |
| 4560 | -C "signed using.*ECDSA with SHA1" |
| 4561 | |
| 4562 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4563 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4564 | key_file=data_files/server6.key \ |
| 4565 | crt_file2=data_files/server5.crt \ |
| 4566 | key_file2=data_files/server5.key" \ |
| 4567 | "$P_CLI force_version=tls1_1" \ |
| 4568 | 0 \ |
| 4569 | -c "serial number.*0A" \ |
| 4570 | -c "signed using.*ECDSA with SHA256" \ |
| 4571 | -C "signed using.*ECDSA with SHA1" |
| 4572 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4573 | # tests for SNI |
| 4574 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4575 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4576 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4577 | 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] | 4578 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4579 | 0 \ |
| 4580 | -S "parse ServerName extension" \ |
| 4581 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4582 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4583 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4584 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4585 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4586 | 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] | 4587 | 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] | 4588 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4589 | 0 \ |
| 4590 | -s "parse ServerName extension" \ |
| 4591 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4592 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4593 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4594 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4595 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4596 | 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] | 4597 | 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] | 4598 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4599 | 0 \ |
| 4600 | -s "parse ServerName extension" \ |
| 4601 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4602 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4603 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4604 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4605 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4606 | 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] | 4607 | 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] | 4608 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4609 | 1 \ |
| 4610 | -s "parse ServerName extension" \ |
| 4611 | -s "ssl_sni_wrapper() returned" \ |
| 4612 | -s "mbedtls_ssl_handshake returned" \ |
| 4613 | -c "mbedtls_ssl_handshake returned" \ |
| 4614 | -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] | 4615 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4616 | run_test "SNI: client auth no override: optional" \ |
| 4617 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4618 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4619 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4620 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4621 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4622 | -S "skip write certificate request" \ |
| 4623 | -C "skip parse certificate request" \ |
| 4624 | -c "got a certificate request" \ |
| 4625 | -C "skip write certificate" \ |
| 4626 | -C "skip write certificate verify" \ |
| 4627 | -S "skip parse certificate verify" |
| 4628 | |
| 4629 | run_test "SNI: client auth override: none -> optional" \ |
| 4630 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4631 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4632 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4633 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4634 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4635 | -S "skip write certificate request" \ |
| 4636 | -C "skip parse certificate request" \ |
| 4637 | -c "got a certificate request" \ |
| 4638 | -C "skip write certificate" \ |
| 4639 | -C "skip write certificate verify" \ |
| 4640 | -S "skip parse certificate verify" |
| 4641 | |
| 4642 | run_test "SNI: client auth override: optional -> none" \ |
| 4643 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4644 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4645 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4646 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4647 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4648 | -s "skip write certificate request" \ |
| 4649 | -C "skip parse certificate request" \ |
| 4650 | -c "got no certificate request" \ |
| 4651 | -c "skip write certificate" \ |
| 4652 | -c "skip write certificate verify" \ |
| 4653 | -s "skip parse certificate verify" |
| 4654 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4655 | run_test "SNI: CA no override" \ |
| 4656 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4657 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4658 | ca_file=data_files/test-ca.crt \ |
| 4659 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4660 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4661 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4662 | 1 \ |
| 4663 | -S "skip write certificate request" \ |
| 4664 | -C "skip parse certificate request" \ |
| 4665 | -c "got a certificate request" \ |
| 4666 | -C "skip write certificate" \ |
| 4667 | -C "skip write certificate verify" \ |
| 4668 | -S "skip parse certificate verify" \ |
| 4669 | -s "x509_verify_cert() returned" \ |
| 4670 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4671 | -S "The certificate has been revoked (is on a CRL)" |
| 4672 | |
| 4673 | run_test "SNI: CA override" \ |
| 4674 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4675 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4676 | ca_file=data_files/test-ca.crt \ |
| 4677 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4678 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4679 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4680 | 0 \ |
| 4681 | -S "skip write certificate request" \ |
| 4682 | -C "skip parse certificate request" \ |
| 4683 | -c "got a certificate request" \ |
| 4684 | -C "skip write certificate" \ |
| 4685 | -C "skip write certificate verify" \ |
| 4686 | -S "skip parse certificate verify" \ |
| 4687 | -S "x509_verify_cert() returned" \ |
| 4688 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4689 | -S "The certificate has been revoked (is on a CRL)" |
| 4690 | |
| 4691 | run_test "SNI: CA override with CRL" \ |
| 4692 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4693 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4694 | ca_file=data_files/test-ca.crt \ |
| 4695 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4696 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4697 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4698 | 1 \ |
| 4699 | -S "skip write certificate request" \ |
| 4700 | -C "skip parse certificate request" \ |
| 4701 | -c "got a certificate request" \ |
| 4702 | -C "skip write certificate" \ |
| 4703 | -C "skip write certificate verify" \ |
| 4704 | -S "skip parse certificate verify" \ |
| 4705 | -s "x509_verify_cert() returned" \ |
| 4706 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4707 | -s "The certificate has been revoked (is on a CRL)" |
| 4708 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4709 | # Tests for SNI and DTLS |
| 4710 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4711 | run_test "SNI: DTLS, no SNI callback" \ |
| 4712 | "$P_SRV debug_level=3 dtls=1 \ |
| 4713 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4714 | "$P_CLI server_name=localhost dtls=1" \ |
| 4715 | 0 \ |
| 4716 | -S "parse ServerName extension" \ |
| 4717 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4718 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4719 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4720 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4721 | "$P_SRV debug_level=3 dtls=1 \ |
| 4722 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4723 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4724 | "$P_CLI server_name=localhost dtls=1" \ |
| 4725 | 0 \ |
| 4726 | -s "parse ServerName extension" \ |
| 4727 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4728 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4729 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4730 | run_test "SNI: DTLS, matching cert 2" \ |
| 4731 | "$P_SRV debug_level=3 dtls=1 \ |
| 4732 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4733 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4734 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4735 | 0 \ |
| 4736 | -s "parse ServerName extension" \ |
| 4737 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4738 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4739 | |
| 4740 | run_test "SNI: DTLS, no matching cert" \ |
| 4741 | "$P_SRV debug_level=3 dtls=1 \ |
| 4742 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4743 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4744 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4745 | 1 \ |
| 4746 | -s "parse ServerName extension" \ |
| 4747 | -s "ssl_sni_wrapper() returned" \ |
| 4748 | -s "mbedtls_ssl_handshake returned" \ |
| 4749 | -c "mbedtls_ssl_handshake returned" \ |
| 4750 | -c "SSL - A fatal alert message was received from our peer" |
| 4751 | |
| 4752 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4753 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4754 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4755 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4756 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4757 | 0 \ |
| 4758 | -S "skip write certificate request" \ |
| 4759 | -C "skip parse certificate request" \ |
| 4760 | -c "got a certificate request" \ |
| 4761 | -C "skip write certificate" \ |
| 4762 | -C "skip write certificate verify" \ |
| 4763 | -S "skip parse certificate verify" |
| 4764 | |
| 4765 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4766 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4767 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4768 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4769 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4770 | 0 \ |
| 4771 | -S "skip write certificate request" \ |
| 4772 | -C "skip parse certificate request" \ |
| 4773 | -c "got a certificate request" \ |
| 4774 | -C "skip write certificate" \ |
| 4775 | -C "skip write certificate verify" \ |
| 4776 | -S "skip parse certificate verify" |
| 4777 | |
| 4778 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4779 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4780 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4781 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4782 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4783 | 0 \ |
| 4784 | -s "skip write certificate request" \ |
| 4785 | -C "skip parse certificate request" \ |
| 4786 | -c "got no certificate request" \ |
| 4787 | -c "skip write certificate" \ |
| 4788 | -c "skip write certificate verify" \ |
| 4789 | -s "skip parse certificate verify" |
| 4790 | |
| 4791 | run_test "SNI: DTLS, CA no override" \ |
| 4792 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4793 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4794 | ca_file=data_files/test-ca.crt \ |
| 4795 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4796 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4797 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4798 | 1 \ |
| 4799 | -S "skip write certificate request" \ |
| 4800 | -C "skip parse certificate request" \ |
| 4801 | -c "got a certificate request" \ |
| 4802 | -C "skip write certificate" \ |
| 4803 | -C "skip write certificate verify" \ |
| 4804 | -S "skip parse certificate verify" \ |
| 4805 | -s "x509_verify_cert() returned" \ |
| 4806 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4807 | -S "The certificate has been revoked (is on a CRL)" |
| 4808 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4809 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4810 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4811 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4812 | ca_file=data_files/test-ca.crt \ |
| 4813 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4814 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4815 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4816 | 0 \ |
| 4817 | -S "skip write certificate request" \ |
| 4818 | -C "skip parse certificate request" \ |
| 4819 | -c "got a certificate request" \ |
| 4820 | -C "skip write certificate" \ |
| 4821 | -C "skip write certificate verify" \ |
| 4822 | -S "skip parse certificate verify" \ |
| 4823 | -S "x509_verify_cert() returned" \ |
| 4824 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4825 | -S "The certificate has been revoked (is on a CRL)" |
| 4826 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4827 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4828 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4829 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4830 | ca_file=data_files/test-ca.crt \ |
| 4831 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4832 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4833 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4834 | 1 \ |
| 4835 | -S "skip write certificate request" \ |
| 4836 | -C "skip parse certificate request" \ |
| 4837 | -c "got a certificate request" \ |
| 4838 | -C "skip write certificate" \ |
| 4839 | -C "skip write certificate verify" \ |
| 4840 | -S "skip parse certificate verify" \ |
| 4841 | -s "x509_verify_cert() returned" \ |
| 4842 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4843 | -s "The certificate has been revoked (is on a CRL)" |
| 4844 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4845 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4846 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4847 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4848 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4849 | "$P_CLI nbio=2 tickets=0" \ |
| 4850 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4851 | -S "mbedtls_ssl_handshake returned" \ |
| 4852 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4853 | -c "Read from server: .* bytes read" |
| 4854 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4855 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4856 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4857 | "$P_CLI nbio=2 tickets=0" \ |
| 4858 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4859 | -S "mbedtls_ssl_handshake returned" \ |
| 4860 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4861 | -c "Read from server: .* bytes read" |
| 4862 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4863 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4864 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4865 | "$P_CLI nbio=2 tickets=1" \ |
| 4866 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4867 | -S "mbedtls_ssl_handshake returned" \ |
| 4868 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4869 | -c "Read from server: .* bytes read" |
| 4870 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4871 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4872 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4873 | "$P_CLI nbio=2 tickets=1" \ |
| 4874 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4875 | -S "mbedtls_ssl_handshake returned" \ |
| 4876 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4877 | -c "Read from server: .* bytes read" |
| 4878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4879 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4880 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4881 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4882 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4883 | -S "mbedtls_ssl_handshake returned" \ |
| 4884 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4885 | -c "Read from server: .* bytes read" |
| 4886 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4887 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4888 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4889 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4890 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4891 | -S "mbedtls_ssl_handshake returned" \ |
| 4892 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4893 | -c "Read from server: .* bytes read" |
| 4894 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4895 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4896 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4897 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4898 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4899 | -S "mbedtls_ssl_handshake returned" \ |
| 4900 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4901 | -c "Read from server: .* bytes read" |
| 4902 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4903 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4904 | |
| 4905 | run_test "Event-driven I/O: basic handshake" \ |
| 4906 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4907 | "$P_CLI event=1 tickets=0" \ |
| 4908 | 0 \ |
| 4909 | -S "mbedtls_ssl_handshake returned" \ |
| 4910 | -C "mbedtls_ssl_handshake returned" \ |
| 4911 | -c "Read from server: .* bytes read" |
| 4912 | |
| 4913 | run_test "Event-driven I/O: client auth" \ |
| 4914 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4915 | "$P_CLI event=1 tickets=0" \ |
| 4916 | 0 \ |
| 4917 | -S "mbedtls_ssl_handshake returned" \ |
| 4918 | -C "mbedtls_ssl_handshake returned" \ |
| 4919 | -c "Read from server: .* bytes read" |
| 4920 | |
| 4921 | run_test "Event-driven I/O: ticket" \ |
| 4922 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4923 | "$P_CLI event=1 tickets=1" \ |
| 4924 | 0 \ |
| 4925 | -S "mbedtls_ssl_handshake returned" \ |
| 4926 | -C "mbedtls_ssl_handshake returned" \ |
| 4927 | -c "Read from server: .* bytes read" |
| 4928 | |
| 4929 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4930 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4931 | "$P_CLI event=1 tickets=1" \ |
| 4932 | 0 \ |
| 4933 | -S "mbedtls_ssl_handshake returned" \ |
| 4934 | -C "mbedtls_ssl_handshake returned" \ |
| 4935 | -c "Read from server: .* bytes read" |
| 4936 | |
| 4937 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4938 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4939 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4940 | 0 \ |
| 4941 | -S "mbedtls_ssl_handshake returned" \ |
| 4942 | -C "mbedtls_ssl_handshake returned" \ |
| 4943 | -c "Read from server: .* bytes read" |
| 4944 | |
| 4945 | run_test "Event-driven I/O: ticket + resume" \ |
| 4946 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4947 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4948 | 0 \ |
| 4949 | -S "mbedtls_ssl_handshake returned" \ |
| 4950 | -C "mbedtls_ssl_handshake returned" \ |
| 4951 | -c "Read from server: .* bytes read" |
| 4952 | |
| 4953 | run_test "Event-driven I/O: session-id resume" \ |
| 4954 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4955 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4956 | 0 \ |
| 4957 | -S "mbedtls_ssl_handshake returned" \ |
| 4958 | -C "mbedtls_ssl_handshake returned" \ |
| 4959 | -c "Read from server: .* bytes read" |
| 4960 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4961 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4962 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4963 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4964 | 0 \ |
| 4965 | -c "Read from server: .* bytes read" |
| 4966 | |
| 4967 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4968 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4969 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4970 | 0 \ |
| 4971 | -c "Read from server: .* bytes read" |
| 4972 | |
| 4973 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4974 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4975 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4976 | 0 \ |
| 4977 | -c "Read from server: .* bytes read" |
| 4978 | |
| 4979 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4980 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4981 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4982 | 0 \ |
| 4983 | -c "Read from server: .* bytes read" |
| 4984 | |
| 4985 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4986 | "$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] | 4987 | "$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] | 4988 | 0 \ |
| 4989 | -c "Read from server: .* bytes read" |
| 4990 | |
| 4991 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4992 | "$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] | 4993 | "$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] | 4994 | 0 \ |
| 4995 | -c "Read from server: .* bytes read" |
| 4996 | |
| 4997 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4998 | "$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] | 4999 | "$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] | 5000 | 0 \ |
| 5001 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5002 | |
| 5003 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5004 | # During session resumption, the client will send its ApplicationData record |
| 5005 | # within the same datagram as the Finished messages. In this situation, the |
| 5006 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5007 | # because the ApplicationData request has already been queued internally. |
| 5008 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5009 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5010 | "$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] | 5011 | "$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] | 5012 | 0 \ |
| 5013 | -c "Read from server: .* bytes read" |
| 5014 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5015 | # Tests for version negotiation |
| 5016 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5017 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5018 | "$P_SRV" \ |
| 5019 | "$P_CLI" \ |
| 5020 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5021 | -S "mbedtls_ssl_handshake returned" \ |
| 5022 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5023 | -s "Protocol is TLSv1.2" \ |
| 5024 | -c "Protocol is TLSv1.2" |
| 5025 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5026 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5027 | "$P_SRV" \ |
| 5028 | "$P_CLI max_version=tls1_1" \ |
| 5029 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5030 | -S "mbedtls_ssl_handshake returned" \ |
| 5031 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5032 | -s "Protocol is TLSv1.1" \ |
| 5033 | -c "Protocol is TLSv1.1" |
| 5034 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5035 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5036 | "$P_SRV max_version=tls1_1" \ |
| 5037 | "$P_CLI" \ |
| 5038 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5039 | -S "mbedtls_ssl_handshake returned" \ |
| 5040 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5041 | -s "Protocol is TLSv1.1" \ |
| 5042 | -c "Protocol is TLSv1.1" |
| 5043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5044 | 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] | 5045 | "$P_SRV max_version=tls1_1" \ |
| 5046 | "$P_CLI max_version=tls1_1" \ |
| 5047 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5048 | -S "mbedtls_ssl_handshake returned" \ |
| 5049 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5050 | -s "Protocol is TLSv1.1" \ |
| 5051 | -c "Protocol is TLSv1.1" |
| 5052 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5053 | 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] | 5054 | "$P_SRV min_version=tls1_1" \ |
| 5055 | "$P_CLI max_version=tls1_1" \ |
| 5056 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5057 | -S "mbedtls_ssl_handshake returned" \ |
| 5058 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5059 | -s "Protocol is TLSv1.1" \ |
| 5060 | -c "Protocol is TLSv1.1" |
| 5061 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5062 | 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] | 5063 | "$P_SRV max_version=tls1_1" \ |
| 5064 | "$P_CLI min_version=tls1_1" \ |
| 5065 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5066 | -S "mbedtls_ssl_handshake returned" \ |
| 5067 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5068 | -s "Protocol is TLSv1.1" \ |
| 5069 | -c "Protocol is TLSv1.1" |
| 5070 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5071 | 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] | 5072 | "$P_SRV max_version=tls1_1" \ |
| 5073 | "$P_CLI min_version=tls1_2" \ |
| 5074 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5075 | -s "mbedtls_ssl_handshake returned" \ |
| 5076 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5077 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5078 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5079 | 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] | 5080 | "$P_SRV min_version=tls1_2" \ |
| 5081 | "$P_CLI max_version=tls1_1" \ |
| 5082 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5083 | -s "mbedtls_ssl_handshake returned" \ |
| 5084 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5085 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5086 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5087 | # Tests for ALPN extension |
| 5088 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5089 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5090 | "$P_SRV debug_level=3" \ |
| 5091 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5092 | 0 \ |
| 5093 | -C "client hello, adding alpn extension" \ |
| 5094 | -S "found alpn extension" \ |
| 5095 | -C "got an alert message, type: \\[2:120]" \ |
| 5096 | -S "server hello, adding alpn extension" \ |
| 5097 | -C "found alpn extension " \ |
| 5098 | -C "Application Layer Protocol is" \ |
| 5099 | -S "Application Layer Protocol is" |
| 5100 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5101 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5102 | "$P_SRV debug_level=3" \ |
| 5103 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5104 | 0 \ |
| 5105 | -c "client hello, adding alpn extension" \ |
| 5106 | -s "found alpn extension" \ |
| 5107 | -C "got an alert message, type: \\[2:120]" \ |
| 5108 | -S "server hello, adding alpn extension" \ |
| 5109 | -C "found alpn extension " \ |
| 5110 | -c "Application Layer Protocol is (none)" \ |
| 5111 | -S "Application Layer Protocol is" |
| 5112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5113 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5114 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5115 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5116 | 0 \ |
| 5117 | -C "client hello, adding alpn extension" \ |
| 5118 | -S "found alpn extension" \ |
| 5119 | -C "got an alert message, type: \\[2:120]" \ |
| 5120 | -S "server hello, adding alpn extension" \ |
| 5121 | -C "found alpn extension " \ |
| 5122 | -C "Application Layer Protocol is" \ |
| 5123 | -s "Application Layer Protocol is (none)" |
| 5124 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5125 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5126 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5127 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5128 | 0 \ |
| 5129 | -c "client hello, adding alpn extension" \ |
| 5130 | -s "found alpn extension" \ |
| 5131 | -C "got an alert message, type: \\[2:120]" \ |
| 5132 | -s "server hello, adding alpn extension" \ |
| 5133 | -c "found alpn extension" \ |
| 5134 | -c "Application Layer Protocol is abc" \ |
| 5135 | -s "Application Layer Protocol is abc" |
| 5136 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5137 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5138 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5139 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5140 | 0 \ |
| 5141 | -c "client hello, adding alpn extension" \ |
| 5142 | -s "found alpn extension" \ |
| 5143 | -C "got an alert message, type: \\[2:120]" \ |
| 5144 | -s "server hello, adding alpn extension" \ |
| 5145 | -c "found alpn extension" \ |
| 5146 | -c "Application Layer Protocol is abc" \ |
| 5147 | -s "Application Layer Protocol is abc" |
| 5148 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5149 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5150 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5151 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5152 | 0 \ |
| 5153 | -c "client hello, adding alpn extension" \ |
| 5154 | -s "found alpn extension" \ |
| 5155 | -C "got an alert message, type: \\[2:120]" \ |
| 5156 | -s "server hello, adding alpn extension" \ |
| 5157 | -c "found alpn extension" \ |
| 5158 | -c "Application Layer Protocol is 1234" \ |
| 5159 | -s "Application Layer Protocol is 1234" |
| 5160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5161 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5162 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5163 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5164 | 1 \ |
| 5165 | -c "client hello, adding alpn extension" \ |
| 5166 | -s "found alpn extension" \ |
| 5167 | -c "got an alert message, type: \\[2:120]" \ |
| 5168 | -S "server hello, adding alpn extension" \ |
| 5169 | -C "found alpn extension" \ |
| 5170 | -C "Application Layer Protocol is 1234" \ |
| 5171 | -S "Application Layer Protocol is 1234" |
| 5172 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5173 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5174 | # Tests for keyUsage in leaf certificates, part 1: |
| 5175 | # server-side certificate/suite selection |
| 5176 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5177 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5178 | "$P_SRV key_file=data_files/server2.key \ |
| 5179 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5180 | "$P_CLI" \ |
| 5181 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5182 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5183 | |
| 5184 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5185 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5186 | "$P_SRV key_file=data_files/server2.key \ |
| 5187 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5188 | "$P_CLI" \ |
| 5189 | 0 \ |
| 5190 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5191 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5192 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5193 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5194 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5195 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5196 | 1 \ |
| 5197 | -C "Ciphersuite is " |
| 5198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5199 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5200 | "$P_SRV key_file=data_files/server5.key \ |
| 5201 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5202 | "$P_CLI" \ |
| 5203 | 0 \ |
| 5204 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5205 | |
| 5206 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5207 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5208 | "$P_SRV key_file=data_files/server5.key \ |
| 5209 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5210 | "$P_CLI" \ |
| 5211 | 0 \ |
| 5212 | -c "Ciphersuite is TLS-ECDH-" |
| 5213 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5214 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5215 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5216 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5217 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5218 | 1 \ |
| 5219 | -C "Ciphersuite is " |
| 5220 | |
| 5221 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5222 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5223 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5224 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5225 | "$O_SRV -key data_files/server2.key \ |
| 5226 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5227 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5228 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5229 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5230 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5231 | -C "Processing of the Certificate handshake message failed" \ |
| 5232 | -c "Ciphersuite is TLS-" |
| 5233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5234 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5235 | "$O_SRV -key data_files/server2.key \ |
| 5236 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5237 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5238 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5239 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5240 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5241 | -C "Processing of the Certificate handshake message failed" \ |
| 5242 | -c "Ciphersuite is TLS-" |
| 5243 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5244 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5245 | "$O_SRV -key data_files/server2.key \ |
| 5246 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5247 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5248 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5249 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5250 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5251 | -C "Processing of the Certificate handshake message failed" \ |
| 5252 | -c "Ciphersuite is TLS-" |
| 5253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5254 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5255 | "$O_SRV -key data_files/server2.key \ |
| 5256 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5257 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5258 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5259 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5260 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5261 | -c "Processing of the Certificate handshake message failed" \ |
| 5262 | -C "Ciphersuite is TLS-" |
| 5263 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5264 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5265 | "$O_SRV -key data_files/server2.key \ |
| 5266 | -cert data_files/server2.ku-ke.crt" \ |
| 5267 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5268 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5269 | 0 \ |
| 5270 | -c "bad certificate (usage extensions)" \ |
| 5271 | -C "Processing of the Certificate handshake message failed" \ |
| 5272 | -c "Ciphersuite is TLS-" \ |
| 5273 | -c "! Usage does not match the keyUsage extension" |
| 5274 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5275 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5276 | "$O_SRV -key data_files/server2.key \ |
| 5277 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5278 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5279 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5280 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5281 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 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 "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5286 | "$O_SRV -key data_files/server2.key \ |
| 5287 | -cert data_files/server2.ku-ds.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 | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5289 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5290 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5291 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5292 | -c "Processing of the Certificate handshake message failed" \ |
| 5293 | -C "Ciphersuite is TLS-" |
| 5294 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5295 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5296 | "$O_SRV -key data_files/server2.key \ |
| 5297 | -cert data_files/server2.ku-ds.crt" \ |
| 5298 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5299 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5300 | 0 \ |
| 5301 | -c "bad certificate (usage extensions)" \ |
| 5302 | -C "Processing of the Certificate handshake message failed" \ |
| 5303 | -c "Ciphersuite is TLS-" \ |
| 5304 | -c "! Usage does not match the keyUsage extension" |
| 5305 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5306 | # Tests for keyUsage in leaf certificates, part 3: |
| 5307 | # server-side checking of client cert |
| 5308 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5309 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5310 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5311 | "$O_CLI -key data_files/server2.key \ |
| 5312 | -cert data_files/server2.ku-ds.crt" \ |
| 5313 | 0 \ |
| 5314 | -S "bad certificate (usage extensions)" \ |
| 5315 | -S "Processing of the Certificate handshake message failed" |
| 5316 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5317 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5318 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5319 | "$O_CLI -key data_files/server2.key \ |
| 5320 | -cert data_files/server2.ku-ke.crt" \ |
| 5321 | 0 \ |
| 5322 | -s "bad certificate (usage extensions)" \ |
| 5323 | -S "Processing of the Certificate handshake message failed" |
| 5324 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5325 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5326 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5327 | "$O_CLI -key data_files/server2.key \ |
| 5328 | -cert data_files/server2.ku-ke.crt" \ |
| 5329 | 1 \ |
| 5330 | -s "bad certificate (usage extensions)" \ |
| 5331 | -s "Processing of the Certificate handshake message failed" |
| 5332 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5333 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5334 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5335 | "$O_CLI -key data_files/server5.key \ |
| 5336 | -cert data_files/server5.ku-ds.crt" \ |
| 5337 | 0 \ |
| 5338 | -S "bad certificate (usage extensions)" \ |
| 5339 | -S "Processing of the Certificate handshake message failed" |
| 5340 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5341 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5342 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5343 | "$O_CLI -key data_files/server5.key \ |
| 5344 | -cert data_files/server5.ku-ka.crt" \ |
| 5345 | 0 \ |
| 5346 | -s "bad certificate (usage extensions)" \ |
| 5347 | -S "Processing of the Certificate handshake message failed" |
| 5348 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5349 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5350 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5351 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5352 | "$P_SRV key_file=data_files/server5.key \ |
| 5353 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5354 | "$P_CLI" \ |
| 5355 | 0 |
| 5356 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5357 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5358 | "$P_SRV key_file=data_files/server5.key \ |
| 5359 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5360 | "$P_CLI" \ |
| 5361 | 0 |
| 5362 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5363 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5364 | "$P_SRV key_file=data_files/server5.key \ |
| 5365 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5366 | "$P_CLI" \ |
| 5367 | 0 |
| 5368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5369 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5370 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5371 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5372 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5373 | 1 |
| 5374 | |
| 5375 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5376 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5377 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5378 | "$O_SRV -key data_files/server5.key \ |
| 5379 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5380 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5381 | 0 \ |
| 5382 | -C "bad certificate (usage extensions)" \ |
| 5383 | -C "Processing of the Certificate handshake message failed" \ |
| 5384 | -c "Ciphersuite is TLS-" |
| 5385 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5386 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5387 | "$O_SRV -key data_files/server5.key \ |
| 5388 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5389 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5390 | 0 \ |
| 5391 | -C "bad certificate (usage extensions)" \ |
| 5392 | -C "Processing of the Certificate handshake message failed" \ |
| 5393 | -c "Ciphersuite is TLS-" |
| 5394 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5395 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5396 | "$O_SRV -key data_files/server5.key \ |
| 5397 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5398 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5399 | 0 \ |
| 5400 | -C "bad certificate (usage extensions)" \ |
| 5401 | -C "Processing of the Certificate handshake message failed" \ |
| 5402 | -c "Ciphersuite is TLS-" |
| 5403 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5404 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5405 | "$O_SRV -key data_files/server5.key \ |
| 5406 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5407 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5408 | 1 \ |
| 5409 | -c "bad certificate (usage extensions)" \ |
| 5410 | -c "Processing of the Certificate handshake message failed" \ |
| 5411 | -C "Ciphersuite is TLS-" |
| 5412 | |
| 5413 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5414 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5415 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5416 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5417 | "$O_CLI -key data_files/server5.key \ |
| 5418 | -cert data_files/server5.eku-cli.crt" \ |
| 5419 | 0 \ |
| 5420 | -S "bad certificate (usage extensions)" \ |
| 5421 | -S "Processing of the Certificate handshake message failed" |
| 5422 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5423 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5424 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5425 | "$O_CLI -key data_files/server5.key \ |
| 5426 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5427 | 0 \ |
| 5428 | -S "bad certificate (usage extensions)" \ |
| 5429 | -S "Processing of the Certificate handshake message failed" |
| 5430 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5431 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5432 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5433 | "$O_CLI -key data_files/server5.key \ |
| 5434 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5435 | 0 \ |
| 5436 | -S "bad certificate (usage extensions)" \ |
| 5437 | -S "Processing of the Certificate handshake message failed" |
| 5438 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5439 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5440 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5441 | "$O_CLI -key data_files/server5.key \ |
| 5442 | -cert data_files/server5.eku-cs.crt" \ |
| 5443 | 0 \ |
| 5444 | -s "bad certificate (usage extensions)" \ |
| 5445 | -S "Processing of the Certificate handshake message failed" |
| 5446 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5447 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5448 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5449 | "$O_CLI -key data_files/server5.key \ |
| 5450 | -cert data_files/server5.eku-cs.crt" \ |
| 5451 | 1 \ |
| 5452 | -s "bad certificate (usage extensions)" \ |
| 5453 | -s "Processing of the Certificate handshake message failed" |
| 5454 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5455 | # Tests for DHM parameters loading |
| 5456 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5457 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5458 | "$P_SRV" \ |
| 5459 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5460 | debug_level=3" \ |
| 5461 | 0 \ |
| 5462 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5463 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5465 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5466 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5467 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5468 | debug_level=3" \ |
| 5469 | 0 \ |
| 5470 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5471 | -c "value of 'DHM: G ' (2 bits)" |
| 5472 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5473 | # Tests for DHM client-side size checking |
| 5474 | |
| 5475 | run_test "DHM size: server default, client default, OK" \ |
| 5476 | "$P_SRV" \ |
| 5477 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5478 | debug_level=1" \ |
| 5479 | 0 \ |
| 5480 | -C "DHM prime too short:" |
| 5481 | |
| 5482 | run_test "DHM size: server default, client 2048, OK" \ |
| 5483 | "$P_SRV" \ |
| 5484 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5485 | debug_level=1 dhmlen=2048" \ |
| 5486 | 0 \ |
| 5487 | -C "DHM prime too short:" |
| 5488 | |
| 5489 | run_test "DHM size: server 1024, client default, OK" \ |
| 5490 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5491 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5492 | debug_level=1" \ |
| 5493 | 0 \ |
| 5494 | -C "DHM prime too short:" |
| 5495 | |
| 5496 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5497 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5498 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5499 | debug_level=1" \ |
| 5500 | 1 \ |
| 5501 | -c "DHM prime too short:" |
| 5502 | |
| 5503 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5504 | "$P_SRV" \ |
| 5505 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5506 | debug_level=1 dhmlen=2049" \ |
| 5507 | 1 \ |
| 5508 | -c "DHM prime too short:" |
| 5509 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5510 | # Tests for PSK callback |
| 5511 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5512 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5513 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5514 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5515 | psk_identity=foo psk=abc123" \ |
| 5516 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5517 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5518 | -S "SSL - Unknown identity received" \ |
| 5519 | -S "SSL - Verification of the message MAC failed" |
| 5520 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5521 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5522 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5523 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5524 | "$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] | 5525 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5526 | 0 \ |
| 5527 | -c "skip PMS generation for opaque PSK"\ |
| 5528 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5529 | -C "session hash for extended master secret"\ |
| 5530 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5531 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5532 | -S "SSL - Unknown identity received" \ |
| 5533 | -S "SSL - Verification of the message MAC failed" |
| 5534 | |
| 5535 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5536 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5537 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5538 | "$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] | 5539 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5540 | 0 \ |
| 5541 | -c "skip PMS generation for opaque PSK"\ |
| 5542 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5543 | -C "session hash for extended master secret"\ |
| 5544 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5545 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5546 | -S "SSL - Unknown identity received" \ |
| 5547 | -S "SSL - Verification of the message MAC failed" |
| 5548 | |
| 5549 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5550 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5551 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5552 | "$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] | 5553 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5554 | 0 \ |
| 5555 | -c "skip PMS generation for opaque PSK"\ |
| 5556 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5557 | -c "session hash for extended master secret"\ |
| 5558 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5559 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5560 | -S "SSL - Unknown identity received" \ |
| 5561 | -S "SSL - Verification of the message MAC failed" |
| 5562 | |
| 5563 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5564 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5565 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5566 | "$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] | 5567 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5568 | 0 \ |
| 5569 | -c "skip PMS generation for opaque PSK"\ |
| 5570 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5571 | -c "session hash for extended master secret"\ |
| 5572 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5573 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5574 | -S "SSL - Unknown identity received" \ |
| 5575 | -S "SSL - Verification of the message MAC failed" |
| 5576 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5577 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5578 | 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] | 5579 | "$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] | 5580 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5581 | psk_identity=foo psk=abc123" \ |
| 5582 | 0 \ |
| 5583 | -C "skip PMS generation for opaque PSK"\ |
| 5584 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5585 | -C "session hash for extended master secret"\ |
| 5586 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5587 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5588 | -S "SSL - Unknown identity received" \ |
| 5589 | -S "SSL - Verification of the message MAC failed" |
| 5590 | |
| 5591 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5592 | 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] | 5593 | "$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] | 5594 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5595 | psk_identity=foo psk=abc123" \ |
| 5596 | 0 \ |
| 5597 | -C "skip PMS generation for opaque PSK"\ |
| 5598 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5599 | -C "session hash for extended master secret"\ |
| 5600 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5601 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5602 | -S "SSL - Unknown identity received" \ |
| 5603 | -S "SSL - Verification of the message MAC failed" |
| 5604 | |
| 5605 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5606 | 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] | 5607 | "$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] | 5608 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5609 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5610 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5611 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5612 | -c "session hash for extended master secret"\ |
| 5613 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5614 | -C "skip PMS generation for opaque PSK"\ |
| 5615 | -s "skip PMS generation for opaque PSK"\ |
| 5616 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5617 | -S "SSL - Unknown identity received" \ |
| 5618 | -S "SSL - Verification of the message MAC failed" |
| 5619 | |
| 5620 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5621 | 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] | 5622 | "$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] | 5623 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5624 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5625 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5626 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5627 | -c "session hash for extended master secret"\ |
| 5628 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5629 | -C "skip PMS generation for opaque PSK"\ |
| 5630 | -s "skip PMS generation for opaque PSK"\ |
| 5631 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5632 | -S "SSL - Unknown identity received" \ |
| 5633 | -S "SSL - Verification of the message MAC failed" |
| 5634 | |
| 5635 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5636 | 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] | 5637 | "$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] | 5638 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5639 | psk_identity=def psk=beef" \ |
| 5640 | 0 \ |
| 5641 | -C "skip PMS generation for opaque PSK"\ |
| 5642 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5643 | -C "session hash for extended master secret"\ |
| 5644 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5645 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5646 | -S "SSL - Unknown identity received" \ |
| 5647 | -S "SSL - Verification of the message MAC failed" |
| 5648 | |
| 5649 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5650 | 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] | 5651 | "$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] | 5652 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5653 | psk_identity=def psk=beef" \ |
| 5654 | 0 \ |
| 5655 | -C "skip PMS generation for opaque PSK"\ |
| 5656 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5657 | -C "session hash for extended master secret"\ |
| 5658 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5659 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5660 | -S "SSL - Unknown identity received" \ |
| 5661 | -S "SSL - Verification of the message MAC failed" |
| 5662 | |
| 5663 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5664 | 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] | 5665 | "$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] | 5666 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5667 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5668 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5669 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5670 | -c "session hash for extended master secret"\ |
| 5671 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5672 | -C "skip PMS generation for opaque PSK"\ |
| 5673 | -s "skip PMS generation for opaque PSK"\ |
| 5674 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5675 | -S "SSL - Unknown identity received" \ |
| 5676 | -S "SSL - Verification of the message MAC failed" |
| 5677 | |
| 5678 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5679 | 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] | 5680 | "$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] | 5681 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5682 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5683 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5684 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5685 | -c "session hash for extended master secret"\ |
| 5686 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5687 | -C "skip PMS generation for opaque PSK"\ |
| 5688 | -s "skip PMS generation for opaque PSK"\ |
| 5689 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5690 | -S "SSL - Unknown identity received" \ |
| 5691 | -S "SSL - Verification of the message MAC failed" |
| 5692 | |
| 5693 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5694 | 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] | 5695 | "$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] | 5696 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5697 | psk_identity=def psk=beef" \ |
| 5698 | 0 \ |
| 5699 | -C "skip PMS generation for opaque PSK"\ |
| 5700 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5701 | -C "session hash for extended master secret"\ |
| 5702 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5703 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5704 | -S "SSL - Unknown identity received" \ |
| 5705 | -S "SSL - Verification of the message MAC failed" |
| 5706 | |
| 5707 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5708 | 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] | 5709 | "$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] | 5710 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5711 | psk_identity=def psk=beef" \ |
| 5712 | 0 \ |
| 5713 | -C "skip PMS generation for opaque PSK"\ |
| 5714 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5715 | -C "session hash for extended master secret"\ |
| 5716 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5717 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5718 | -S "SSL - Unknown identity received" \ |
| 5719 | -S "SSL - Verification of the message MAC failed" |
| 5720 | |
| 5721 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5722 | 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] | 5723 | "$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] | 5724 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5725 | psk_identity=def psk=beef" \ |
| 5726 | 0 \ |
| 5727 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5728 | -C "session hash for extended master secret"\ |
| 5729 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5730 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5731 | -S "SSL - Unknown identity received" \ |
| 5732 | -S "SSL - Verification of the message MAC failed" |
| 5733 | |
| 5734 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5735 | 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] | 5736 | "$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] | 5737 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5738 | psk_identity=def psk=beef" \ |
| 5739 | 0 \ |
| 5740 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5741 | -C "session hash for extended master secret"\ |
| 5742 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5743 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5744 | -S "SSL - Unknown identity received" \ |
| 5745 | -S "SSL - Verification of the message MAC failed" |
| 5746 | |
| 5747 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5748 | 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] | 5749 | "$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] | 5750 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5751 | psk_identity=def psk=beef" \ |
| 5752 | 1 \ |
| 5753 | -s "SSL - Verification of the message MAC failed" |
| 5754 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5755 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5756 | "$P_SRV" \ |
| 5757 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5758 | psk_identity=foo psk=abc123" \ |
| 5759 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5760 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5761 | -S "SSL - Unknown identity received" \ |
| 5762 | -S "SSL - Verification of the message MAC failed" |
| 5763 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5764 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5765 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5766 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5767 | psk_identity=foo psk=abc123" \ |
| 5768 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5769 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5770 | -s "SSL - Unknown identity received" \ |
| 5771 | -S "SSL - Verification of the message MAC failed" |
| 5772 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5773 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5774 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5775 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5776 | psk_identity=abc psk=dead" \ |
| 5777 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5778 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5779 | -S "SSL - Unknown identity received" \ |
| 5780 | -S "SSL - Verification of the message MAC failed" |
| 5781 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5782 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5783 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5784 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5785 | psk_identity=def psk=beef" \ |
| 5786 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5787 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5788 | -S "SSL - Unknown identity received" \ |
| 5789 | -S "SSL - Verification of the message MAC failed" |
| 5790 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5791 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5792 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5793 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5794 | psk_identity=ghi psk=beef" \ |
| 5795 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5796 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5797 | -s "SSL - Unknown identity received" \ |
| 5798 | -S "SSL - Verification of the message MAC failed" |
| 5799 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5800 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5801 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5802 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5803 | psk_identity=abc psk=beef" \ |
| 5804 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5805 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5806 | -S "SSL - Unknown identity received" \ |
| 5807 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5808 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5809 | # Tests for EC J-PAKE |
| 5810 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5811 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5812 | run_test "ECJPAKE: client not configured" \ |
| 5813 | "$P_SRV debug_level=3" \ |
| 5814 | "$P_CLI debug_level=3" \ |
| 5815 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5816 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5817 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5818 | -S "found ecjpake kkpp extension" \ |
| 5819 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5820 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5821 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5822 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5823 | -S "None of the common ciphersuites is usable" |
| 5824 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5825 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5826 | run_test "ECJPAKE: server not configured" \ |
| 5827 | "$P_SRV debug_level=3" \ |
| 5828 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5829 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5830 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5831 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5832 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5833 | -s "found ecjpake kkpp extension" \ |
| 5834 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5835 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5836 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5837 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5838 | -s "None of the common ciphersuites is usable" |
| 5839 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5840 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5841 | run_test "ECJPAKE: working, TLS" \ |
| 5842 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5843 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5844 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5845 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5846 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5847 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5848 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5849 | -s "found ecjpake kkpp extension" \ |
| 5850 | -S "skip ecjpake kkpp extension" \ |
| 5851 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5852 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5853 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5854 | -S "None of the common ciphersuites is usable" \ |
| 5855 | -S "SSL - Verification of the message MAC failed" |
| 5856 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5857 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5858 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5859 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5860 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5861 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5862 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5863 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5864 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5865 | -s "SSL - Verification of the message MAC failed" |
| 5866 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5867 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5868 | run_test "ECJPAKE: working, DTLS" \ |
| 5869 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5870 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5871 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5872 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5873 | -c "re-using cached ecjpake parameters" \ |
| 5874 | -S "SSL - Verification of the message MAC failed" |
| 5875 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5876 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5877 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5878 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5879 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5880 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5881 | 0 \ |
| 5882 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5883 | -S "SSL - Verification of the message MAC failed" |
| 5884 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5885 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5886 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5887 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5888 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5889 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5890 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5891 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5892 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5893 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5894 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5895 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5896 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5897 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5898 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5899 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5900 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5901 | 0 |
| 5902 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5903 | # Tests for ciphersuites per version |
| 5904 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5905 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5906 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5907 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5908 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5909 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5910 | "$P_CLI force_version=ssl3" \ |
| 5911 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5912 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5913 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5915 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5916 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5917 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5918 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 5919 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5920 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5921 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5922 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5924 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5925 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5926 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5927 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5928 | "$P_CLI force_version=tls1_1" \ |
| 5929 | 0 \ |
| 5930 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5931 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5933 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5934 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5935 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5936 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5937 | "$P_CLI force_version=tls1_2" \ |
| 5938 | 0 \ |
| 5939 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5940 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5941 | # Test for ClientHello without extensions |
| 5942 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5943 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5944 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5945 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5946 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5947 | 0 \ |
| 5948 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5949 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5950 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5951 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5952 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5953 | "$P_SRV" \ |
| 5954 | "$P_CLI request_size=100" \ |
| 5955 | 0 \ |
| 5956 | -s "Read from client: 100 bytes read$" |
| 5957 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5958 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5959 | "$P_SRV" \ |
| 5960 | "$P_CLI request_size=500" \ |
| 5961 | 0 \ |
| 5962 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5963 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5964 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5965 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5966 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5967 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5968 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5969 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5970 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5971 | 0 \ |
| 5972 | -s "Read from client: 1 bytes read" |
| 5973 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5974 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5975 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5976 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5977 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5978 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5979 | 0 \ |
| 5980 | -s "Read from client: 1 bytes read" |
| 5981 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5982 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5983 | "$P_SRV" \ |
| 5984 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5985 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5986 | 0 \ |
| 5987 | -s "Read from client: 1 bytes read" |
| 5988 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5989 | 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] | 5990 | "$P_SRV" \ |
| 5991 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5992 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5993 | 0 \ |
| 5994 | -s "Read from client: 1 bytes read" |
| 5995 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +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.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5998 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5999 | "$P_CLI request_size=1 force_version=tls1 \ |
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" \ |
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 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6004 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6005 | 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] | 6006 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6007 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6008 | 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] | 6009 | 0 \ |
| 6010 | -s "Read from client: 1 bytes read" |
| 6011 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6012 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6013 | "$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] | 6014 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6015 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6016 | 0 \ |
| 6017 | -s "Read from client: 1 bytes read" |
| 6018 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6019 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6020 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6021 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6022 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6023 | 0 \ |
| 6024 | -s "Read from client: 1 bytes read" |
| 6025 | |
| 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.0 StreamCipher, 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" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6029 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6030 | 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] | 6031 | 0 \ |
| 6032 | -s "Read from client: 1 bytes read" |
| 6033 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6034 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6035 | 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] | 6036 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6037 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6038 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6039 | 0 \ |
| 6040 | -s "Read from client: 1 bytes read" |
| 6041 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6042 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6043 | "$P_SRV" \ |
| 6044 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6045 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6046 | 0 \ |
| 6047 | -s "Read from client: 1 bytes read" |
| 6048 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6049 | 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] | 6050 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6051 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6052 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6053 | 0 \ |
| 6054 | -s "Read from client: 1 bytes read" |
| 6055 | |
| 6056 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6057 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6058 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6059 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6060 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6061 | 0 \ |
| 6062 | -s "Read from client: 1 bytes read" |
| 6063 | |
| 6064 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6065 | 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] | 6066 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6067 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6068 | 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] | 6069 | 0 \ |
| 6070 | -s "Read from client: 1 bytes read" |
| 6071 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6072 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6073 | "$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] | 6074 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6075 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6076 | 0 \ |
| 6077 | -s "Read from client: 1 bytes read" |
| 6078 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6079 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6080 | "$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] | 6081 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6082 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6083 | 0 \ |
| 6084 | -s "Read from client: 1 bytes read" |
| 6085 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6086 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6087 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6088 | "$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] | 6089 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6090 | 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] | 6091 | 0 \ |
| 6092 | -s "Read from client: 1 bytes read" |
| 6093 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6094 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6095 | 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] | 6096 | "$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] | 6097 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6098 | 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] | 6099 | 0 \ |
| 6100 | -s "Read from client: 1 bytes read" |
| 6101 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6102 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6103 | "$P_SRV" \ |
| 6104 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6105 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6106 | 0 \ |
| 6107 | -s "Read from client: 1 bytes read" |
| 6108 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6109 | 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] | 6110 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6111 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6112 | 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] | 6113 | 0 \ |
| 6114 | -s "Read from client: 1 bytes read" |
| 6115 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6116 | 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] | 6117 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6118 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6119 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6120 | 0 \ |
| 6121 | -s "Read from client: 1 bytes read" |
| 6122 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6123 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6124 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6125 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6126 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6127 | 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] | 6128 | 0 \ |
| 6129 | -s "Read from client: 1 bytes read" |
| 6130 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6131 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6132 | 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] | 6133 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6134 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6135 | 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] | 6136 | 0 \ |
| 6137 | -s "Read from client: 1 bytes read" |
| 6138 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6139 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6140 | "$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] | 6141 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6142 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6143 | 0 \ |
| 6144 | -s "Read from client: 1 bytes read" |
| 6145 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6146 | 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] | 6147 | "$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] | 6148 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6149 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6150 | 0 \ |
| 6151 | -s "Read from client: 1 bytes read" |
| 6152 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6153 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6154 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6155 | "$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] | 6156 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6157 | 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] | 6158 | 0 \ |
| 6159 | -s "Read from client: 1 bytes read" |
| 6160 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6161 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6162 | 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] | 6163 | "$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] | 6164 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6165 | 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] | 6166 | 0 \ |
| 6167 | -s "Read from client: 1 bytes read" |
| 6168 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6169 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6170 | "$P_SRV" \ |
| 6171 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6172 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6173 | 0 \ |
| 6174 | -s "Read from client: 1 bytes read" |
| 6175 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6176 | 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] | 6177 | "$P_SRV" \ |
| 6178 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6179 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6180 | 0 \ |
| 6181 | -s "Read from client: 1 bytes read" |
| 6182 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6183 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6184 | |
| 6185 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6186 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6187 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6188 | "$P_CLI dtls=1 request_size=1 \ |
| 6189 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6190 | 0 \ |
| 6191 | -s "Read from client: 1 bytes read" |
| 6192 | |
| 6193 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6194 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6195 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6196 | "$P_CLI dtls=1 request_size=1 \ |
| 6197 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6198 | 0 \ |
| 6199 | -s "Read from client: 1 bytes read" |
| 6200 | |
| 6201 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6202 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6203 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6204 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6205 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6206 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6207 | 0 \ |
| 6208 | -s "Read from client: 1 bytes read" |
| 6209 | |
| 6210 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6211 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6212 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6213 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6214 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6215 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6216 | 0 \ |
| 6217 | -s "Read from client: 1 bytes read" |
| 6218 | |
| 6219 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6220 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6221 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 6222 | "$P_CLI dtls=1 request_size=1 \ |
| 6223 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6224 | 0 \ |
| 6225 | -s "Read from client: 1 bytes read" |
| 6226 | |
| 6227 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6228 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6229 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6230 | "$P_CLI dtls=1 request_size=1 \ |
| 6231 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6232 | 0 \ |
| 6233 | -s "Read from client: 1 bytes read" |
| 6234 | |
| 6235 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6236 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6237 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6238 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6239 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6240 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6241 | 0 \ |
| 6242 | -s "Read from client: 1 bytes read" |
| 6243 | |
| 6244 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6245 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6246 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6247 | "$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] | 6248 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6249 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6250 | 0 \ |
| 6251 | -s "Read from client: 1 bytes read" |
| 6252 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6253 | # Tests for small server packets |
| 6254 | |
| 6255 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6256 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6257 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6258 | "$P_CLI force_version=ssl3 \ |
| 6259 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6260 | 0 \ |
| 6261 | -c "Read from server: 1 bytes read" |
| 6262 | |
| 6263 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6264 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6265 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6266 | "$P_CLI force_version=ssl3 \ |
| 6267 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6268 | 0 \ |
| 6269 | -c "Read from server: 1 bytes read" |
| 6270 | |
| 6271 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6272 | "$P_SRV response_size=1" \ |
| 6273 | "$P_CLI force_version=tls1 \ |
| 6274 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6275 | 0 \ |
| 6276 | -c "Read from server: 1 bytes read" |
| 6277 | |
| 6278 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6279 | "$P_SRV response_size=1" \ |
| 6280 | "$P_CLI force_version=tls1 etm=0 \ |
| 6281 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6282 | 0 \ |
| 6283 | -c "Read from server: 1 bytes read" |
| 6284 | |
| 6285 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6286 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6287 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6288 | "$P_CLI force_version=tls1 \ |
| 6289 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6290 | 0 \ |
| 6291 | -c "Read from server: 1 bytes read" |
| 6292 | |
| 6293 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6294 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6295 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6296 | "$P_CLI force_version=tls1 \ |
| 6297 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6298 | 0 \ |
| 6299 | -c "Read from server: 1 bytes read" |
| 6300 | |
| 6301 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6302 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6303 | "$P_CLI force_version=tls1 \ |
| 6304 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6305 | 0 \ |
| 6306 | -c "Read from server: 1 bytes read" |
| 6307 | |
| 6308 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6309 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6310 | "$P_CLI force_version=tls1 \ |
| 6311 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6312 | 0 \ |
| 6313 | -c "Read from server: 1 bytes read" |
| 6314 | |
| 6315 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6316 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6317 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6318 | "$P_CLI force_version=tls1 \ |
| 6319 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6320 | 0 \ |
| 6321 | -c "Read from server: 1 bytes read" |
| 6322 | |
| 6323 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6324 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6325 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6326 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6327 | trunc_hmac=1 etm=0" \ |
| 6328 | 0 \ |
| 6329 | -c "Read from server: 1 bytes read" |
| 6330 | |
| 6331 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6332 | "$P_SRV response_size=1" \ |
| 6333 | "$P_CLI force_version=tls1_1 \ |
| 6334 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6335 | 0 \ |
| 6336 | -c "Read from server: 1 bytes read" |
| 6337 | |
| 6338 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6339 | "$P_SRV response_size=1" \ |
| 6340 | "$P_CLI force_version=tls1_1 \ |
| 6341 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6342 | 0 \ |
| 6343 | -c "Read from server: 1 bytes read" |
| 6344 | |
| 6345 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6346 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6347 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6348 | "$P_CLI force_version=tls1_1 \ |
| 6349 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6350 | 0 \ |
| 6351 | -c "Read from server: 1 bytes read" |
| 6352 | |
| 6353 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6354 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6355 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6356 | "$P_CLI force_version=tls1_1 \ |
| 6357 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6358 | 0 \ |
| 6359 | -c "Read from server: 1 bytes read" |
| 6360 | |
| 6361 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6362 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6363 | "$P_CLI force_version=tls1_1 \ |
| 6364 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6365 | 0 \ |
| 6366 | -c "Read from server: 1 bytes read" |
| 6367 | |
| 6368 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6369 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6370 | "$P_CLI force_version=tls1_1 \ |
| 6371 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6372 | 0 \ |
| 6373 | -c "Read from server: 1 bytes read" |
| 6374 | |
| 6375 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6376 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6377 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6378 | "$P_CLI force_version=tls1_1 \ |
| 6379 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6380 | 0 \ |
| 6381 | -c "Read from server: 1 bytes read" |
| 6382 | |
| 6383 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6384 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6385 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6386 | "$P_CLI force_version=tls1_1 \ |
| 6387 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6388 | 0 \ |
| 6389 | -c "Read from server: 1 bytes read" |
| 6390 | |
| 6391 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6392 | "$P_SRV response_size=1" \ |
| 6393 | "$P_CLI force_version=tls1_2 \ |
| 6394 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6395 | 0 \ |
| 6396 | -c "Read from server: 1 bytes read" |
| 6397 | |
| 6398 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6399 | "$P_SRV response_size=1" \ |
| 6400 | "$P_CLI force_version=tls1_2 \ |
| 6401 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6402 | 0 \ |
| 6403 | -c "Read from server: 1 bytes read" |
| 6404 | |
| 6405 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6406 | "$P_SRV response_size=1" \ |
| 6407 | "$P_CLI force_version=tls1_2 \ |
| 6408 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6409 | 0 \ |
| 6410 | -c "Read from server: 1 bytes read" |
| 6411 | |
| 6412 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6413 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6414 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6415 | "$P_CLI force_version=tls1_2 \ |
| 6416 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6417 | 0 \ |
| 6418 | -c "Read from server: 1 bytes read" |
| 6419 | |
| 6420 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6421 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6422 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6423 | "$P_CLI force_version=tls1_2 \ |
| 6424 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6425 | 0 \ |
| 6426 | -c "Read from server: 1 bytes read" |
| 6427 | |
| 6428 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6429 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6430 | "$P_CLI force_version=tls1_2 \ |
| 6431 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6432 | 0 \ |
| 6433 | -c "Read from server: 1 bytes read" |
| 6434 | |
| 6435 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6436 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6437 | "$P_CLI force_version=tls1_2 \ |
| 6438 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6439 | 0 \ |
| 6440 | -c "Read from server: 1 bytes read" |
| 6441 | |
| 6442 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6443 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6444 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6445 | "$P_CLI force_version=tls1_2 \ |
| 6446 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6447 | 0 \ |
| 6448 | -c "Read from server: 1 bytes read" |
| 6449 | |
| 6450 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6451 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6452 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6453 | "$P_CLI force_version=tls1_2 \ |
| 6454 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6455 | 0 \ |
| 6456 | -c "Read from server: 1 bytes read" |
| 6457 | |
| 6458 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6459 | "$P_SRV response_size=1" \ |
| 6460 | "$P_CLI force_version=tls1_2 \ |
| 6461 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6462 | 0 \ |
| 6463 | -c "Read from server: 1 bytes read" |
| 6464 | |
| 6465 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6466 | "$P_SRV response_size=1" \ |
| 6467 | "$P_CLI force_version=tls1_2 \ |
| 6468 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6469 | 0 \ |
| 6470 | -c "Read from server: 1 bytes read" |
| 6471 | |
| 6472 | # Tests for small server packets in DTLS |
| 6473 | |
| 6474 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6475 | run_test "Small server packet DTLS 1.0" \ |
| 6476 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6477 | "$P_CLI dtls=1 \ |
| 6478 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6479 | 0 \ |
| 6480 | -c "Read from server: 1 bytes read" |
| 6481 | |
| 6482 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6483 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6484 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6485 | "$P_CLI dtls=1 \ |
| 6486 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6487 | 0 \ |
| 6488 | -c "Read from server: 1 bytes read" |
| 6489 | |
| 6490 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6491 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6492 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6493 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6494 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6495 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6496 | 0 \ |
| 6497 | -c "Read from server: 1 bytes read" |
| 6498 | |
| 6499 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6500 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6501 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6502 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6503 | "$P_CLI dtls=1 \ |
| 6504 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6505 | 0 \ |
| 6506 | -c "Read from server: 1 bytes read" |
| 6507 | |
| 6508 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6509 | run_test "Small server packet DTLS 1.2" \ |
| 6510 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6511 | "$P_CLI dtls=1 \ |
| 6512 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6513 | 0 \ |
| 6514 | -c "Read from server: 1 bytes read" |
| 6515 | |
| 6516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6517 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6518 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6519 | "$P_CLI dtls=1 \ |
| 6520 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6521 | 0 \ |
| 6522 | -c "Read from server: 1 bytes read" |
| 6523 | |
| 6524 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6525 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6526 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6527 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6528 | "$P_CLI dtls=1 \ |
| 6529 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6530 | 0 \ |
| 6531 | -c "Read from server: 1 bytes read" |
| 6532 | |
| 6533 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6534 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6535 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6536 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6537 | "$P_CLI dtls=1 \ |
| 6538 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6539 | 0 \ |
| 6540 | -c "Read from server: 1 bytes read" |
| 6541 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6542 | # A test for extensions in SSLv3 |
| 6543 | |
| 6544 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6545 | run_test "SSLv3 with extensions, server side" \ |
| 6546 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6547 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6548 | 0 \ |
| 6549 | -S "dumping 'client hello extensions'" \ |
| 6550 | -S "server hello, total extension length:" |
| 6551 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6552 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6553 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6554 | # How many fragments do we expect to write $1 bytes? |
| 6555 | fragments_for_write() { |
| 6556 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6557 | } |
| 6558 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6559 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6560 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6561 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6562 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6563 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6564 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6565 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6566 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6567 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6568 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6569 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6570 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6571 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6572 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6573 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6574 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6575 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6576 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6577 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6578 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6579 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6580 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6581 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6582 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6583 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6584 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6585 | 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] | 6586 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6587 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6588 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6589 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6590 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6591 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6592 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6593 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6594 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6595 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6596 | 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] | 6597 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6598 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6599 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6600 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6601 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6602 | 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] | 6603 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6604 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6605 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6606 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6607 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6608 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6609 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6610 | "$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] | 6611 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6612 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6613 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6614 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6615 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6616 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6617 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6618 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6619 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6620 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6621 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6622 | |
| 6623 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6624 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6625 | "$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] | 6626 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6627 | 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] | 6628 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6629 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6630 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6631 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6632 | 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] | 6633 | "$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] | 6634 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6635 | 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] | 6636 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6637 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6638 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6639 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6640 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6641 | "$P_SRV" \ |
| 6642 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6643 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6644 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6645 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6646 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6647 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6648 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6649 | "$P_SRV" \ |
| 6650 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6651 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6652 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6653 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6654 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6655 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6656 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6657 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6658 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6659 | 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] | 6660 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6661 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6662 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6663 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6664 | 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] | 6665 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6666 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6667 | 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] | 6668 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6669 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6670 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6671 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6672 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6673 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6674 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6675 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6676 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6677 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6678 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6679 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6680 | "$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] | 6681 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6682 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6683 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6684 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6685 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6686 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6687 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6688 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6689 | "$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] | 6690 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6691 | 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] | 6692 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6693 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6694 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6696 | 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] | 6697 | "$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] | 6698 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6699 | 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] | 6700 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6701 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6702 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6703 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6704 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6705 | "$P_SRV" \ |
| 6706 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6707 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6708 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6709 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6710 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6711 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6712 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6713 | "$P_SRV" \ |
| 6714 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6715 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6716 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6717 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6718 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6719 | 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] | 6720 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6721 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6722 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6723 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6724 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6725 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6726 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6727 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6728 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6729 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6730 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6731 | 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] | 6732 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6733 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6734 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6735 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6736 | 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] | 6737 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6738 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6739 | 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] | 6740 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6741 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6742 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6743 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6744 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6745 | "$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] | 6746 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6747 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6748 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6749 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6750 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6751 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6752 | 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] | 6753 | "$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] | 6754 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6755 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6756 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6757 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6758 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6759 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6760 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6761 | "$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] | 6762 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6763 | 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] | 6764 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6765 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6766 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6767 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6768 | 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] | 6769 | "$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] | 6770 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6771 | 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] | 6772 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6773 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6774 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6775 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6776 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6777 | "$P_SRV" \ |
| 6778 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6779 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6780 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6781 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6782 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6783 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6784 | 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] | 6785 | "$P_SRV" \ |
| 6786 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6787 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6788 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6789 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6790 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6791 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6792 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6793 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6794 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 6795 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6796 | "$P_CLI force_version=ssl3 \ |
| 6797 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6798 | 0 \ |
| 6799 | -c "Read from server: 16384 bytes read" |
| 6800 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6801 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 6802 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6803 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 6804 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 6805 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 6806 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6807 | 0 \ |
| 6808 | -c "Read from server: 1 bytes read"\ |
| 6809 | -c "16383 bytes read"\ |
| 6810 | -C "Read from server: 16384 bytes read" |
| 6811 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6812 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6813 | "$P_SRV response_size=16384" \ |
| 6814 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6815 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6816 | 0 \ |
| 6817 | -c "Read from server: 1 bytes read"\ |
| 6818 | -c "16383 bytes read"\ |
| 6819 | -C "Read from server: 16384 bytes read" |
| 6820 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6821 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6822 | "$P_SRV response_size=16384" \ |
| 6823 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6824 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6825 | 0 \ |
| 6826 | -c "Read from server: 1 bytes read"\ |
| 6827 | -c "16383 bytes read"\ |
| 6828 | -C "Read from server: 16384 bytes read" |
| 6829 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6830 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6831 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6832 | "$P_SRV response_size=16384" \ |
| 6833 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6834 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6835 | trunc_hmac=1" \ |
| 6836 | 0 \ |
| 6837 | -c "Read from server: 1 bytes read"\ |
| 6838 | -c "16383 bytes read"\ |
| 6839 | -C "Read from server: 16384 bytes read" |
| 6840 | |
| 6841 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6842 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6843 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6844 | "$P_CLI force_version=tls1 \ |
| 6845 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6846 | trunc_hmac=1" \ |
| 6847 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6848 | -s "16384 bytes written in 1 fragments" \ |
| 6849 | -c "Read from server: 16384 bytes read" |
| 6850 | |
| 6851 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6852 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6853 | "$P_CLI force_version=tls1 \ |
| 6854 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6855 | 0 \ |
| 6856 | -s "16384 bytes written in 1 fragments" \ |
| 6857 | -c "Read from server: 16384 bytes read" |
| 6858 | |
| 6859 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6860 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6861 | "$P_CLI force_version=tls1 \ |
| 6862 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6863 | 0 \ |
| 6864 | -s "16384 bytes written in 1 fragments" \ |
| 6865 | -c "Read from server: 16384 bytes read" |
| 6866 | |
| 6867 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6868 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6869 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6870 | "$P_CLI force_version=tls1 \ |
| 6871 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6872 | 0 \ |
| 6873 | -s "16384 bytes written in 1 fragments" \ |
| 6874 | -c "Read from server: 16384 bytes read" |
| 6875 | |
| 6876 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6877 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6878 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6879 | "$P_CLI force_version=tls1 \ |
| 6880 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6881 | 0 \ |
| 6882 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6883 | -c "Read from server: 16384 bytes read" |
| 6884 | |
| 6885 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6886 | "$P_SRV response_size=16384" \ |
| 6887 | "$P_CLI force_version=tls1_1 \ |
| 6888 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6889 | 0 \ |
| 6890 | -c "Read from server: 16384 bytes read" |
| 6891 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6892 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6893 | "$P_SRV response_size=16384" \ |
| 6894 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6895 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6896 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6897 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6898 | -c "Read from server: 16384 bytes read" |
| 6899 | |
| 6900 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6901 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6902 | "$P_SRV response_size=16384" \ |
| 6903 | "$P_CLI force_version=tls1_1 \ |
| 6904 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6905 | trunc_hmac=1" \ |
| 6906 | 0 \ |
| 6907 | -c "Read from server: 16384 bytes read" |
| 6908 | |
| 6909 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6910 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6911 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6912 | "$P_CLI force_version=tls1_1 \ |
| 6913 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6914 | 0 \ |
| 6915 | -s "16384 bytes written in 1 fragments" \ |
| 6916 | -c "Read from server: 16384 bytes read" |
| 6917 | |
| 6918 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6919 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6920 | "$P_CLI force_version=tls1_1 \ |
| 6921 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6922 | 0 \ |
| 6923 | -c "Read from server: 16384 bytes read" |
| 6924 | |
| 6925 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6926 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6927 | "$P_CLI force_version=tls1_1 \ |
| 6928 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6929 | 0 \ |
| 6930 | -s "16384 bytes written in 1 fragments" \ |
| 6931 | -c "Read from server: 16384 bytes read" |
| 6932 | |
| 6933 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6934 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 6935 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6936 | "$P_CLI force_version=tls1_1 \ |
| 6937 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6938 | trunc_hmac=1" \ |
| 6939 | 0 \ |
| 6940 | -c "Read from server: 16384 bytes read" |
| 6941 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6942 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6943 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6944 | "$P_CLI force_version=tls1_1 \ |
| 6945 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6946 | 0 \ |
| 6947 | -s "16384 bytes written in 1 fragments" \ |
| 6948 | -c "Read from server: 16384 bytes read" |
| 6949 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6950 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6951 | "$P_SRV response_size=16384" \ |
| 6952 | "$P_CLI force_version=tls1_2 \ |
| 6953 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6954 | 0 \ |
| 6955 | -c "Read from server: 16384 bytes read" |
| 6956 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6957 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6958 | "$P_SRV response_size=16384" \ |
| 6959 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6960 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6961 | 0 \ |
| 6962 | -s "16384 bytes written in 1 fragments" \ |
| 6963 | -c "Read from server: 16384 bytes read" |
| 6964 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6965 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6966 | "$P_SRV response_size=16384" \ |
| 6967 | "$P_CLI force_version=tls1_2 \ |
| 6968 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6969 | 0 \ |
| 6970 | -c "Read from server: 16384 bytes read" |
| 6971 | |
| 6972 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6973 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6974 | "$P_SRV response_size=16384" \ |
| 6975 | "$P_CLI force_version=tls1_2 \ |
| 6976 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6977 | trunc_hmac=1" \ |
| 6978 | 0 \ |
| 6979 | -c "Read from server: 16384 bytes read" |
| 6980 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6981 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6982 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6983 | "$P_CLI force_version=tls1_2 \ |
| 6984 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6985 | 0 \ |
| 6986 | -s "16384 bytes written in 1 fragments" \ |
| 6987 | -c "Read from server: 16384 bytes read" |
| 6988 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6989 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 6990 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6991 | "$P_CLI force_version=tls1_2 \ |
| 6992 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6993 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6994 | -s "16384 bytes written in 1 fragments" \ |
| 6995 | -c "Read from server: 16384 bytes read" |
| 6996 | |
| 6997 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6998 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6999 | "$P_CLI force_version=tls1_2 \ |
| 7000 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7001 | 0 \ |
| 7002 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7003 | -c "Read from server: 16384 bytes read" |
| 7004 | |
| 7005 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7006 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 7007 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7008 | "$P_CLI force_version=tls1_2 \ |
| 7009 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7010 | trunc_hmac=1" \ |
| 7011 | 0 \ |
| 7012 | -c "Read from server: 16384 bytes read" |
| 7013 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7014 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7015 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7016 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7017 | "$P_CLI force_version=tls1_2 \ |
| 7018 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7019 | 0 \ |
| 7020 | -s "16384 bytes written in 1 fragments" \ |
| 7021 | -c "Read from server: 16384 bytes read" |
| 7022 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7023 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 7024 | "$P_SRV response_size=16384" \ |
| 7025 | "$P_CLI force_version=tls1_2 \ |
| 7026 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7027 | 0 \ |
| 7028 | -c "Read from server: 16384 bytes read" |
| 7029 | |
| 7030 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 7031 | "$P_SRV response_size=16384" \ |
| 7032 | "$P_CLI force_version=tls1_2 \ |
| 7033 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7034 | 0 \ |
| 7035 | -c "Read from server: 16384 bytes read" |
| 7036 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7037 | # Tests for restartable ECC |
| 7038 | |
| 7039 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7040 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7041 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7042 | "$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] | 7043 | 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] | 7044 | debug_level=1" \ |
| 7045 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7046 | -C "x509_verify_cert.*4b00" \ |
| 7047 | -C "mbedtls_pk_verify.*4b00" \ |
| 7048 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7049 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7050 | |
| 7051 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7052 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7053 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7054 | "$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] | 7055 | 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] | 7056 | debug_level=1 ec_max_ops=0" \ |
| 7057 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7058 | -C "x509_verify_cert.*4b00" \ |
| 7059 | -C "mbedtls_pk_verify.*4b00" \ |
| 7060 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7061 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7062 | |
| 7063 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7064 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7065 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7066 | "$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] | 7067 | 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] | 7068 | debug_level=1 ec_max_ops=65535" \ |
| 7069 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7070 | -C "x509_verify_cert.*4b00" \ |
| 7071 | -C "mbedtls_pk_verify.*4b00" \ |
| 7072 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7073 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7074 | |
| 7075 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7076 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7077 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7078 | "$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] | 7079 | 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] | 7080 | debug_level=1 ec_max_ops=1000" \ |
| 7081 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7082 | -c "x509_verify_cert.*4b00" \ |
| 7083 | -c "mbedtls_pk_verify.*4b00" \ |
| 7084 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7085 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7086 | |
| 7087 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7088 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7089 | "$P_SRV auth_mode=required \ |
| 7090 | crt_file=data_files/server5-badsign.crt \ |
| 7091 | key_file=data_files/server5.key" \ |
| 7092 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7093 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7094 | debug_level=1 ec_max_ops=1000" \ |
| 7095 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7096 | -c "x509_verify_cert.*4b00" \ |
| 7097 | -C "mbedtls_pk_verify.*4b00" \ |
| 7098 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7099 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7100 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7101 | -c "! mbedtls_ssl_handshake returned" \ |
| 7102 | -c "X509 - Certificate verification failed" |
| 7103 | |
| 7104 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7105 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7106 | "$P_SRV auth_mode=required \ |
| 7107 | crt_file=data_files/server5-badsign.crt \ |
| 7108 | key_file=data_files/server5.key" \ |
| 7109 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7110 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7111 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7112 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7113 | -c "x509_verify_cert.*4b00" \ |
| 7114 | -c "mbedtls_pk_verify.*4b00" \ |
| 7115 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7116 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7117 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7118 | -C "! mbedtls_ssl_handshake returned" \ |
| 7119 | -C "X509 - Certificate verification failed" |
| 7120 | |
| 7121 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7122 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7123 | "$P_SRV auth_mode=required \ |
| 7124 | crt_file=data_files/server5-badsign.crt \ |
| 7125 | key_file=data_files/server5.key" \ |
| 7126 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7127 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7128 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7129 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7130 | -C "x509_verify_cert.*4b00" \ |
| 7131 | -c "mbedtls_pk_verify.*4b00" \ |
| 7132 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7133 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7134 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7135 | -C "! mbedtls_ssl_handshake returned" \ |
| 7136 | -C "X509 - Certificate verification failed" |
| 7137 | |
| 7138 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7139 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7140 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7141 | "$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] | 7142 | 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] | 7143 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7144 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7145 | -c "x509_verify_cert.*4b00" \ |
| 7146 | -c "mbedtls_pk_verify.*4b00" \ |
| 7147 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7148 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7149 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7150 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7151 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7152 | "$P_SRV" \ |
| 7153 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7154 | debug_level=1 ec_max_ops=1000" \ |
| 7155 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7156 | -c "x509_verify_cert.*4b00" \ |
| 7157 | -c "mbedtls_pk_verify.*4b00" \ |
| 7158 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7159 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7160 | |
| 7161 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7162 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 7163 | "$P_SRV psk=abc123" \ |
| 7164 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7165 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7166 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7167 | -C "x509_verify_cert.*4b00" \ |
| 7168 | -C "mbedtls_pk_verify.*4b00" \ |
| 7169 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7170 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7171 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7172 | # Tests of asynchronous private key support in SSL |
| 7173 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7174 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7175 | run_test "SSL async private: sign, delay=0" \ |
| 7176 | "$P_SRV \ |
| 7177 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7178 | "$P_CLI" \ |
| 7179 | 0 \ |
| 7180 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7181 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7182 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7183 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7184 | run_test "SSL async private: sign, delay=1" \ |
| 7185 | "$P_SRV \ |
| 7186 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7187 | "$P_CLI" \ |
| 7188 | 0 \ |
| 7189 | -s "Async sign callback: using key slot " \ |
| 7190 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7191 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7192 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7193 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7194 | run_test "SSL async private: sign, delay=2" \ |
| 7195 | "$P_SRV \ |
| 7196 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7197 | "$P_CLI" \ |
| 7198 | 0 \ |
| 7199 | -s "Async sign callback: using key slot " \ |
| 7200 | -U "Async sign callback: using key slot " \ |
| 7201 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7202 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7203 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7204 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7205 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7206 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7207 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7209 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7210 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7211 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7212 | "$P_CLI force_version=tls1_1" \ |
| 7213 | 0 \ |
| 7214 | -s "Async sign callback: using key slot " \ |
| 7215 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7216 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7217 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7218 | run_test "SSL async private: sign, SNI" \ |
| 7219 | "$P_SRV debug_level=3 \ |
| 7220 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7221 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7222 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7223 | "$P_CLI server_name=polarssl.example" \ |
| 7224 | 0 \ |
| 7225 | -s "Async sign callback: using key slot " \ |
| 7226 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7227 | -s "parse ServerName extension" \ |
| 7228 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7229 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7230 | |
| 7231 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7232 | run_test "SSL async private: decrypt, delay=0" \ |
| 7233 | "$P_SRV \ |
| 7234 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7235 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7236 | 0 \ |
| 7237 | -s "Async decrypt callback: using key slot " \ |
| 7238 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7239 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7240 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7241 | run_test "SSL async private: decrypt, delay=1" \ |
| 7242 | "$P_SRV \ |
| 7243 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7244 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7245 | 0 \ |
| 7246 | -s "Async decrypt callback: using key slot " \ |
| 7247 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7248 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7249 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7250 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7251 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7252 | "$P_SRV psk=abc123 \ |
| 7253 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7254 | "$P_CLI psk=abc123 \ |
| 7255 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7256 | 0 \ |
| 7257 | -s "Async decrypt callback: using key slot " \ |
| 7258 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7259 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7260 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7261 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7262 | "$P_SRV psk=abc123 \ |
| 7263 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7264 | "$P_CLI psk=abc123 \ |
| 7265 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7266 | 0 \ |
| 7267 | -s "Async decrypt callback: using key slot " \ |
| 7268 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7269 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7270 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7271 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7272 | run_test "SSL async private: sign callback not present" \ |
| 7273 | "$P_SRV \ |
| 7274 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7275 | "$P_CLI; [ \$? -eq 1 ] && |
| 7276 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7277 | 0 \ |
| 7278 | -S "Async sign callback" \ |
| 7279 | -s "! mbedtls_ssl_handshake returned" \ |
| 7280 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7281 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7282 | -s "Successful connection" |
| 7283 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7284 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7285 | run_test "SSL async private: decrypt callback not present" \ |
| 7286 | "$P_SRV debug_level=1 \ |
| 7287 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7288 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7289 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7290 | 0 \ |
| 7291 | -S "Async decrypt callback" \ |
| 7292 | -s "! mbedtls_ssl_handshake returned" \ |
| 7293 | -s "got no RSA private key" \ |
| 7294 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7295 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7296 | |
| 7297 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7298 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7299 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7300 | "$P_SRV \ |
| 7301 | async_operations=s async_private_delay1=1 \ |
| 7302 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7303 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7304 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7305 | 0 \ |
| 7306 | -s "Async sign callback: using key slot 0," \ |
| 7307 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7308 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7309 | |
| 7310 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7311 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7312 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7313 | "$P_SRV \ |
| 7314 | async_operations=s async_private_delay2=1 \ |
| 7315 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7316 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7317 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7318 | 0 \ |
| 7319 | -s "Async sign callback: using key slot 0," \ |
| 7320 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7321 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7322 | |
| 7323 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7324 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7325 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7326 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7327 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7328 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7329 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7330 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7331 | 0 \ |
| 7332 | -s "Async sign callback: using key slot 1," \ |
| 7333 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7334 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7335 | |
| 7336 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7337 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7338 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7339 | "$P_SRV \ |
| 7340 | async_operations=s async_private_delay1=1 \ |
| 7341 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7342 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7343 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7344 | 0 \ |
| 7345 | -s "Async sign callback: no key matches this certificate." |
| 7346 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7347 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7348 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7349 | "$P_SRV \ |
| 7350 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7351 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7352 | "$P_CLI" \ |
| 7353 | 1 \ |
| 7354 | -s "Async sign callback: injected error" \ |
| 7355 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7356 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7357 | -s "! mbedtls_ssl_handshake returned" |
| 7358 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7359 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7360 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7361 | "$P_SRV \ |
| 7362 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7363 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7364 | "$P_CLI" \ |
| 7365 | 1 \ |
| 7366 | -s "Async sign callback: using key slot " \ |
| 7367 | -S "Async resume" \ |
| 7368 | -s "Async cancel" |
| 7369 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7370 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7371 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7372 | "$P_SRV \ |
| 7373 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7374 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7375 | "$P_CLI" \ |
| 7376 | 1 \ |
| 7377 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7378 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7379 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7380 | -s "! mbedtls_ssl_handshake returned" |
| 7381 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7382 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7383 | run_test "SSL async private: decrypt, error in start" \ |
| 7384 | "$P_SRV \ |
| 7385 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7386 | async_private_error=1" \ |
| 7387 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7388 | 1 \ |
| 7389 | -s "Async decrypt callback: injected error" \ |
| 7390 | -S "Async resume" \ |
| 7391 | -S "Async cancel" \ |
| 7392 | -s "! mbedtls_ssl_handshake returned" |
| 7393 | |
| 7394 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7395 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7396 | "$P_SRV \ |
| 7397 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7398 | async_private_error=2" \ |
| 7399 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7400 | 1 \ |
| 7401 | -s "Async decrypt callback: using key slot " \ |
| 7402 | -S "Async resume" \ |
| 7403 | -s "Async cancel" |
| 7404 | |
| 7405 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7406 | run_test "SSL async private: decrypt, error in resume" \ |
| 7407 | "$P_SRV \ |
| 7408 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7409 | async_private_error=3" \ |
| 7410 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7411 | 1 \ |
| 7412 | -s "Async decrypt callback: using key slot " \ |
| 7413 | -s "Async resume callback: decrypt done but injected error" \ |
| 7414 | -S "Async cancel" \ |
| 7415 | -s "! mbedtls_ssl_handshake returned" |
| 7416 | |
| 7417 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7418 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7419 | "$P_SRV \ |
| 7420 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7421 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7422 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7423 | 0 \ |
| 7424 | -s "Async cancel" \ |
| 7425 | -s "! mbedtls_ssl_handshake returned" \ |
| 7426 | -s "Async resume" \ |
| 7427 | -s "Successful connection" |
| 7428 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7429 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7430 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7431 | "$P_SRV \ |
| 7432 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7433 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7434 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7435 | 0 \ |
| 7436 | -s "! mbedtls_ssl_handshake returned" \ |
| 7437 | -s "Async resume" \ |
| 7438 | -s "Successful connection" |
| 7439 | |
| 7440 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7441 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7442 | 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] | 7443 | "$P_SRV \ |
| 7444 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7445 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7446 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7447 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7448 | [ \$? -eq 1 ] && |
| 7449 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7450 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7451 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7452 | -S "Async resume" \ |
| 7453 | -s "Async cancel" \ |
| 7454 | -s "! mbedtls_ssl_handshake returned" \ |
| 7455 | -s "Async sign callback: no key matches this certificate." \ |
| 7456 | -s "Successful connection" |
| 7457 | |
| 7458 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7459 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7460 | 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] | 7461 | "$P_SRV \ |
| 7462 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7463 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7464 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7465 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7466 | [ \$? -eq 1 ] && |
| 7467 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7468 | 0 \ |
| 7469 | -s "Async resume" \ |
| 7470 | -s "! mbedtls_ssl_handshake returned" \ |
| 7471 | -s "Async sign callback: no key matches this certificate." \ |
| 7472 | -s "Successful connection" |
| 7473 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7474 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7475 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7476 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7477 | "$P_SRV \ |
| 7478 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7479 | exchanges=2 renegotiation=1" \ |
| 7480 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7481 | 0 \ |
| 7482 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7483 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7484 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7485 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7487 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7488 | "$P_SRV \ |
| 7489 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7490 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7491 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7492 | 0 \ |
| 7493 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7494 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7495 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7496 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7497 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7498 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7499 | "$P_SRV \ |
| 7500 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7501 | exchanges=2 renegotiation=1" \ |
| 7502 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7503 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7504 | 0 \ |
| 7505 | -s "Async decrypt callback: using key slot " \ |
| 7506 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7507 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7508 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7509 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7510 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7511 | "$P_SRV \ |
| 7512 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7513 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7514 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7515 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7516 | 0 \ |
| 7517 | -s "Async decrypt callback: using key slot " \ |
| 7518 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7519 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7520 | # Tests for ECC extensions (rfc 4492) |
| 7521 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7522 | requires_config_enabled MBEDTLS_AES_C |
| 7523 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7524 | requires_config_enabled MBEDTLS_SHA256_C |
| 7525 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7526 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7527 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7528 | "$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] | 7529 | 0 \ |
| 7530 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7531 | -C "client hello, adding supported_point_formats extension" \ |
| 7532 | -S "found supported elliptic curves extension" \ |
| 7533 | -S "found supported point formats extension" |
| 7534 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7535 | requires_config_enabled MBEDTLS_AES_C |
| 7536 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7537 | requires_config_enabled MBEDTLS_SHA256_C |
| 7538 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7539 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7540 | "$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] | 7541 | "$P_CLI debug_level=3" \ |
| 7542 | 0 \ |
| 7543 | -C "found supported_point_formats extension" \ |
| 7544 | -S "server hello, supported_point_formats extension" |
| 7545 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7546 | requires_config_enabled MBEDTLS_AES_C |
| 7547 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7548 | requires_config_enabled MBEDTLS_SHA256_C |
| 7549 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7550 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7551 | "$P_SRV debug_level=3" \ |
| 7552 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7553 | 0 \ |
| 7554 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7555 | -c "client hello, adding supported_point_formats extension" \ |
| 7556 | -s "found supported elliptic curves extension" \ |
| 7557 | -s "found supported point formats extension" |
| 7558 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7559 | requires_config_enabled MBEDTLS_AES_C |
| 7560 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7561 | requires_config_enabled MBEDTLS_SHA256_C |
| 7562 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7563 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7564 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7565 | "$P_CLI debug_level=3" \ |
| 7566 | 0 \ |
| 7567 | -c "found supported_point_formats extension" \ |
| 7568 | -s "server hello, supported_point_formats extension" |
| 7569 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7570 | # Tests for DTLS HelloVerifyRequest |
| 7571 | |
| 7572 | run_test "DTLS cookie: enabled" \ |
| 7573 | "$P_SRV dtls=1 debug_level=2" \ |
| 7574 | "$P_CLI dtls=1 debug_level=2" \ |
| 7575 | 0 \ |
| 7576 | -s "cookie verification failed" \ |
| 7577 | -s "cookie verification passed" \ |
| 7578 | -S "cookie verification skipped" \ |
| 7579 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7580 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7581 | -S "SSL - The requested feature is not available" |
| 7582 | |
| 7583 | run_test "DTLS cookie: disabled" \ |
| 7584 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7585 | "$P_CLI dtls=1 debug_level=2" \ |
| 7586 | 0 \ |
| 7587 | -S "cookie verification failed" \ |
| 7588 | -S "cookie verification passed" \ |
| 7589 | -s "cookie verification skipped" \ |
| 7590 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7591 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7592 | -S "SSL - The requested feature is not available" |
| 7593 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7594 | run_test "DTLS cookie: default (failing)" \ |
| 7595 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7596 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7597 | 1 \ |
| 7598 | -s "cookie verification failed" \ |
| 7599 | -S "cookie verification passed" \ |
| 7600 | -S "cookie verification skipped" \ |
| 7601 | -C "received hello verify request" \ |
| 7602 | -S "hello verification requested" \ |
| 7603 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7604 | |
| 7605 | requires_ipv6 |
| 7606 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7607 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7608 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7609 | 0 \ |
| 7610 | -s "cookie verification failed" \ |
| 7611 | -s "cookie verification passed" \ |
| 7612 | -S "cookie verification skipped" \ |
| 7613 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7614 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7615 | -S "SSL - The requested feature is not available" |
| 7616 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7617 | run_test "DTLS cookie: enabled, nbio" \ |
| 7618 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7619 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7620 | 0 \ |
| 7621 | -s "cookie verification failed" \ |
| 7622 | -s "cookie verification passed" \ |
| 7623 | -S "cookie verification skipped" \ |
| 7624 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7625 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7626 | -S "SSL - The requested feature is not available" |
| 7627 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7628 | # Tests for client reconnecting from the same port with DTLS |
| 7629 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7630 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7631 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7632 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7633 | "$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] | 7634 | 0 \ |
| 7635 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7636 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7637 | -S "Client initiated reconnection from same port" |
| 7638 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7639 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7640 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7641 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7642 | "$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] | 7643 | 0 \ |
| 7644 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7645 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7646 | -s "Client initiated reconnection from same port" |
| 7647 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7648 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7649 | 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] | 7650 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7651 | "$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] | 7652 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7653 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7654 | -s "Client initiated reconnection from same port" |
| 7655 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7656 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7657 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7658 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7659 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7660 | 0 \ |
| 7661 | -S "The operation timed out" \ |
| 7662 | -s "Client initiated reconnection from same port" |
| 7663 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7664 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7665 | "$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] | 7666 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7667 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7668 | -s "The operation timed out" \ |
| 7669 | -S "Client initiated reconnection from same port" |
| 7670 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7671 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7672 | -p "$P_PXY inject_clihlo=1" \ |
| 7673 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7674 | "$P_CLI dtls=1 exchanges=2" \ |
| 7675 | 0 \ |
| 7676 | -s "possible client reconnect from the same port" \ |
| 7677 | -S "Client initiated reconnection from same port" |
| 7678 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7679 | # Tests for various cases of client authentication with DTLS |
| 7680 | # (focused on handshake flows and message parsing) |
| 7681 | |
| 7682 | run_test "DTLS client auth: required" \ |
| 7683 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7684 | "$P_CLI dtls=1" \ |
| 7685 | 0 \ |
| 7686 | -s "Verifying peer X.509 certificate... ok" |
| 7687 | |
| 7688 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7689 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7690 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7691 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7692 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7693 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7694 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7695 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7696 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7697 | 0 \ |
| 7698 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7699 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7700 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7701 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7702 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7703 | "$P_CLI dtls=1 psk=abc124" \ |
| 7704 | 1 \ |
| 7705 | -s "SSL - Verification of the message MAC failed" \ |
| 7706 | -c "SSL - A fatal alert message was received from our peer" |
| 7707 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7708 | # Tests for receiving fragmented handshake messages with DTLS |
| 7709 | |
| 7710 | requires_gnutls |
| 7711 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7712 | "$G_SRV -u --mtu 2048 -a" \ |
| 7713 | "$P_CLI dtls=1 debug_level=2" \ |
| 7714 | 0 \ |
| 7715 | -C "found fragmented DTLS handshake message" \ |
| 7716 | -C "error" |
| 7717 | |
| 7718 | requires_gnutls |
| 7719 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7720 | "$G_SRV -u --mtu 512" \ |
| 7721 | "$P_CLI dtls=1 debug_level=2" \ |
| 7722 | 0 \ |
| 7723 | -c "found fragmented DTLS handshake message" \ |
| 7724 | -C "error" |
| 7725 | |
| 7726 | requires_gnutls |
| 7727 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7728 | "$G_SRV -u --mtu 128" \ |
| 7729 | "$P_CLI dtls=1 debug_level=2" \ |
| 7730 | 0 \ |
| 7731 | -c "found fragmented DTLS handshake message" \ |
| 7732 | -C "error" |
| 7733 | |
| 7734 | requires_gnutls |
| 7735 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7736 | "$G_SRV -u --mtu 128" \ |
| 7737 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7738 | 0 \ |
| 7739 | -c "found fragmented DTLS handshake message" \ |
| 7740 | -C "error" |
| 7741 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7742 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7743 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7744 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7745 | "$G_SRV -u --mtu 256" \ |
| 7746 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7747 | 0 \ |
| 7748 | -c "found fragmented DTLS handshake message" \ |
| 7749 | -c "client hello, adding renegotiation extension" \ |
| 7750 | -c "found renegotiation extension" \ |
| 7751 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7752 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7753 | -C "error" \ |
| 7754 | -s "Extra-header:" |
| 7755 | |
| 7756 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7757 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7758 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7759 | "$G_SRV -u --mtu 256" \ |
| 7760 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7761 | 0 \ |
| 7762 | -c "found fragmented DTLS handshake message" \ |
| 7763 | -c "client hello, adding renegotiation extension" \ |
| 7764 | -c "found renegotiation extension" \ |
| 7765 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7766 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7767 | -C "error" \ |
| 7768 | -s "Extra-header:" |
| 7769 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7770 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7771 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7772 | "$P_CLI dtls=1 debug_level=2" \ |
| 7773 | 0 \ |
| 7774 | -C "found fragmented DTLS handshake message" \ |
| 7775 | -C "error" |
| 7776 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7777 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7778 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7779 | "$P_CLI dtls=1 debug_level=2" \ |
| 7780 | 0 \ |
| 7781 | -c "found fragmented DTLS handshake message" \ |
| 7782 | -C "error" |
| 7783 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7784 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7785 | "$O_SRV -dtls1 -mtu 256" \ |
| 7786 | "$P_CLI dtls=1 debug_level=2" \ |
| 7787 | 0 \ |
| 7788 | -c "found fragmented DTLS handshake message" \ |
| 7789 | -C "error" |
| 7790 | |
| 7791 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7792 | "$O_SRV -dtls1 -mtu 256" \ |
| 7793 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7794 | 0 \ |
| 7795 | -c "found fragmented DTLS handshake message" \ |
| 7796 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7797 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7798 | # Tests for sending fragmented handshake messages with DTLS |
| 7799 | # |
| 7800 | # Use client auth when we need the client to send large messages, |
| 7801 | # and use large cert chains on both sides too (the long chains we have all use |
| 7802 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7803 | # Sizes reached (UDP payload): |
| 7804 | # - 2037B for server certificate |
| 7805 | # - 1542B for client certificate |
| 7806 | # - 1013B for newsessionticket |
| 7807 | # - all others below 512B |
| 7808 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7809 | |
| 7810 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7811 | requires_config_enabled MBEDTLS_RSA_C |
| 7812 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7813 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7814 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7815 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7816 | crt_file=data_files/server7_int-ca.crt \ |
| 7817 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7818 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7819 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7820 | "$P_CLI dtls=1 debug_level=2 \ |
| 7821 | crt_file=data_files/server8_int-ca2.crt \ |
| 7822 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7823 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7824 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7825 | 0 \ |
| 7826 | -S "found fragmented DTLS handshake message" \ |
| 7827 | -C "found fragmented DTLS handshake message" \ |
| 7828 | -C "error" |
| 7829 | |
| 7830 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7831 | requires_config_enabled MBEDTLS_RSA_C |
| 7832 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7833 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7834 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7835 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7836 | crt_file=data_files/server7_int-ca.crt \ |
| 7837 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7838 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7839 | max_frag_len=1024" \ |
| 7840 | "$P_CLI dtls=1 debug_level=2 \ |
| 7841 | crt_file=data_files/server8_int-ca2.crt \ |
| 7842 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7843 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7844 | max_frag_len=2048" \ |
| 7845 | 0 \ |
| 7846 | -S "found fragmented DTLS handshake message" \ |
| 7847 | -c "found fragmented DTLS handshake message" \ |
| 7848 | -C "error" |
| 7849 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7850 | # With the MFL extension, the server has no way of forcing |
| 7851 | # the client to not exceed a certain MTU; hence, the following |
| 7852 | # test can't be replicated with an MTU proxy such as the one |
| 7853 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7854 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7855 | requires_config_enabled MBEDTLS_RSA_C |
| 7856 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7857 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7858 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [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 | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7862 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7863 | max_frag_len=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 | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7867 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7868 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7869 | 0 \ |
| 7870 | -S "found fragmented DTLS handshake message" \ |
| 7871 | -c "found fragmented DTLS handshake message" \ |
| 7872 | -C "error" |
| 7873 | |
| 7874 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7875 | requires_config_enabled MBEDTLS_RSA_C |
| 7876 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7877 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7878 | 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] | 7879 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7880 | crt_file=data_files/server7_int-ca.crt \ |
| 7881 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7882 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7883 | max_frag_len=2048" \ |
| 7884 | "$P_CLI dtls=1 debug_level=2 \ |
| 7885 | crt_file=data_files/server8_int-ca2.crt \ |
| 7886 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7887 | hs_timeout=2500-60000 \ |
| 7888 | max_frag_len=1024" \ |
| 7889 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7890 | -S "found fragmented DTLS handshake message" \ |
| 7891 | -c "found fragmented DTLS handshake message" \ |
| 7892 | -C "error" |
| 7893 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7894 | # While not required by the standard defining the MFL extension |
| 7895 | # (according to which it only applies to records, not to datagrams), |
| 7896 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7897 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7898 | # to the peer. |
| 7899 | # The next test checks that no datagrams significantly larger than the |
| 7900 | # negotiated MFL are sent. |
| 7901 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7902 | requires_config_enabled MBEDTLS_RSA_C |
| 7903 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7904 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7905 | 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] | 7906 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7907 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7908 | crt_file=data_files/server7_int-ca.crt \ |
| 7909 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7910 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7911 | max_frag_len=2048" \ |
| 7912 | "$P_CLI dtls=1 debug_level=2 \ |
| 7913 | crt_file=data_files/server8_int-ca2.crt \ |
| 7914 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7915 | hs_timeout=2500-60000 \ |
| 7916 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7917 | 0 \ |
| 7918 | -S "found fragmented DTLS handshake message" \ |
| 7919 | -c "found fragmented DTLS handshake message" \ |
| 7920 | -C "error" |
| 7921 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7922 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7923 | requires_config_enabled MBEDTLS_RSA_C |
| 7924 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7925 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7926 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7927 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7928 | crt_file=data_files/server7_int-ca.crt \ |
| 7929 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7930 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7931 | max_frag_len=2048" \ |
| 7932 | "$P_CLI dtls=1 debug_level=2 \ |
| 7933 | crt_file=data_files/server8_int-ca2.crt \ |
| 7934 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7935 | hs_timeout=2500-60000 \ |
| 7936 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7937 | 0 \ |
| 7938 | -s "found fragmented DTLS handshake message" \ |
| 7939 | -c "found fragmented DTLS handshake message" \ |
| 7940 | -C "error" |
| 7941 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7942 | # While not required by the standard defining the MFL extension |
| 7943 | # (according to which it only applies to records, not to datagrams), |
| 7944 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7945 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7946 | # to the peer. |
| 7947 | # The next test checks that no datagrams significantly larger than the |
| 7948 | # negotiated MFL are sent. |
| 7949 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7950 | requires_config_enabled MBEDTLS_RSA_C |
| 7951 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7952 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7953 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7954 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7955 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7956 | crt_file=data_files/server7_int-ca.crt \ |
| 7957 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7958 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7959 | max_frag_len=2048" \ |
| 7960 | "$P_CLI dtls=1 debug_level=2 \ |
| 7961 | crt_file=data_files/server8_int-ca2.crt \ |
| 7962 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7963 | hs_timeout=2500-60000 \ |
| 7964 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7965 | 0 \ |
| 7966 | -s "found fragmented DTLS handshake message" \ |
| 7967 | -c "found fragmented DTLS handshake message" \ |
| 7968 | -C "error" |
| 7969 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7970 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7971 | requires_config_enabled MBEDTLS_RSA_C |
| 7972 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7973 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7974 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7975 | crt_file=data_files/server7_int-ca.crt \ |
| 7976 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7977 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7978 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7979 | "$P_CLI dtls=1 debug_level=2 \ |
| 7980 | crt_file=data_files/server8_int-ca2.crt \ |
| 7981 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7982 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7983 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7984 | 0 \ |
| 7985 | -S "found fragmented DTLS handshake message" \ |
| 7986 | -C "found fragmented DTLS handshake message" \ |
| 7987 | -C "error" |
| 7988 | |
| 7989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7990 | requires_config_enabled MBEDTLS_RSA_C |
| 7991 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7992 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7993 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7994 | crt_file=data_files/server7_int-ca.crt \ |
| 7995 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7996 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7997 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7998 | "$P_CLI dtls=1 debug_level=2 \ |
| 7999 | crt_file=data_files/server8_int-ca2.crt \ |
| 8000 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8001 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8002 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8003 | 0 \ |
| 8004 | -s "found fragmented DTLS handshake message" \ |
| 8005 | -C "found fragmented DTLS handshake message" \ |
| 8006 | -C "error" |
| 8007 | |
| 8008 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8009 | requires_config_enabled MBEDTLS_RSA_C |
| 8010 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8011 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8012 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8013 | crt_file=data_files/server7_int-ca.crt \ |
| 8014 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8015 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8016 | mtu=512" \ |
| 8017 | "$P_CLI dtls=1 debug_level=2 \ |
| 8018 | crt_file=data_files/server8_int-ca2.crt \ |
| 8019 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8020 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8021 | mtu=2048" \ |
| 8022 | 0 \ |
| 8023 | -S "found fragmented DTLS handshake message" \ |
| 8024 | -c "found fragmented DTLS handshake message" \ |
| 8025 | -C "error" |
| 8026 | |
| 8027 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8028 | requires_config_enabled MBEDTLS_RSA_C |
| 8029 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8030 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8031 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8032 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8033 | crt_file=data_files/server7_int-ca.crt \ |
| 8034 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8035 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8036 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8037 | "$P_CLI dtls=1 debug_level=2 \ |
| 8038 | crt_file=data_files/server8_int-ca2.crt \ |
| 8039 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8040 | hs_timeout=2500-60000 \ |
| 8041 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8042 | 0 \ |
| 8043 | -s "found fragmented DTLS handshake message" \ |
| 8044 | -c "found fragmented DTLS handshake message" \ |
| 8045 | -C "error" |
| 8046 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8047 | # 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] | 8048 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8049 | requires_config_enabled MBEDTLS_RSA_C |
| 8050 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8051 | requires_config_enabled MBEDTLS_SHA256_C |
| 8052 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8053 | requires_config_enabled MBEDTLS_AES_C |
| 8054 | requires_config_enabled MBEDTLS_GCM_C |
| 8055 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8056 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8057 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8058 | crt_file=data_files/server7_int-ca.crt \ |
| 8059 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8060 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8061 | mtu=512" \ |
| 8062 | "$P_CLI dtls=1 debug_level=2 \ |
| 8063 | crt_file=data_files/server8_int-ca2.crt \ |
| 8064 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8065 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8066 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8067 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8068 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8069 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8070 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8071 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8072 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8073 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8074 | # 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] | 8075 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8076 | # retransmissions, but in some cases (like both the server and client using |
| 8077 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8078 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8079 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8080 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8081 | requires_config_enabled MBEDTLS_RSA_C |
| 8082 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8083 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8084 | requires_config_enabled MBEDTLS_AES_C |
| 8085 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8086 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8087 | -p "$P_PXY mtu=508" \ |
| 8088 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8089 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8090 | key_file=data_files/server7.key \ |
| 8091 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8092 | "$P_CLI dtls=1 debug_level=2 \ |
| 8093 | crt_file=data_files/server8_int-ca2.crt \ |
| 8094 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8095 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8096 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8097 | 0 \ |
| 8098 | -s "found fragmented DTLS handshake message" \ |
| 8099 | -c "found fragmented DTLS handshake message" \ |
| 8100 | -C "error" |
| 8101 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8102 | # 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] | 8103 | only_with_valgrind |
| 8104 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8105 | requires_config_enabled MBEDTLS_RSA_C |
| 8106 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8107 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8108 | requires_config_enabled MBEDTLS_AES_C |
| 8109 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8110 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8111 | -p "$P_PXY mtu=508" \ |
| 8112 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8113 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8114 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8115 | hs_timeout=250-10000" \ |
| 8116 | "$P_CLI dtls=1 debug_level=2 \ |
| 8117 | crt_file=data_files/server8_int-ca2.crt \ |
| 8118 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8119 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8120 | hs_timeout=250-10000" \ |
| 8121 | 0 \ |
| 8122 | -s "found fragmented DTLS handshake message" \ |
| 8123 | -c "found fragmented DTLS handshake message" \ |
| 8124 | -C "error" |
| 8125 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8126 | # 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] | 8127 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8128 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8129 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8130 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8131 | requires_config_enabled MBEDTLS_RSA_C |
| 8132 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8133 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8134 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8135 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8136 | crt_file=data_files/server7_int-ca.crt \ |
| 8137 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8138 | hs_timeout=10000-60000 \ |
| 8139 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8140 | "$P_CLI dtls=1 debug_level=2 \ |
| 8141 | crt_file=data_files/server8_int-ca2.crt \ |
| 8142 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8143 | hs_timeout=10000-60000 \ |
| 8144 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8145 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8146 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8147 | -s "found fragmented DTLS handshake message" \ |
| 8148 | -c "found fragmented DTLS handshake message" \ |
| 8149 | -C "error" |
| 8150 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8151 | # 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] | 8152 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8153 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8154 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8155 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8156 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8157 | requires_config_enabled MBEDTLS_RSA_C |
| 8158 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8159 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8160 | requires_config_enabled MBEDTLS_AES_C |
| 8161 | requires_config_enabled MBEDTLS_GCM_C |
| 8162 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8163 | -p "$P_PXY mtu=512" \ |
| 8164 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8165 | crt_file=data_files/server7_int-ca.crt \ |
| 8166 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8167 | hs_timeout=10000-60000 \ |
| 8168 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8169 | "$P_CLI dtls=1 debug_level=2 \ |
| 8170 | crt_file=data_files/server8_int-ca2.crt \ |
| 8171 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8172 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8173 | hs_timeout=10000-60000 \ |
| 8174 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8175 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8176 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8177 | -s "found fragmented DTLS handshake message" \ |
| 8178 | -c "found fragmented DTLS handshake message" \ |
| 8179 | -C "error" |
| 8180 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8181 | not_with_valgrind # spurious autoreduction due to timeout |
| 8182 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8183 | requires_config_enabled MBEDTLS_RSA_C |
| 8184 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8185 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8186 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8187 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8188 | crt_file=data_files/server7_int-ca.crt \ |
| 8189 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8190 | hs_timeout=10000-60000 \ |
| 8191 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8192 | "$P_CLI dtls=1 debug_level=2 \ |
| 8193 | crt_file=data_files/server8_int-ca2.crt \ |
| 8194 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8195 | hs_timeout=10000-60000 \ |
| 8196 | mtu=1024 nbio=2" \ |
| 8197 | 0 \ |
| 8198 | -S "autoreduction" \ |
| 8199 | -s "found fragmented DTLS handshake message" \ |
| 8200 | -c "found fragmented DTLS handshake message" \ |
| 8201 | -C "error" |
| 8202 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8203 | # 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] | 8204 | not_with_valgrind # spurious autoreduction due to timeout |
| 8205 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8206 | requires_config_enabled MBEDTLS_RSA_C |
| 8207 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8208 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8209 | requires_config_enabled MBEDTLS_AES_C |
| 8210 | requires_config_enabled MBEDTLS_GCM_C |
| 8211 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8212 | -p "$P_PXY mtu=512" \ |
| 8213 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8214 | crt_file=data_files/server7_int-ca.crt \ |
| 8215 | key_file=data_files/server7.key \ |
| 8216 | hs_timeout=10000-60000 \ |
| 8217 | mtu=512 nbio=2" \ |
| 8218 | "$P_CLI dtls=1 debug_level=2 \ |
| 8219 | crt_file=data_files/server8_int-ca2.crt \ |
| 8220 | key_file=data_files/server8.key \ |
| 8221 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8222 | hs_timeout=10000-60000 \ |
| 8223 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8224 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8225 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8226 | -s "found fragmented DTLS handshake message" \ |
| 8227 | -c "found fragmented DTLS handshake message" \ |
| 8228 | -C "error" |
| 8229 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8230 | # Forcing ciphersuite for this test to fit the MTU of 1450 with full config. |
Hanno Becker | b841b4f | 2018-08-28 10:25:51 +0100 | [diff] [blame] | 8231 | # This ensures things still work after session_reset(). |
| 8232 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8233 | # Since we don't support reading fragmented ClientHello yet, |
| 8234 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8235 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8236 | # An autoreduction on the client-side might happen if the server is |
| 8237 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8238 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8239 | # resumed listening, which would result in a spurious autoreduction. |
| 8240 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8241 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8242 | requires_config_enabled MBEDTLS_RSA_C |
| 8243 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8244 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8245 | requires_config_enabled MBEDTLS_AES_C |
| 8246 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8247 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8248 | -p "$P_PXY mtu=1450" \ |
| 8249 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8250 | crt_file=data_files/server7_int-ca.crt \ |
| 8251 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8252 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8253 | mtu=1450" \ |
| 8254 | "$P_CLI dtls=1 debug_level=2 \ |
| 8255 | crt_file=data_files/server8_int-ca2.crt \ |
| 8256 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8257 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8258 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8259 | 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] | 8260 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8261 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8262 | -s "found fragmented DTLS handshake message" \ |
| 8263 | -c "found fragmented DTLS handshake message" \ |
| 8264 | -C "error" |
| 8265 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8266 | # An autoreduction on the client-side might happen if the server is |
| 8267 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8268 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8269 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8270 | requires_config_enabled MBEDTLS_RSA_C |
| 8271 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8272 | requires_config_enabled MBEDTLS_SHA256_C |
| 8273 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8274 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8275 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 8276 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8277 | -p "$P_PXY mtu=512" \ |
| 8278 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8279 | crt_file=data_files/server7_int-ca.crt \ |
| 8280 | key_file=data_files/server7.key \ |
| 8281 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8282 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8283 | mtu=512" \ |
| 8284 | "$P_CLI dtls=1 debug_level=2 \ |
| 8285 | crt_file=data_files/server8_int-ca2.crt \ |
| 8286 | key_file=data_files/server8.key \ |
| 8287 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8288 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8289 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8290 | mtu=512" \ |
| 8291 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8292 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8293 | -s "found fragmented DTLS handshake message" \ |
| 8294 | -c "found fragmented DTLS handshake message" \ |
| 8295 | -C "error" |
| 8296 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8297 | # An autoreduction on the client-side might happen if the server is |
| 8298 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8299 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8300 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8301 | requires_config_enabled MBEDTLS_RSA_C |
| 8302 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8303 | requires_config_enabled MBEDTLS_SHA256_C |
| 8304 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8305 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8306 | requires_config_enabled MBEDTLS_AES_C |
| 8307 | requires_config_enabled MBEDTLS_GCM_C |
| 8308 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8309 | -p "$P_PXY mtu=512" \ |
| 8310 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8311 | crt_file=data_files/server7_int-ca.crt \ |
| 8312 | key_file=data_files/server7.key \ |
| 8313 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8314 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8315 | mtu=512" \ |
| 8316 | "$P_CLI dtls=1 debug_level=2 \ |
| 8317 | crt_file=data_files/server8_int-ca2.crt \ |
| 8318 | key_file=data_files/server8.key \ |
| 8319 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8320 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8321 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8322 | mtu=512" \ |
| 8323 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8324 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8325 | -s "found fragmented DTLS handshake message" \ |
| 8326 | -c "found fragmented DTLS handshake message" \ |
| 8327 | -C "error" |
| 8328 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8329 | # An autoreduction on the client-side might happen if the server is |
| 8330 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8331 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8332 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8333 | requires_config_enabled MBEDTLS_RSA_C |
| 8334 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8335 | requires_config_enabled MBEDTLS_SHA256_C |
| 8336 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8337 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8338 | requires_config_enabled MBEDTLS_AES_C |
| 8339 | requires_config_enabled MBEDTLS_CCM_C |
| 8340 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8341 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8342 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8343 | crt_file=data_files/server7_int-ca.crt \ |
| 8344 | key_file=data_files/server7.key \ |
| 8345 | exchanges=2 renegotiation=1 \ |
| 8346 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8347 | hs_timeout=10000-60000 \ |
| 8348 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8349 | "$P_CLI dtls=1 debug_level=2 \ |
| 8350 | crt_file=data_files/server8_int-ca2.crt \ |
| 8351 | key_file=data_files/server8.key \ |
| 8352 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8353 | hs_timeout=10000-60000 \ |
| 8354 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8355 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8356 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8357 | -s "found fragmented DTLS handshake message" \ |
| 8358 | -c "found fragmented DTLS handshake message" \ |
| 8359 | -C "error" |
| 8360 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8361 | # An autoreduction on the client-side might happen if the server is |
| 8362 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8363 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8364 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8365 | requires_config_enabled MBEDTLS_RSA_C |
| 8366 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8367 | requires_config_enabled MBEDTLS_SHA256_C |
| 8368 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8369 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8370 | requires_config_enabled MBEDTLS_AES_C |
| 8371 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8372 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 8373 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8374 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8375 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8376 | crt_file=data_files/server7_int-ca.crt \ |
| 8377 | key_file=data_files/server7.key \ |
| 8378 | exchanges=2 renegotiation=1 \ |
| 8379 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8380 | hs_timeout=10000-60000 \ |
| 8381 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8382 | "$P_CLI dtls=1 debug_level=2 \ |
| 8383 | crt_file=data_files/server8_int-ca2.crt \ |
| 8384 | key_file=data_files/server8.key \ |
| 8385 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8386 | hs_timeout=10000-60000 \ |
| 8387 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8388 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8389 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8390 | -s "found fragmented DTLS handshake message" \ |
| 8391 | -c "found fragmented DTLS handshake message" \ |
| 8392 | -C "error" |
| 8393 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8394 | # An autoreduction on the client-side might happen if the server is |
| 8395 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8396 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8397 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8398 | requires_config_enabled MBEDTLS_RSA_C |
| 8399 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8400 | requires_config_enabled MBEDTLS_SHA256_C |
| 8401 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8402 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8403 | requires_config_enabled MBEDTLS_AES_C |
| 8404 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8405 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8406 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8407 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8408 | crt_file=data_files/server7_int-ca.crt \ |
| 8409 | key_file=data_files/server7.key \ |
| 8410 | exchanges=2 renegotiation=1 \ |
| 8411 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8412 | hs_timeout=10000-60000 \ |
| 8413 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8414 | "$P_CLI dtls=1 debug_level=2 \ |
| 8415 | crt_file=data_files/server8_int-ca2.crt \ |
| 8416 | key_file=data_files/server8.key \ |
| 8417 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8418 | hs_timeout=10000-60000 \ |
| 8419 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8420 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8421 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8422 | -s "found fragmented DTLS handshake message" \ |
| 8423 | -c "found fragmented DTLS handshake message" \ |
| 8424 | -C "error" |
| 8425 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8426 | # 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] | 8427 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8428 | requires_config_enabled MBEDTLS_RSA_C |
| 8429 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8430 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8431 | requires_config_enabled MBEDTLS_AES_C |
| 8432 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8433 | client_needs_more_time 2 |
| 8434 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8435 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8436 | "$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] | 8437 | crt_file=data_files/server7_int-ca.crt \ |
| 8438 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8439 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8440 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8441 | crt_file=data_files/server8_int-ca2.crt \ |
| 8442 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8443 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8444 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8445 | 0 \ |
| 8446 | -s "found fragmented DTLS handshake message" \ |
| 8447 | -c "found fragmented DTLS handshake message" \ |
| 8448 | -C "error" |
| 8449 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8450 | # 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] | 8451 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8452 | requires_config_enabled MBEDTLS_RSA_C |
| 8453 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8454 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8455 | requires_config_enabled MBEDTLS_AES_C |
| 8456 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8457 | client_needs_more_time 2 |
| 8458 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8459 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8460 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8461 | crt_file=data_files/server7_int-ca.crt \ |
| 8462 | key_file=data_files/server7.key \ |
| 8463 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8464 | "$P_CLI dtls=1 debug_level=2 \ |
| 8465 | crt_file=data_files/server8_int-ca2.crt \ |
| 8466 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8467 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8468 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8469 | 0 \ |
| 8470 | -s "found fragmented DTLS handshake message" \ |
| 8471 | -c "found fragmented DTLS handshake message" \ |
| 8472 | -C "error" |
| 8473 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8474 | # interop tests for DTLS fragmentating with reliable connection |
| 8475 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8476 | # here and below we just want to test that the we fragment in a way that |
| 8477 | # pleases other implementations, so we don't need the peer to fragment |
| 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 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8482 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8483 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8484 | "$G_SRV -u" \ |
| 8485 | "$P_CLI dtls=1 debug_level=2 \ |
| 8486 | crt_file=data_files/server8_int-ca2.crt \ |
| 8487 | key_file=data_files/server8.key \ |
| 8488 | mtu=512 force_version=dtls1_2" \ |
| 8489 | 0 \ |
| 8490 | -c "fragmenting handshake message" \ |
| 8491 | -C "error" |
| 8492 | |
| 8493 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8494 | requires_config_enabled MBEDTLS_RSA_C |
| 8495 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8496 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8497 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8498 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8499 | "$G_SRV -u" \ |
| 8500 | "$P_CLI dtls=1 debug_level=2 \ |
| 8501 | crt_file=data_files/server8_int-ca2.crt \ |
| 8502 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8503 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8504 | 0 \ |
| 8505 | -c "fragmenting handshake message" \ |
| 8506 | -C "error" |
| 8507 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8508 | # We use --insecure for the GnuTLS client because it expects |
| 8509 | # the hostname / IP it connects to to be the name used in the |
| 8510 | # certificate obtained from the server. Here, however, it |
| 8511 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8512 | # as the server name in the certificate. This will make the |
| 8513 | # certifiate validation fail, but passing --insecure makes |
| 8514 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8515 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8516 | requires_config_enabled MBEDTLS_RSA_C |
| 8517 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8519 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8520 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8521 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8522 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8523 | crt_file=data_files/server7_int-ca.crt \ |
| 8524 | key_file=data_files/server7.key \ |
| 8525 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8526 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8527 | 0 \ |
| 8528 | -s "fragmenting handshake message" |
| 8529 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8530 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8531 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8532 | requires_config_enabled MBEDTLS_RSA_C |
| 8533 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8534 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8535 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8536 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8537 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8538 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8539 | crt_file=data_files/server7_int-ca.crt \ |
| 8540 | key_file=data_files/server7.key \ |
| 8541 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8542 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8543 | 0 \ |
| 8544 | -s "fragmenting handshake message" |
| 8545 | |
| 8546 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8547 | requires_config_enabled MBEDTLS_RSA_C |
| 8548 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8550 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8551 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8552 | "$P_CLI dtls=1 debug_level=2 \ |
| 8553 | crt_file=data_files/server8_int-ca2.crt \ |
| 8554 | key_file=data_files/server8.key \ |
| 8555 | mtu=512 force_version=dtls1_2" \ |
| 8556 | 0 \ |
| 8557 | -c "fragmenting handshake message" \ |
| 8558 | -C "error" |
| 8559 | |
| 8560 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8561 | requires_config_enabled MBEDTLS_RSA_C |
| 8562 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8564 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8565 | "$O_SRV -dtls1 -verify 10" \ |
| 8566 | "$P_CLI dtls=1 debug_level=2 \ |
| 8567 | crt_file=data_files/server8_int-ca2.crt \ |
| 8568 | key_file=data_files/server8.key \ |
| 8569 | mtu=512 force_version=dtls1" \ |
| 8570 | 0 \ |
| 8571 | -c "fragmenting handshake message" \ |
| 8572 | -C "error" |
| 8573 | |
| 8574 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8575 | requires_config_enabled MBEDTLS_RSA_C |
| 8576 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8578 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8579 | "$P_SRV dtls=1 debug_level=2 \ |
| 8580 | crt_file=data_files/server7_int-ca.crt \ |
| 8581 | key_file=data_files/server7.key \ |
| 8582 | mtu=512 force_version=dtls1_2" \ |
| 8583 | "$O_CLI -dtls1_2" \ |
| 8584 | 0 \ |
| 8585 | -s "fragmenting handshake message" |
| 8586 | |
| 8587 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8588 | requires_config_enabled MBEDTLS_RSA_C |
| 8589 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8591 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8592 | "$P_SRV dtls=1 debug_level=2 \ |
| 8593 | crt_file=data_files/server7_int-ca.crt \ |
| 8594 | key_file=data_files/server7.key \ |
| 8595 | mtu=512 force_version=dtls1" \ |
| 8596 | "$O_CLI -dtls1" \ |
| 8597 | 0 \ |
| 8598 | -s "fragmenting handshake message" |
| 8599 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8600 | # interop tests for DTLS fragmentating with unreliable connection |
| 8601 | # |
| 8602 | # again we just want to test that the we fragment in a way that |
| 8603 | # pleases other implementations, so we don't need the peer to fragment |
| 8604 | requires_gnutls_next |
| 8605 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8606 | requires_config_enabled MBEDTLS_RSA_C |
| 8607 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8608 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8609 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8610 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8611 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8612 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8613 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8614 | crt_file=data_files/server8_int-ca2.crt \ |
| 8615 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8616 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8617 | 0 \ |
| 8618 | -c "fragmenting handshake message" \ |
| 8619 | -C "error" |
| 8620 | |
| 8621 | requires_gnutls_next |
| 8622 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8623 | requires_config_enabled MBEDTLS_RSA_C |
| 8624 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8625 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8626 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8627 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8628 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8629 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8630 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8631 | crt_file=data_files/server8_int-ca2.crt \ |
| 8632 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8633 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8634 | 0 \ |
| 8635 | -c "fragmenting handshake message" \ |
| 8636 | -C "error" |
| 8637 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8638 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8639 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8640 | requires_config_enabled MBEDTLS_RSA_C |
| 8641 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8643 | client_needs_more_time 4 |
| 8644 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8645 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8646 | "$P_SRV dtls=1 debug_level=2 \ |
| 8647 | crt_file=data_files/server7_int-ca.crt \ |
| 8648 | key_file=data_files/server7.key \ |
| 8649 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8650 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8651 | 0 \ |
| 8652 | -s "fragmenting handshake message" |
| 8653 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8654 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8655 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8656 | requires_config_enabled MBEDTLS_RSA_C |
| 8657 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8658 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8659 | client_needs_more_time 4 |
| 8660 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8661 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8662 | "$P_SRV dtls=1 debug_level=2 \ |
| 8663 | crt_file=data_files/server7_int-ca.crt \ |
| 8664 | key_file=data_files/server7.key \ |
| 8665 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8666 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8667 | 0 \ |
| 8668 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8669 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8670 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8671 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8672 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8673 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8674 | ## (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] | 8675 | skip_next_test |
| 8676 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8677 | requires_config_enabled MBEDTLS_RSA_C |
| 8678 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8680 | client_needs_more_time 4 |
| 8681 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8682 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8683 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8684 | "$P_CLI dtls=1 debug_level=2 \ |
| 8685 | crt_file=data_files/server8_int-ca2.crt \ |
| 8686 | key_file=data_files/server8.key \ |
| 8687 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8688 | 0 \ |
| 8689 | -c "fragmenting handshake message" \ |
| 8690 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8691 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8692 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8693 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8694 | requires_config_enabled MBEDTLS_RSA_C |
| 8695 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8697 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8698 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8699 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8700 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8701 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8702 | crt_file=data_files/server8_int-ca2.crt \ |
| 8703 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8704 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8705 | 0 \ |
| 8706 | -c "fragmenting handshake message" \ |
| 8707 | -C "error" |
| 8708 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8709 | skip_next_test |
| 8710 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8711 | requires_config_enabled MBEDTLS_RSA_C |
| 8712 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8714 | client_needs_more_time 4 |
| 8715 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8716 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8717 | "$P_SRV dtls=1 debug_level=2 \ |
| 8718 | crt_file=data_files/server7_int-ca.crt \ |
| 8719 | key_file=data_files/server7.key \ |
| 8720 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8721 | "$O_CLI -dtls1_2" \ |
| 8722 | 0 \ |
| 8723 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8724 | |
| 8725 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8726 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8727 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8728 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8729 | requires_config_enabled MBEDTLS_RSA_C |
| 8730 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8731 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8732 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8733 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8734 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8735 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8736 | crt_file=data_files/server7_int-ca.crt \ |
| 8737 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8738 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8739 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8740 | 0 \ |
| 8741 | -s "fragmenting handshake message" |
| 8742 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8743 | # Tests for DTLS-SRTP (RFC 5764) |
| 8744 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8745 | run_test "DTLS-SRTP all profiles supported" \ |
| 8746 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8747 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8748 | 0 \ |
| 8749 | -s "found use_srtp extension" \ |
| 8750 | -s "found srtp profile" \ |
| 8751 | -s "selected srtp profile" \ |
| 8752 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8753 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8754 | -c "client hello, adding use_srtp extension" \ |
| 8755 | -c "found use_srtp extension" \ |
| 8756 | -c "found srtp profile" \ |
| 8757 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8758 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8759 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8760 | -C "error" |
| 8761 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8762 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8763 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8764 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 8765 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8766 | "$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] | 8767 | 0 \ |
| 8768 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8769 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 8770 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8771 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8772 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8773 | -c "client hello, adding use_srtp extension" \ |
| 8774 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8775 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8776 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8777 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8778 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8779 | -C "error" |
| 8780 | |
| 8781 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8782 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8783 | "$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] | 8784 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8785 | 0 \ |
| 8786 | -s "found use_srtp extension" \ |
| 8787 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8788 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8789 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8790 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8791 | -c "client hello, adding use_srtp extension" \ |
| 8792 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8793 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8794 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8795 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8796 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8797 | -C "error" |
| 8798 | |
| 8799 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8800 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8801 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8802 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8803 | 0 \ |
| 8804 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8805 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8806 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8807 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8808 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8809 | -c "client hello, adding use_srtp extension" \ |
| 8810 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8811 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8812 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8813 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8814 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8815 | -C "error" |
| 8816 | |
| 8817 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8818 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8819 | "$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] | 8820 | "$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] | 8821 | 0 \ |
| 8822 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8823 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8824 | -S "selected srtp profile" \ |
| 8825 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8826 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8827 | -c "client hello, adding use_srtp extension" \ |
| 8828 | -C "found use_srtp extension" \ |
| 8829 | -C "found srtp profile" \ |
| 8830 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8831 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8832 | -C "error" |
| 8833 | |
| 8834 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8835 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8836 | "$P_SRV dtls=1 debug_level=3" \ |
| 8837 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8838 | 0 \ |
| 8839 | -s "found use_srtp extension" \ |
| 8840 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8841 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8842 | -c "client hello, adding use_srtp extension" \ |
| 8843 | -C "found use_srtp extension" \ |
| 8844 | -C "found srtp profile" \ |
| 8845 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8846 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8847 | -C "error" |
| 8848 | |
| 8849 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8850 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8851 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8852 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8853 | 0 \ |
| 8854 | -s "found use_srtp extension" \ |
| 8855 | -s "found srtp profile" \ |
| 8856 | -s "selected srtp profile" \ |
| 8857 | -s "server hello, adding use_srtp extension" \ |
| 8858 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8859 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8860 | -c "client hello, adding use_srtp extension" \ |
| 8861 | -c "found use_srtp extension" \ |
| 8862 | -c "found srtp profile" \ |
| 8863 | -c "selected srtp profile" \ |
| 8864 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8865 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8866 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8867 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8868 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8869 | -C "error" |
| 8870 | |
| 8871 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8872 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8873 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8874 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8875 | 0 \ |
| 8876 | -s "found use_srtp extension" \ |
| 8877 | -s "found srtp profile" \ |
| 8878 | -s "selected srtp profile" \ |
| 8879 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8880 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8881 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8882 | -S "dumping 'using mki' (8 bytes)" \ |
| 8883 | -c "client hello, adding use_srtp extension" \ |
| 8884 | -c "found use_srtp extension" \ |
| 8885 | -c "found srtp profile" \ |
| 8886 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8887 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8888 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8889 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8890 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8891 | -C "dumping 'received mki' (8 bytes)" \ |
| 8892 | -C "error" |
| 8893 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8894 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8895 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8896 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8897 | "$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] | 8898 | 0 \ |
| 8899 | -s "found use_srtp extension" \ |
| 8900 | -s "found srtp profile" \ |
| 8901 | -s "selected srtp profile" \ |
| 8902 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8903 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8904 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8905 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8906 | |
| 8907 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8908 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8909 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8910 | "$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] | 8911 | 0 \ |
| 8912 | -s "found use_srtp extension" \ |
| 8913 | -s "found srtp profile" \ |
| 8914 | -s "selected srtp profile" \ |
| 8915 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8916 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8917 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8918 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8919 | |
| 8920 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8921 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8922 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8923 | "$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] | 8924 | 0 \ |
| 8925 | -s "found use_srtp extension" \ |
| 8926 | -s "found srtp profile" \ |
| 8927 | -s "selected srtp profile" \ |
| 8928 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8929 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8930 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8931 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8932 | |
| 8933 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8934 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8935 | "$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] | 8936 | "$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] | 8937 | 0 \ |
| 8938 | -s "found use_srtp extension" \ |
| 8939 | -s "found srtp profile" \ |
| 8940 | -s "selected srtp profile" \ |
| 8941 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8942 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8943 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8944 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8945 | |
| 8946 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8947 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8948 | "$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] | 8949 | "$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] | 8950 | 0 \ |
| 8951 | -s "found use_srtp extension" \ |
| 8952 | -s "found srtp profile" \ |
| 8953 | -s "selected srtp profile" \ |
| 8954 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8955 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8956 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8957 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8958 | |
| 8959 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8960 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8961 | "$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] | 8962 | "$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] | 8963 | 0 \ |
| 8964 | -s "found use_srtp extension" \ |
| 8965 | -s "found srtp profile" \ |
| 8966 | -S "selected srtp profile" \ |
| 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 Extension negotiated, profile" |
| 8970 | |
| 8971 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8972 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8973 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8974 | "$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] | 8975 | 0 \ |
| 8976 | -s "found use_srtp extension" \ |
| 8977 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8978 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8979 | -C "SRTP Extension negotiated, profile" |
| 8980 | |
| 8981 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8982 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8983 | "$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] | 8984 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8985 | 0 \ |
| 8986 | -c "client hello, adding use_srtp extension" \ |
| 8987 | -c "found use_srtp extension" \ |
| 8988 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8989 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8990 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8991 | -C "error" |
| 8992 | |
| 8993 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8994 | 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] | 8995 | "$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] | 8996 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8997 | 0 \ |
| 8998 | -c "client hello, adding use_srtp extension" \ |
| 8999 | -c "found use_srtp extension" \ |
| 9000 | -c "found srtp profile" \ |
| 9001 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9002 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9003 | -C "error" |
| 9004 | |
| 9005 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9006 | 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] | 9007 | "$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] | 9008 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9009 | 0 \ |
| 9010 | -c "client hello, adding use_srtp extension" \ |
| 9011 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9012 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9013 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9014 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9015 | -C "error" |
| 9016 | |
| 9017 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9018 | 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] | 9019 | "$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] | 9020 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9021 | 0 \ |
| 9022 | -c "client hello, adding use_srtp extension" \ |
| 9023 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9024 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9025 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9026 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9027 | -C "error" |
| 9028 | |
| 9029 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9030 | 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] | 9031 | "$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] | 9032 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9033 | 0 \ |
| 9034 | -c "client hello, adding use_srtp extension" \ |
| 9035 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9036 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9037 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9038 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9039 | -C "error" |
| 9040 | |
| 9041 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9042 | 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] | 9043 | "$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] | 9044 | "$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] | 9045 | 0 \ |
| 9046 | -c "client hello, adding use_srtp extension" \ |
| 9047 | -C "found use_srtp extension" \ |
| 9048 | -C "found srtp profile" \ |
| 9049 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9050 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9051 | -C "error" |
| 9052 | |
| 9053 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9054 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9055 | "$O_SRV -dtls1" \ |
| 9056 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9057 | 0 \ |
| 9058 | -c "client hello, adding use_srtp extension" \ |
| 9059 | -C "found use_srtp extension" \ |
| 9060 | -C "found srtp profile" \ |
| 9061 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9062 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9063 | -C "error" |
| 9064 | |
| 9065 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9066 | 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] | 9067 | "$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] | 9068 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9069 | 0 \ |
| 9070 | -c "client hello, adding use_srtp extension" \ |
| 9071 | -c "found use_srtp extension" \ |
| 9072 | -c "found srtp profile" \ |
| 9073 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9074 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9075 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9076 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9077 | -C "dumping 'received mki' (8 bytes)" \ |
| 9078 | -C "error" |
| 9079 | |
| 9080 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9081 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9082 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9083 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9084 | "$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] | 9085 | 0 \ |
| 9086 | -s "found use_srtp extension" \ |
| 9087 | -s "found srtp profile" \ |
| 9088 | -s "selected srtp profile" \ |
| 9089 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9090 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9091 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9092 | |
| 9093 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9094 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9095 | 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] | 9096 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9097 | "$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] | 9098 | 0 \ |
| 9099 | -s "found use_srtp extension" \ |
| 9100 | -s "found srtp profile" \ |
| 9101 | -s "selected srtp profile" \ |
| 9102 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9103 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9104 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9105 | |
| 9106 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9107 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9108 | 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] | 9109 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9110 | "$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] | 9111 | 0 \ |
| 9112 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9113 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9114 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9115 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9116 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9117 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9118 | |
| 9119 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9120 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9121 | 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] | 9122 | "$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] | 9123 | "$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] | 9124 | 0 \ |
| 9125 | -s "found use_srtp extension" \ |
| 9126 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9127 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9128 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9129 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9130 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9131 | |
| 9132 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9133 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9134 | 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] | 9135 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9136 | "$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] | 9137 | 0 \ |
| 9138 | -s "found use_srtp extension" \ |
| 9139 | -s "found srtp profile" \ |
| 9140 | -s "selected srtp profile" \ |
| 9141 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9142 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9143 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9144 | |
| 9145 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9146 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9147 | 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] | 9148 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9149 | "$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] | 9150 | 0 \ |
| 9151 | -s "found use_srtp extension" \ |
| 9152 | -s "found srtp profile" \ |
| 9153 | -S "selected srtp profile" \ |
| 9154 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9155 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9156 | -C "SRTP profile:" |
| 9157 | |
| 9158 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9159 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9160 | 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] | 9161 | "$P_SRV dtls=1 debug_level=3" \ |
| 9162 | "$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] | 9163 | 0 \ |
| 9164 | -s "found use_srtp extension" \ |
| 9165 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9166 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9167 | -C "SRTP profile:" |
| 9168 | |
| 9169 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9170 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9171 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9172 | "$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" \ |
| 9173 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9174 | 0 \ |
| 9175 | -c "client hello, adding use_srtp extension" \ |
| 9176 | -c "found use_srtp extension" \ |
| 9177 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9178 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9179 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9180 | -C "error" |
| 9181 | |
| 9182 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9183 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9184 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9185 | "$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" \ |
| 9186 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9187 | 0 \ |
| 9188 | -c "client hello, adding use_srtp extension" \ |
| 9189 | -c "found use_srtp extension" \ |
| 9190 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9191 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9192 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9193 | -C "error" |
| 9194 | |
| 9195 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9196 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9197 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9198 | "$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" \ |
| 9199 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9200 | 0 \ |
| 9201 | -c "client hello, adding use_srtp extension" \ |
| 9202 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9203 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9204 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9205 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9206 | -C "error" |
| 9207 | |
| 9208 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9209 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9210 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9211 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9212 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9213 | 0 \ |
| 9214 | -c "client hello, adding use_srtp extension" \ |
| 9215 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9216 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9217 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9218 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9219 | -C "error" |
| 9220 | |
| 9221 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9222 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9223 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9224 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9225 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9226 | 0 \ |
| 9227 | -c "client hello, adding use_srtp extension" \ |
| 9228 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9229 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9230 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9231 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9232 | -C "error" |
| 9233 | |
| 9234 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9235 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9236 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9237 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9238 | "$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] | 9239 | 0 \ |
| 9240 | -c "client hello, adding use_srtp extension" \ |
| 9241 | -C "found use_srtp extension" \ |
| 9242 | -C "found srtp profile" \ |
| 9243 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9244 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9245 | -C "error" |
| 9246 | |
| 9247 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9248 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9249 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9250 | "$G_SRV -u" \ |
| 9251 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9252 | 0 \ |
| 9253 | -c "client hello, adding use_srtp extension" \ |
| 9254 | -C "found use_srtp extension" \ |
| 9255 | -C "found srtp profile" \ |
| 9256 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9257 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9258 | -C "error" |
| 9259 | |
| 9260 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9261 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9262 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9263 | "$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" \ |
| 9264 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9265 | 0 \ |
| 9266 | -c "client hello, adding use_srtp extension" \ |
| 9267 | -c "found use_srtp extension" \ |
| 9268 | -c "found srtp profile" \ |
| 9269 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9270 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9271 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9272 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9273 | -c "dumping 'received mki' (8 bytes)" \ |
| 9274 | -C "error" |
| 9275 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9276 | # Tests for specific things with "unreliable" UDP connection |
| 9277 | |
| 9278 | not_with_valgrind # spurious resend due to timeout |
| 9279 | run_test "DTLS proxy: reference" \ |
| 9280 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9281 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9282 | "$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] | 9283 | 0 \ |
| 9284 | -C "replayed record" \ |
| 9285 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9286 | -C "Buffer record from epoch" \ |
| 9287 | -S "Buffer record from epoch" \ |
| 9288 | -C "ssl_buffer_message" \ |
| 9289 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9290 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9291 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9292 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9293 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9294 | -c "HTTP/1.0 200 OK" |
| 9295 | |
| 9296 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9297 | run_test "DTLS proxy: duplicate every packet" \ |
| 9298 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9299 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9300 | "$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] | 9301 | 0 \ |
| 9302 | -c "replayed record" \ |
| 9303 | -s "replayed record" \ |
| 9304 | -c "record from another epoch" \ |
| 9305 | -s "record from another epoch" \ |
| 9306 | -S "resend" \ |
| 9307 | -s "Extra-header:" \ |
| 9308 | -c "HTTP/1.0 200 OK" |
| 9309 | |
| 9310 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9311 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9312 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9313 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9314 | 0 \ |
| 9315 | -c "replayed record" \ |
| 9316 | -S "replayed record" \ |
| 9317 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9318 | -s "record from another epoch" \ |
| 9319 | -c "resend" \ |
| 9320 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9321 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9322 | -c "HTTP/1.0 200 OK" |
| 9323 | |
| 9324 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9325 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9326 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9327 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9328 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9329 | -c "next record in same datagram" \ |
| 9330 | -s "next record in same datagram" |
| 9331 | |
| 9332 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9333 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9334 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9335 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9336 | 0 \ |
| 9337 | -c "next record in same datagram" \ |
| 9338 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9339 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9340 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9341 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9342 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9343 | "$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] | 9344 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9345 | -c "discarding invalid record (mac)" \ |
| 9346 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9347 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9348 | -c "HTTP/1.0 200 OK" \ |
| 9349 | -S "too many records with bad MAC" \ |
| 9350 | -S "Verification of the message MAC failed" |
| 9351 | |
| 9352 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9353 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9354 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9355 | "$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] | 9356 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9357 | -C "discarding invalid record (mac)" \ |
| 9358 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9359 | -S "Extra-header:" \ |
| 9360 | -C "HTTP/1.0 200 OK" \ |
| 9361 | -s "too many records with bad MAC" \ |
| 9362 | -s "Verification of the message MAC failed" |
| 9363 | |
| 9364 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9365 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9366 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9367 | "$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] | 9368 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9369 | -c "discarding invalid record (mac)" \ |
| 9370 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9371 | -s "Extra-header:" \ |
| 9372 | -c "HTTP/1.0 200 OK" \ |
| 9373 | -S "too many records with bad MAC" \ |
| 9374 | -S "Verification of the message MAC failed" |
| 9375 | |
| 9376 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9377 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9378 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9379 | "$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] | 9380 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9381 | -c "discarding invalid record (mac)" \ |
| 9382 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9383 | -s "Extra-header:" \ |
| 9384 | -c "HTTP/1.0 200 OK" \ |
| 9385 | -s "too many records with bad MAC" \ |
| 9386 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9387 | |
| 9388 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9389 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9390 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9391 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9392 | 0 \ |
| 9393 | -c "record from another epoch" \ |
| 9394 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9395 | -s "Extra-header:" \ |
| 9396 | -c "HTTP/1.0 200 OK" |
| 9397 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9398 | # Tests for reordering support with DTLS |
| 9399 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9400 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9401 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9402 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9403 | hs_timeout=2500-60000" \ |
| 9404 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9405 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9406 | 0 \ |
| 9407 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9408 | -c "Next handshake message has been buffered - load"\ |
| 9409 | -S "Buffering HS message" \ |
| 9410 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9411 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9412 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9413 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9414 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9415 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9416 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9417 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9418 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9419 | hs_timeout=2500-60000" \ |
| 9420 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9421 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9422 | 0 \ |
| 9423 | -c "Buffering HS message" \ |
| 9424 | -c "found fragmented DTLS handshake message"\ |
| 9425 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9426 | -c "Next handshake message has been buffered - load"\ |
| 9427 | -S "Buffering HS message" \ |
| 9428 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9429 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9430 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9431 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9432 | -S "Remember CCS message" |
| 9433 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9434 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9435 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9436 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9437 | # while keeping the ServerKeyExchange. |
| 9438 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 9439 | 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] | 9440 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9441 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9442 | hs_timeout=2500-60000" \ |
| 9443 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9444 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9445 | 0 \ |
| 9446 | -c "Buffering HS message" \ |
| 9447 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9448 | -C "attempt to make space by freeing buffered messages" \ |
| 9449 | -S "Buffering HS message" \ |
| 9450 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9451 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9452 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9453 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9454 | -S "Remember CCS message" |
| 9455 | |
| 9456 | # The size constraints ensure that the delayed certificate message can't |
| 9457 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9458 | # when dropping it first. |
| 9459 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9460 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 9461 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9462 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9463 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9464 | hs_timeout=2500-60000" \ |
| 9465 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9466 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9467 | 0 \ |
| 9468 | -c "Buffering HS message" \ |
| 9469 | -c "attempt to make space by freeing buffered future messages" \ |
| 9470 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9471 | -S "Buffering HS message" \ |
| 9472 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9473 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9474 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9475 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9476 | -S "Remember CCS message" |
| 9477 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9478 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9479 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9480 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9481 | hs_timeout=2500-60000" \ |
| 9482 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9483 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9484 | 0 \ |
| 9485 | -C "Buffering HS message" \ |
| 9486 | -C "Next handshake message has been buffered - load"\ |
| 9487 | -s "Buffering HS message" \ |
| 9488 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9489 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9490 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9491 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9492 | -S "Remember CCS message" |
| 9493 | |
| 9494 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9495 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9496 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9497 | hs_timeout=2500-60000" \ |
| 9498 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9499 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9500 | 0 \ |
| 9501 | -C "Buffering HS message" \ |
| 9502 | -C "Next handshake message has been buffered - load"\ |
| 9503 | -S "Buffering HS message" \ |
| 9504 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9505 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9506 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9507 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9508 | -S "Remember CCS message" |
| 9509 | |
| 9510 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9511 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9512 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9513 | hs_timeout=2500-60000" \ |
| 9514 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9515 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9516 | 0 \ |
| 9517 | -C "Buffering HS message" \ |
| 9518 | -C "Next handshake message has been buffered - load"\ |
| 9519 | -S "Buffering HS message" \ |
| 9520 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9521 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9522 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9523 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9524 | -s "Remember CCS message" |
| 9525 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9526 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9527 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9528 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9529 | hs_timeout=2500-60000" \ |
| 9530 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9531 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9532 | 0 \ |
| 9533 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9534 | -s "Found buffered record from current epoch - load" \ |
| 9535 | -c "Buffer record from epoch 1" \ |
| 9536 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9537 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9538 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9539 | # from the server are delayed, so that the encrypted Finished message |
| 9540 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9541 | # in afterwards, the encrypted Finished message must be freed in order |
| 9542 | # to make space for the NewSessionTicket to be reassembled. |
| 9543 | # This works only in very particular circumstances: |
| 9544 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9545 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9546 | # the encrypted Finished message. |
| 9547 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9548 | # needs to be fragmented. |
| 9549 | # - All messages sent by the server must be small enough to be either sent |
| 9550 | # without fragmentation or be reassembled within the bounds of |
| 9551 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9552 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9553 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9554 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9555 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9556 | -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] | 9557 | "$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] | 9558 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9559 | 0 \ |
| 9560 | -s "Buffer record from epoch 1" \ |
| 9561 | -s "Found buffered record from current epoch - load" \ |
| 9562 | -c "Buffer record from epoch 1" \ |
| 9563 | -C "Found buffered record from current epoch - load" \ |
| 9564 | -c "Enough space available after freeing future epoch record" |
| 9565 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9566 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9567 | |
| 9568 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9569 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9570 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9571 | "$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] | 9572 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9573 | "$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] | 9574 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9575 | 0 \ |
| 9576 | -s "Extra-header:" \ |
| 9577 | -c "HTTP/1.0 200 OK" |
| 9578 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9579 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9580 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9581 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9582 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9583 | "$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] | 9584 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9585 | 0 \ |
| 9586 | -s "Extra-header:" \ |
| 9587 | -c "HTTP/1.0 200 OK" |
| 9588 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9589 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9590 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9591 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9592 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9593 | "$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] | 9594 | 0 \ |
| 9595 | -s "Extra-header:" \ |
| 9596 | -c "HTTP/1.0 200 OK" |
| 9597 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9598 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9599 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9600 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9601 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9602 | "$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] | 9603 | 0 \ |
| 9604 | -s "Extra-header:" \ |
| 9605 | -c "HTTP/1.0 200 OK" |
| 9606 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9607 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9608 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9609 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9610 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9611 | "$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] | 9612 | 0 \ |
| 9613 | -s "Extra-header:" \ |
| 9614 | -c "HTTP/1.0 200 OK" |
| 9615 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9616 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9617 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9618 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9619 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9620 | "$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] | 9621 | 0 \ |
| 9622 | -s "Extra-header:" \ |
| 9623 | -c "HTTP/1.0 200 OK" |
| 9624 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9625 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9626 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9627 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9628 | "$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] | 9629 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9630 | "$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] | 9631 | 0 \ |
| 9632 | -s "Extra-header:" \ |
| 9633 | -c "HTTP/1.0 200 OK" |
| 9634 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9635 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9636 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9637 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9638 | "$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] | 9639 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9640 | "$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] | 9641 | 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] | 9642 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9643 | 0 \ |
| 9644 | -s "a session has been resumed" \ |
| 9645 | -c "a session has been resumed" \ |
| 9646 | -s "Extra-header:" \ |
| 9647 | -c "HTTP/1.0 200 OK" |
| 9648 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9649 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9650 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9651 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9652 | "$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] | 9653 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9654 | "$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] | 9655 | 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] | 9656 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9657 | 0 \ |
| 9658 | -s "a session has been resumed" \ |
| 9659 | -c "a session has been resumed" \ |
| 9660 | -s "Extra-header:" \ |
| 9661 | -c "HTTP/1.0 200 OK" |
| 9662 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9663 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9664 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9665 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9666 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9667 | "$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] | 9668 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9669 | "$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] | 9670 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9671 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9672 | 0 \ |
| 9673 | -c "=> renegotiate" \ |
| 9674 | -s "=> renegotiate" \ |
| 9675 | -s "Extra-header:" \ |
| 9676 | -c "HTTP/1.0 200 OK" |
| 9677 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9678 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9679 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9680 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9681 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9682 | "$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] | 9683 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9684 | "$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] | 9685 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9686 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9687 | 0 \ |
| 9688 | -c "=> renegotiate" \ |
| 9689 | -s "=> renegotiate" \ |
| 9690 | -s "Extra-header:" \ |
| 9691 | -c "HTTP/1.0 200 OK" |
| 9692 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9693 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9694 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9695 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9696 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9697 | "$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] | 9698 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9699 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9700 | "$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] | 9701 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9702 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9703 | 0 \ |
| 9704 | -c "=> renegotiate" \ |
| 9705 | -s "=> renegotiate" \ |
| 9706 | -s "Extra-header:" \ |
| 9707 | -c "HTTP/1.0 200 OK" |
| 9708 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9709 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9710 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9711 | 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] | 9712 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9713 | "$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] | 9714 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9715 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9716 | "$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] | 9717 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9718 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9719 | 0 \ |
| 9720 | -c "=> renegotiate" \ |
| 9721 | -s "=> renegotiate" \ |
| 9722 | -s "Extra-header:" \ |
| 9723 | -c "HTTP/1.0 200 OK" |
| 9724 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9725 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9726 | ## all versions installed on the CI machines), reported here: |
| 9727 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9728 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9729 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9730 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9731 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9732 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9733 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9734 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9735 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9736 | "$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] | 9737 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9738 | -c "HTTP/1.0 200 OK" |
| 9739 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9740 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9741 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9742 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9743 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9744 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9745 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9746 | "$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] | 9747 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9748 | -c "HTTP/1.0 200 OK" |
| 9749 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9750 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9751 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9752 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9753 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9754 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9755 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9756 | "$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] | 9757 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9758 | -c "HTTP/1.0 200 OK" |
| 9759 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9760 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9761 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9762 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9763 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9764 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9765 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9766 | "$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] | 9767 | 0 \ |
| 9768 | -s "Extra-header:" \ |
| 9769 | -c "Extra-header:" |
| 9770 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9771 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9772 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9773 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9774 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9775 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9776 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9777 | "$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] | 9778 | 0 \ |
| 9779 | -s "Extra-header:" \ |
| 9780 | -c "Extra-header:" |
| 9781 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9782 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9783 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9784 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9785 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9786 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9787 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9788 | "$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] | 9789 | 0 \ |
| 9790 | -s "Extra-header:" \ |
| 9791 | -c "Extra-header:" |
| 9792 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9793 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 9794 | run_test "export keys functionality" \ |
| 9795 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9796 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9797 | 0 \ |
| 9798 | -s "exported maclen is " \ |
| 9799 | -s "exported keylen is " \ |
| 9800 | -s "exported ivlen is " \ |
| 9801 | -c "exported maclen is " \ |
| 9802 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9803 | -c "exported ivlen is " \ |
| 9804 | -c "EAP-TLS key material is:"\ |
| 9805 | -s "EAP-TLS key material is:"\ |
| 9806 | -c "EAP-TLS IV is:" \ |
| 9807 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9808 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9809 | # Test heap memory usage after handshake |
| 9810 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9811 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9812 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 9813 | run_tests_memory_after_hanshake |
| 9814 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9815 | # Final report |
| 9816 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9817 | echo "------------------------------------------------------------------------" |
| 9818 | |
| 9819 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9820 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9821 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9822 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9823 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9824 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9825 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9826 | |
| 9827 | exit $FAILS |