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 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 181 | # Read boolean configuration options from config.h for easy and quick |
| 182 | # testing. Skip non-boolean options (with something other than spaces |
| 183 | # and a comment after "#define SYMBOL"). The variable contains a |
| 184 | # space-separated list of symbols. |
| 185 | CONFIGS_ENABLED=" $(<"$CONFIG_H" \ |
| 186 | sed -n 's!^ *#define *\([A-Za-z][0-9A-Z_a-z]*\) *\(/*\)*!\1!p' | |
| 187 | tr '\n' ' ')" |
| 188 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 189 | # Skip next test; use this macro to skip tests which are legitimate |
| 190 | # in theory and expected to be re-introduced at some point, but |
| 191 | # aren't expected to succeed at the moment due to problems outside |
| 192 | # our control (such as bugs in other TLS implementations). |
| 193 | skip_next_test() { |
| 194 | SKIP_NEXT="YES" |
| 195 | } |
| 196 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 197 | # skip next test if the flag is not enabled in config.h |
| 198 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 199 | case $CONFIGS_ENABLED in |
| 200 | *" $1 "*) :;; |
| 201 | *) SKIP_NEXT="YES";; |
| 202 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 203 | } |
| 204 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 205 | # skip next test if the flag is enabled in config.h |
| 206 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 207 | case $CONFIGS_ENABLED in |
| 208 | *" $1 "*) SKIP_NEXT="YES";; |
| 209 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 210 | } |
| 211 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 212 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 213 | # This function uses the query_config command line option to query the |
| 214 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 215 | # program. The command will always return a success value if the |
| 216 | # configuration is defined and the value will be printed to stdout. |
| 217 | # |
| 218 | # Note that if the configuration is not defined or is defined to nothing, |
| 219 | # the output of this function will be an empty string. |
| 220 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 224 | VAL="$( get_config_value_or_default "$1" )" |
| 225 | if [ -z "$VAL" ]; then |
| 226 | # Should never happen |
| 227 | echo "Mbed TLS configuration $1 is not defined" |
| 228 | exit 1 |
| 229 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 230 | SKIP_NEXT="YES" |
| 231 | fi |
| 232 | } |
| 233 | |
| 234 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 235 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 236 | if [ -z "$VAL" ]; then |
| 237 | # Should never happen |
| 238 | echo "Mbed TLS configuration $1 is not defined" |
| 239 | exit 1 |
| 240 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 241 | SKIP_NEXT="YES" |
| 242 | fi |
| 243 | } |
| 244 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 245 | # Space-separated list of ciphersuites supported by this build of |
| 246 | # Mbed TLS. |
| 247 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 248 | grep TLS- | |
| 249 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 250 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 251 | case $P_CIPHERSUITES in |
| 252 | *" $1 "*) :;; |
| 253 | *) SKIP_NEXT="YES";; |
| 254 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 255 | } |
| 256 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 257 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 258 | # If CMD (call to a TLS client or server program) requires a specific |
| 259 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
| 260 | # enabled. As an exception, do run the test case if it expects a ciphersuite |
| 261 | # mismatch. |
| 262 | maybe_requires_ciphersuite_enabled() { |
| 263 | case "$1" in |
| 264 | *\ force_ciphersuite=*) :;; |
| 265 | *) return;; # No specific required ciphersuite |
| 266 | esac |
| 267 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 268 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 269 | shift |
| 270 | |
| 271 | case "$*" in |
| 272 | *"-s SSL - The server has no ciphersuites in common"*) |
| 273 | # This test case expects a ciphersuite mismatch, so it doesn't |
| 274 | # require the ciphersuite to be enabled. |
| 275 | ;; |
| 276 | *) |
| 277 | requires_ciphersuite_enabled "$ciphersuite" |
| 278 | ;; |
| 279 | esac |
| 280 | |
| 281 | unset ciphersuite |
| 282 | } |
| 283 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 284 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 285 | requires_openssl_with_fallback_scsv() { |
| 286 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 287 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 288 | then |
| 289 | OPENSSL_HAS_FBSCSV="YES" |
| 290 | else |
| 291 | OPENSSL_HAS_FBSCSV="NO" |
| 292 | fi |
| 293 | fi |
| 294 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 295 | SKIP_NEXT="YES" |
| 296 | fi |
| 297 | } |
| 298 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 299 | # skip next test if GnuTLS isn't available |
| 300 | requires_gnutls() { |
| 301 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 302 | 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] | 303 | GNUTLS_AVAILABLE="YES" |
| 304 | else |
| 305 | GNUTLS_AVAILABLE="NO" |
| 306 | fi |
| 307 | fi |
| 308 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 309 | SKIP_NEXT="YES" |
| 310 | fi |
| 311 | } |
| 312 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 313 | # skip next test if GnuTLS-next isn't available |
| 314 | requires_gnutls_next() { |
| 315 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 316 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 317 | GNUTLS_NEXT_AVAILABLE="YES" |
| 318 | else |
| 319 | GNUTLS_NEXT_AVAILABLE="NO" |
| 320 | fi |
| 321 | fi |
| 322 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 323 | SKIP_NEXT="YES" |
| 324 | fi |
| 325 | } |
| 326 | |
| 327 | # skip next test if OpenSSL-legacy isn't available |
| 328 | requires_openssl_legacy() { |
| 329 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 330 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 331 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 332 | else |
| 333 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 334 | fi |
| 335 | fi |
| 336 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 337 | SKIP_NEXT="YES" |
| 338 | fi |
| 339 | } |
| 340 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 341 | # skip next test if IPv6 isn't available on this host |
| 342 | requires_ipv6() { |
| 343 | if [ -z "${HAS_IPV6:-}" ]; then |
| 344 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 345 | SRV_PID=$! |
| 346 | sleep 1 |
| 347 | kill $SRV_PID >/dev/null 2>&1 |
| 348 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 349 | HAS_IPV6="NO" |
| 350 | else |
| 351 | HAS_IPV6="YES" |
| 352 | fi |
| 353 | rm -r $SRV_OUT |
| 354 | fi |
| 355 | |
| 356 | if [ "$HAS_IPV6" = "NO" ]; then |
| 357 | SKIP_NEXT="YES" |
| 358 | fi |
| 359 | } |
| 360 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 361 | # skip next test if it's i686 or uname is not available |
| 362 | requires_not_i686() { |
| 363 | if [ -z "${IS_I686:-}" ]; then |
| 364 | IS_I686="YES" |
| 365 | if which "uname" >/dev/null 2>&1; then |
| 366 | if [ -z "$(uname -a | grep i686)" ]; then |
| 367 | IS_I686="NO" |
| 368 | fi |
| 369 | fi |
| 370 | fi |
| 371 | if [ "$IS_I686" = "YES" ]; then |
| 372 | SKIP_NEXT="YES" |
| 373 | fi |
| 374 | } |
| 375 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 376 | # Calculate the input & output maximum content lengths set in the config |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 377 | MAX_CONTENT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 378 | MAX_IN_LEN=$( ../scripts/config.py get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 379 | 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] | 380 | |
| 381 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 382 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 383 | fi |
| 384 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 385 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 386 | fi |
| 387 | |
| 388 | # skip the next test if the SSL output buffer is less than 16KB |
| 389 | requires_full_size_output_buffer() { |
| 390 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 391 | SKIP_NEXT="YES" |
| 392 | fi |
| 393 | } |
| 394 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 395 | # skip the next test if valgrind is in use |
| 396 | not_with_valgrind() { |
| 397 | if [ "$MEMCHECK" -gt 0 ]; then |
| 398 | SKIP_NEXT="YES" |
| 399 | fi |
| 400 | } |
| 401 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 402 | # skip the next test if valgrind is NOT in use |
| 403 | only_with_valgrind() { |
| 404 | if [ "$MEMCHECK" -eq 0 ]; then |
| 405 | SKIP_NEXT="YES" |
| 406 | fi |
| 407 | } |
| 408 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 409 | # 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] | 410 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 411 | CLI_DELAY_FACTOR=$1 |
| 412 | } |
| 413 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 414 | # wait for the given seconds after the client finished in the next test |
| 415 | server_needs_more_time() { |
| 416 | SRV_DELAY_SECONDS=$1 |
| 417 | } |
| 418 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 419 | # print_name <name> |
| 420 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 421 | TESTS=$(( $TESTS + 1 )) |
| 422 | LINE="" |
| 423 | |
| 424 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 425 | LINE="$TESTS " |
| 426 | fi |
| 427 | |
| 428 | LINE="$LINE$1" |
| 429 | printf "$LINE " |
| 430 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 431 | for i in `seq 1 $LEN`; do printf '.'; done |
| 432 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 433 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 434 | } |
| 435 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 436 | # record_outcome <outcome> [<failure-reason>] |
| 437 | # The test name must be in $NAME. |
| 438 | record_outcome() { |
| 439 | echo "$1" |
| 440 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 441 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 442 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 443 | "ssl-opt" "$NAME" \ |
| 444 | "$1" "${2-}" \ |
| 445 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 446 | fi |
| 447 | } |
| 448 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 449 | # fail <message> |
| 450 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 451 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 452 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 453 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 454 | mv $SRV_OUT o-srv-${TESTS}.log |
| 455 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 456 | if [ -n "$PXY_CMD" ]; then |
| 457 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 458 | fi |
| 459 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 460 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 461 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 462 | echo " ! server output:" |
| 463 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 464 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 465 | echo " ! client output:" |
| 466 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 467 | if [ -n "$PXY_CMD" ]; then |
| 468 | echo " ! ========================================================" |
| 469 | echo " ! proxy output:" |
| 470 | cat o-pxy-${TESTS}.log |
| 471 | fi |
| 472 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 473 | fi |
| 474 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 475 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 476 | } |
| 477 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 478 | # is_polar <cmd_line> |
| 479 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 480 | case "$1" in |
| 481 | *ssl_client2*) true;; |
| 482 | *ssl_server2*) true;; |
| 483 | *) false;; |
| 484 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 485 | } |
| 486 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 487 | # openssl s_server doesn't have -www with DTLS |
| 488 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 489 | case "$SRV_CMD" in |
| 490 | *s_server*-dtls*) |
| 491 | NEEDS_INPUT=1 |
| 492 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 493 | *) NEEDS_INPUT=0;; |
| 494 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 495 | } |
| 496 | |
| 497 | # provide input to commands that need it |
| 498 | provide_input() { |
| 499 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 500 | return |
| 501 | fi |
| 502 | |
| 503 | while true; do |
| 504 | echo "HTTP/1.0 200 OK" |
| 505 | sleep 1 |
| 506 | done |
| 507 | } |
| 508 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 509 | # has_mem_err <log_file_name> |
| 510 | has_mem_err() { |
| 511 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 512 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 513 | then |
| 514 | return 1 # false: does not have errors |
| 515 | else |
| 516 | return 0 # true: has errors |
| 517 | fi |
| 518 | } |
| 519 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 520 | # 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] | 521 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 522 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 523 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 524 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 525 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 526 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 527 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 528 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 529 | # Make a tight loop, server normally takes less than 1s to start. |
| 530 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 531 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 532 | echo "$3 START TIMEOUT" |
| 533 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 534 | break |
| 535 | fi |
| 536 | # Linux and *BSD support decimal arguments to sleep. On other |
| 537 | # OSes this may be a tight loop. |
| 538 | sleep 0.1 2>/dev/null || true |
| 539 | done |
| 540 | } |
| 541 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 542 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 543 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 544 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 545 | } |
| 546 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 547 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 548 | # Wait for server process $2 to be listening on port $1. |
| 549 | wait_server_start() { |
| 550 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 551 | } |
| 552 | |
| 553 | # Wait for proxy process $2 to be listening on port $1. |
| 554 | wait_proxy_start() { |
| 555 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 556 | } |
| 557 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 558 | # 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] | 559 | # 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] | 560 | # acceptable bounds |
| 561 | check_server_hello_time() { |
| 562 | # 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] | 563 | 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] | 564 | # Get the Unix timestamp for now |
| 565 | CUR_TIME=$(date +'%s') |
| 566 | THRESHOLD_IN_SECS=300 |
| 567 | |
| 568 | # Check if the ServerHello time was printed |
| 569 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 570 | return 1 |
| 571 | fi |
| 572 | |
| 573 | # Check the time in ServerHello is within acceptable bounds |
| 574 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 575 | # The time in ServerHello is at least 5 minutes before now |
| 576 | return 1 |
| 577 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 578 | # 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] | 579 | return 1 |
| 580 | else |
| 581 | return 0 |
| 582 | fi |
| 583 | } |
| 584 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 585 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 586 | handshake_memory_get() { |
| 587 | OUTPUT_VARIABLE="$1" |
| 588 | OUTPUT_FILE="$2" |
| 589 | |
| 590 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 591 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 592 | |
| 593 | # Check if memory usage was read |
| 594 | if [ -z "$MEM_USAGE" ]; then |
| 595 | echo "Error: Can not read the value of handshake memory usage" |
| 596 | return 1 |
| 597 | else |
| 598 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 599 | return 0 |
| 600 | fi |
| 601 | } |
| 602 | |
| 603 | # Get handshake memory usage from server or client output and check if this value |
| 604 | # is not higher than the maximum given by the first argument |
| 605 | handshake_memory_check() { |
| 606 | MAX_MEMORY="$1" |
| 607 | OUTPUT_FILE="$2" |
| 608 | |
| 609 | # Get memory usage |
| 610 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 611 | return 1 |
| 612 | fi |
| 613 | |
| 614 | # Check if memory usage is below max value |
| 615 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 616 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 617 | "but should be below $MAX_MEMORY bytes" |
| 618 | return 1 |
| 619 | else |
| 620 | return 0 |
| 621 | fi |
| 622 | } |
| 623 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 624 | # wait for client to terminate and set CLI_EXIT |
| 625 | # must be called right after starting the client |
| 626 | wait_client_done() { |
| 627 | CLI_PID=$! |
| 628 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 629 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 630 | CLI_DELAY_FACTOR=1 |
| 631 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 632 | ( 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] | 633 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 634 | |
| 635 | wait $CLI_PID |
| 636 | CLI_EXIT=$? |
| 637 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 638 | kill $DOG_PID >/dev/null 2>&1 |
| 639 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 640 | |
| 641 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 642 | |
| 643 | sleep $SRV_DELAY_SECONDS |
| 644 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 645 | } |
| 646 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 647 | # check if the given command uses dtls and sets global variable DTLS |
| 648 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 649 | case "$1" in |
| 650 | *dtls=1*|-dtls|-u) DTLS=1;; |
| 651 | *) DTLS=0;; |
| 652 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 653 | } |
| 654 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 655 | # 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] | 656 | # Options: -s pattern pattern that must be present in server output |
| 657 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 658 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 659 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 660 | # -S pattern pattern that must be absent in server output |
| 661 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 662 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 663 | # -F call shell function on server 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? |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 678 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 679 | case ",$RUN_TEST_NUMBER," in |
| 680 | *",$TESTS,"*) :;; |
| 681 | *) SKIP_NEXT="YES";; |
| 682 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 683 | fi |
| 684 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 685 | # does this test use a proxy? |
| 686 | if [ "X$1" = "X-p" ]; then |
| 687 | PXY_CMD="$2" |
| 688 | shift 2 |
| 689 | else |
| 690 | PXY_CMD="" |
| 691 | fi |
| 692 | |
| 693 | # get commands and client output |
| 694 | SRV_CMD="$1" |
| 695 | CLI_CMD="$2" |
| 696 | CLI_EXPECT="$3" |
| 697 | shift 3 |
| 698 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 699 | # Check if test uses files |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame^] | 700 | case "$SRV_CMD $CLI_CMD" in |
| 701 | *data_files/*) |
| 702 | requires_config_enabled MBEDTLS_FS_IO;; |
| 703 | esac |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 704 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 705 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 706 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 707 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 708 | |
| 709 | # should we skip? |
| 710 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 711 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 712 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 713 | SKIPS=$(( $SKIPS + 1 )) |
| 714 | return |
| 715 | fi |
| 716 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 717 | # update DTLS variable |
| 718 | detect_dtls "$SRV_CMD" |
| 719 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 720 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 721 | # 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] | 722 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 723 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 724 | case " $SRV_CMD " in |
| 725 | *' server_addr=::1 '*) |
| 726 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 727 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 728 | fi |
| 729 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 730 | # fix client port |
| 731 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 732 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 733 | else |
| 734 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 735 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 736 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 737 | # prepend valgrind to our commands if active |
| 738 | if [ "$MEMCHECK" -gt 0 ]; then |
| 739 | if is_polar "$SRV_CMD"; then |
| 740 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 741 | fi |
| 742 | if is_polar "$CLI_CMD"; then |
| 743 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 744 | fi |
| 745 | fi |
| 746 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 747 | TIMES_LEFT=2 |
| 748 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 749 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 750 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 751 | # run the commands |
| 752 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 753 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 754 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 755 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 756 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 757 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 758 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 759 | check_osrv_dtls |
Manuel Pégourié-Gonnard | d06125c | 2020-06-08 12:06:21 +0200 | [diff] [blame] | 760 | printf "# $NAME\n$SRV_CMD\n" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 761 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 762 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 763 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 764 | |
Manuel Pégourié-Gonnard | d06125c | 2020-06-08 12:06:21 +0200 | [diff] [blame] | 765 | printf "# $NAME\n$CLI_CMD\n" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 766 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 767 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 768 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 769 | sleep 0.05 |
| 770 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 771 | # terminate the server (and the proxy) |
| 772 | kill $SRV_PID |
| 773 | wait $SRV_PID |
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 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 807 | # check server exit code |
| 808 | if [ $? != 0 ]; then |
| 809 | fail "server fail" |
| 810 | return |
| 811 | fi |
| 812 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 813 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 814 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 815 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 816 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 817 | 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] | 818 | return |
| 819 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 820 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 821 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 822 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 823 | # 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] | 824 | while [ $# -gt 0 ] |
| 825 | do |
| 826 | case $1 in |
| 827 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 828 | 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] | 829 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 830 | return |
| 831 | fi |
| 832 | ;; |
| 833 | |
| 834 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 835 | 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] | 836 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 837 | return |
| 838 | fi |
| 839 | ;; |
| 840 | |
| 841 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 842 | 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] | 843 | 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] | 844 | return |
| 845 | fi |
| 846 | ;; |
| 847 | |
| 848 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 849 | 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] | 850 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 851 | return |
| 852 | fi |
| 853 | ;; |
| 854 | |
| 855 | # The filtering in the following two options (-u and -U) do the following |
| 856 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 857 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 858 | # - keep one of each non-unique line |
| 859 | # - count how many lines remain |
| 860 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 861 | # if there were no duplicates. |
| 862 | "-U") |
| 863 | 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 |
| 864 | fail "lines following pattern '$2' must be unique in Server output" |
| 865 | return |
| 866 | fi |
| 867 | ;; |
| 868 | |
| 869 | "-u") |
| 870 | 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 |
| 871 | 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] | 872 | return |
| 873 | fi |
| 874 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 875 | "-F") |
| 876 | if ! $2 "$SRV_OUT"; then |
| 877 | fail "function call to '$2' failed on Server output" |
| 878 | return |
| 879 | fi |
| 880 | ;; |
| 881 | "-f") |
| 882 | if ! $2 "$CLI_OUT"; then |
| 883 | fail "function call to '$2' failed on Client output" |
| 884 | return |
| 885 | fi |
| 886 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 887 | |
| 888 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 889 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 890 | exit 1 |
| 891 | esac |
| 892 | shift 2 |
| 893 | done |
| 894 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 895 | # check valgrind's results |
| 896 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 897 | 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] | 898 | fail "Server has memory errors" |
| 899 | return |
| 900 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 901 | 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] | 902 | fail "Client has memory errors" |
| 903 | return |
| 904 | fi |
| 905 | fi |
| 906 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 907 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 908 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 909 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 910 | mv $SRV_OUT o-srv-${TESTS}.log |
| 911 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 912 | if [ -n "$PXY_CMD" ]; then |
| 913 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 914 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 915 | fi |
| 916 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 917 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 918 | } |
| 919 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 920 | run_test_psa() { |
| 921 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 922 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 923 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 924 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 925 | 0 \ |
| 926 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 927 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 928 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 929 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 930 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 931 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 932 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 933 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 934 | -C "Failed to setup PSA-based cipher context"\ |
| 935 | -S "Failed to setup PSA-based cipher context"\ |
| 936 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 937 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 938 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 939 | -S "error" \ |
| 940 | -C "error" |
| 941 | } |
| 942 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 943 | run_test_psa_force_curve() { |
| 944 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 945 | run_test "PSA - ECDH with $1" \ |
| 946 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 947 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 948 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 949 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 950 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 951 | -c "PSA calc verify" \ |
| 952 | -c "calc PSA finished" \ |
| 953 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 954 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 955 | -s "PSA calc verify" \ |
| 956 | -s "calc PSA finished" \ |
| 957 | -C "Failed to setup PSA-based cipher context"\ |
| 958 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 959 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 960 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 961 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 962 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 963 | -C "error" |
| 964 | } |
| 965 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 966 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 967 | # a maximum fragment length. |
| 968 | # first argument ($1) is MFL for SSL client |
| 969 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 970 | run_test_memory_after_hanshake_with_mfl() |
| 971 | { |
| 972 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 973 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 974 | |
| 975 | # Leave some margin for robustness |
| 976 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 977 | |
| 978 | run_test "Handshake memory usage (MFL $1)" \ |
| 979 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 980 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 981 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 982 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 983 | 0 \ |
| 984 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 985 | } |
| 986 | |
| 987 | |
| 988 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 989 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 990 | run_tests_memory_after_hanshake() |
| 991 | { |
| 992 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 993 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 994 | |
| 995 | # first test with default MFU is to get reference memory usage |
| 996 | MEMORY_USAGE_MFL_16K=0 |
| 997 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 998 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 999 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1000 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1001 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1002 | 0 \ |
| 1003 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1004 | |
| 1005 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1006 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1007 | |
| 1008 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1009 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1010 | |
| 1011 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1012 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1013 | |
| 1014 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1015 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1016 | } |
| 1017 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1018 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1019 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1020 | rm -f context_srv.txt |
| 1021 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1022 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1023 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1024 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1025 | 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] | 1026 | exit 1 |
| 1027 | } |
| 1028 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1029 | # |
| 1030 | # MAIN |
| 1031 | # |
| 1032 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1033 | get_options "$@" |
| 1034 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1035 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1036 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1037 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1038 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1039 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1040 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1041 | exit 1 |
| 1042 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1043 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1044 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1045 | exit 1 |
| 1046 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1047 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1048 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1049 | exit 1 |
| 1050 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1051 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1052 | if which valgrind >/dev/null 2>&1; then :; else |
| 1053 | echo "Memcheck not possible. Valgrind not found" |
| 1054 | exit 1 |
| 1055 | fi |
| 1056 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1057 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1058 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1059 | exit 1 |
| 1060 | fi |
| 1061 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1062 | # used by watchdog |
| 1063 | MAIN_PID="$$" |
| 1064 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1065 | # We use somewhat arbitrary delays for tests: |
| 1066 | # - how long do we wait for the server to start (when lsof not available)? |
| 1067 | # - how long do we allow for the client to finish? |
| 1068 | # (not to check performance, just to avoid waiting indefinitely) |
| 1069 | # Things are slower with valgrind, so give extra time here. |
| 1070 | # |
| 1071 | # Note: without lsof, there is a trade-off between the running time of this |
| 1072 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1073 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1074 | # 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] | 1075 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1076 | START_DELAY=6 |
| 1077 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1078 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1079 | START_DELAY=2 |
| 1080 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1081 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1082 | |
| 1083 | # some particular tests need more time: |
| 1084 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1085 | # - for the server, we sleep for a number of seconds after the client exits |
| 1086 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1087 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1088 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1089 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1090 | # 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] | 1091 | # +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] | 1092 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1093 | 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] | 1094 | 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] | 1095 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1096 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 1097 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1098 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1099 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1100 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1101 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1102 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1103 | fi |
| 1104 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1105 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1106 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1107 | fi |
| 1108 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1109 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1110 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1111 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1112 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1113 | # Allow SHA-1, because many of our test certificates use it |
| 1114 | P_SRV="$P_SRV allow_sha1=1" |
| 1115 | P_CLI="$P_CLI allow_sha1=1" |
| 1116 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1117 | # Also pick a unique name for intermediate files |
| 1118 | SRV_OUT="srv_out.$$" |
| 1119 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1120 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1121 | SESSION="session.$$" |
| 1122 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1123 | SKIP_NEXT="NO" |
| 1124 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1125 | trap cleanup INT TERM HUP |
| 1126 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1127 | # Basic test |
| 1128 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1129 | # Checks that: |
| 1130 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1131 | # - the expected (highest security) parameters are selected |
| 1132 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1133 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1134 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1135 | "$P_CLI" \ |
| 1136 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1137 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1138 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1139 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1140 | -s "ECDHE curve: secp521r1" \ |
| 1141 | -S "error" \ |
| 1142 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1143 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1144 | run_test "Default, DTLS" \ |
| 1145 | "$P_SRV dtls=1" \ |
| 1146 | "$P_CLI dtls=1" \ |
| 1147 | 0 \ |
| 1148 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1149 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1150 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1151 | run_test "TLS client auth: required" \ |
| 1152 | "$P_SRV auth_mode=required" \ |
| 1153 | "$P_CLI" \ |
| 1154 | 0 \ |
| 1155 | -s "Verifying peer X.509 certificate... ok" |
| 1156 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1157 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1158 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1159 | requires_config_enabled MBEDTLS_SHA256_C |
| 1160 | run_test "TLS: password protected client key" \ |
| 1161 | "$P_SRV auth_mode=required" \ |
| 1162 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1163 | 0 |
| 1164 | |
| 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 server key" \ |
| 1169 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1170 | "$P_CLI" \ |
| 1171 | 0 |
| 1172 | |
| 1173 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1174 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1175 | requires_config_enabled MBEDTLS_RSA_C |
| 1176 | requires_config_enabled MBEDTLS_SHA256_C |
| 1177 | run_test "TLS: password protected server key, two certificates" \ |
| 1178 | "$P_SRV \ |
| 1179 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1180 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1181 | "$P_CLI" \ |
| 1182 | 0 |
| 1183 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1184 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1185 | run_test "Default (compression enabled)" \ |
| 1186 | "$P_SRV debug_level=3" \ |
| 1187 | "$P_CLI debug_level=3" \ |
| 1188 | 0 \ |
| 1189 | -s "Allocating compression buffer" \ |
| 1190 | -c "Allocating compression buffer" \ |
| 1191 | -s "Record expansion is unknown (compression)" \ |
| 1192 | -c "Record expansion is unknown (compression)" \ |
| 1193 | -S "error" \ |
| 1194 | -C "error" |
| 1195 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1196 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1197 | run_test "CA callback on client" \ |
| 1198 | "$P_SRV debug_level=3" \ |
| 1199 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1200 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1201 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1202 | -S "error" \ |
| 1203 | -C "error" |
| 1204 | |
| 1205 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1206 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1207 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1208 | requires_config_enabled MBEDTLS_SHA256_C |
| 1209 | run_test "CA callback on server" \ |
| 1210 | "$P_SRV auth_mode=required" \ |
| 1211 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1212 | key_file=data_files/server5.key" \ |
| 1213 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1214 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1215 | -s "Verifying peer X.509 certificate... ok" \ |
| 1216 | -S "error" \ |
| 1217 | -C "error" |
| 1218 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1219 | # Test using an opaque private key for client authentication |
| 1220 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1221 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1222 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1223 | requires_config_enabled MBEDTLS_SHA256_C |
| 1224 | run_test "Opaque key for client authentication" \ |
| 1225 | "$P_SRV auth_mode=required" \ |
| 1226 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1227 | key_file=data_files/server5.key" \ |
| 1228 | 0 \ |
| 1229 | -c "key type: Opaque" \ |
| 1230 | -s "Verifying peer X.509 certificate... ok" \ |
| 1231 | -S "error" \ |
| 1232 | -C "error" |
| 1233 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1234 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1235 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1236 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1237 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1238 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1239 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1240 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1241 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1242 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1243 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1244 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1245 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1246 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1247 | run_test_psa_force_curve "secp521r1" |
| 1248 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1249 | run_test_psa_force_curve "brainpoolP512r1" |
| 1250 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1251 | run_test_psa_force_curve "secp384r1" |
| 1252 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1253 | run_test_psa_force_curve "brainpoolP384r1" |
| 1254 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1255 | run_test_psa_force_curve "secp256r1" |
| 1256 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1257 | run_test_psa_force_curve "secp256k1" |
| 1258 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1259 | run_test_psa_force_curve "brainpoolP256r1" |
| 1260 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1261 | run_test_psa_force_curve "secp224r1" |
| 1262 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1263 | run_test_psa_force_curve "secp224k1" |
| 1264 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1265 | run_test_psa_force_curve "secp192r1" |
| 1266 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1267 | run_test_psa_force_curve "secp192k1" |
| 1268 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1269 | # Test current time in ServerHello |
| 1270 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1271 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1272 | "$P_SRV debug_level=3" \ |
| 1273 | "$P_CLI debug_level=3" \ |
| 1274 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1275 | -f "check_server_hello_time" \ |
| 1276 | -F "check_server_hello_time" |
| 1277 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1278 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1279 | run_test "Unique IV in GCM" \ |
| 1280 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1281 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1282 | 0 \ |
| 1283 | -u "IV used" \ |
| 1284 | -U "IV used" |
| 1285 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1286 | # Tests for certificate verification callback |
| 1287 | run_test "Configuration-specific CRT verification callback" \ |
| 1288 | "$P_SRV debug_level=3" \ |
| 1289 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1290 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1291 | -S "error" \ |
| 1292 | -c "Verify requested for " \ |
| 1293 | -c "Use configuration-specific verification callback" \ |
| 1294 | -C "Use context-specific verification callback" \ |
| 1295 | -C "error" |
| 1296 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1297 | run_test "Context-specific CRT verification callback" \ |
| 1298 | "$P_SRV debug_level=3" \ |
| 1299 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1300 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1301 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1302 | -c "Verify requested for " \ |
| 1303 | -c "Use context-specific verification callback" \ |
| 1304 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1305 | -C "error" |
| 1306 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1307 | # Tests for rc4 option |
| 1308 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1309 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1310 | run_test "RC4: server disabled, client enabled" \ |
| 1311 | "$P_SRV" \ |
| 1312 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1313 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1314 | -s "SSL - The server has no ciphersuites in common" |
| 1315 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1316 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1317 | run_test "RC4: server half, client enabled" \ |
| 1318 | "$P_SRV arc4=1" \ |
| 1319 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1320 | 1 \ |
| 1321 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1322 | |
| 1323 | run_test "RC4: server enabled, client disabled" \ |
| 1324 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1325 | "$P_CLI" \ |
| 1326 | 1 \ |
| 1327 | -s "SSL - The server has no ciphersuites in common" |
| 1328 | |
| 1329 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1330 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1331 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1332 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1333 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1334 | -S "SSL - The server has no ciphersuites in common" |
| 1335 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1336 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1337 | |
| 1338 | requires_gnutls |
| 1339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1340 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1341 | "$G_SRV"\ |
| 1342 | "$P_CLI force_version=tls1_1" \ |
| 1343 | 0 |
| 1344 | |
| 1345 | requires_gnutls |
| 1346 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1347 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1348 | "$G_SRV"\ |
| 1349 | "$P_CLI force_version=tls1" \ |
| 1350 | 0 |
| 1351 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1352 | # Tests for SHA-1 support |
| 1353 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1354 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1355 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1356 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1357 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1358 | 1 \ |
| 1359 | -c "The certificate is signed with an unacceptable hash" |
| 1360 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1361 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1362 | run_test "SHA-1 allowed by default in server certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1363 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1364 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1365 | 0 |
| 1366 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1367 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1368 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1369 | "$P_CLI allow_sha1=1" \ |
| 1370 | 0 |
| 1371 | |
| 1372 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1373 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1374 | "$P_CLI allow_sha1=0" \ |
| 1375 | 0 |
| 1376 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1377 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1378 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1379 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1380 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1381 | 1 \ |
| 1382 | -s "The certificate is signed with an unacceptable hash" |
| 1383 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1384 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1385 | run_test "SHA-1 allowed by default in client certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1386 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1387 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1388 | 0 |
| 1389 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1390 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1391 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1392 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1393 | 0 |
| 1394 | |
| 1395 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1396 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1397 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1398 | 0 |
| 1399 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1400 | # Tests for datagram packing |
| 1401 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1402 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1403 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1404 | 0 \ |
| 1405 | -c "next record in same datagram" \ |
| 1406 | -s "next record in same datagram" |
| 1407 | |
| 1408 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1409 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1410 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1411 | 0 \ |
| 1412 | -s "next record in same datagram" \ |
| 1413 | -C "next record in same datagram" |
| 1414 | |
| 1415 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1416 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1417 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1418 | 0 \ |
| 1419 | -S "next record in same datagram" \ |
| 1420 | -c "next record in same datagram" |
| 1421 | |
| 1422 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1423 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1424 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1425 | 0 \ |
| 1426 | -S "next record in same datagram" \ |
| 1427 | -C "next record in same datagram" |
| 1428 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1429 | # Tests for Truncated HMAC extension |
| 1430 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1431 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1432 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1433 | "$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] | 1434 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1435 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1436 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1437 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1438 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1439 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1440 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1441 | "$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] | 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 | e117a8f | 2015-01-09 12:39:35 +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 enabled, server default" \ |
| 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=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +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 disabled" \ |
| 1456 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
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 |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1463 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1464 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
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=0" \ |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1466 | 0 \ |
| 1467 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1468 | -S "dumping 'expected mac' (10 bytes)" |
| 1469 | |
| 1470 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1471 | run_test "Truncated HMAC: client enabled, 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=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1474 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1475 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1476 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1477 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1478 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1479 | "$P_SRV dtls=1 debug_level=4" \ |
| 1480 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1481 | 0 \ |
| 1482 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1483 | -S "dumping 'expected mac' (10 bytes)" |
| 1484 | |
| 1485 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1486 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1487 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1488 | "$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] | 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 enabled, 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=1" \ |
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 disabled" \ |
| 1503 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
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 disabled, server enabled" \ |
| 1511 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
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=0" \ |
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 enabled, 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=1" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1521 | 0 \ |
| 1522 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1523 | -s "dumping 'expected mac' (10 bytes)" |
| 1524 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1525 | # Tests for Context serialization |
| 1526 | |
| 1527 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1528 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1529 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1530 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1531 | 0 \ |
| 1532 | -c "Deserializing connection..." \ |
| 1533 | -S "Deserializing connection..." |
| 1534 | |
| 1535 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1536 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1537 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1538 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 1545 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1546 | "$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] | 1547 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1548 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1549 | -S "Deserializing connection..." |
| 1550 | |
| 1551 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1552 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1553 | run_test "Context serialization, client serializes, with CID" \ |
| 1554 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1555 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1556 | 0 \ |
| 1557 | -c "Deserializing connection..." \ |
| 1558 | -S "Deserializing connection..." |
| 1559 | |
| 1560 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1561 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1562 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1563 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1564 | 0 \ |
| 1565 | -C "Deserializing connection..." \ |
| 1566 | -s "Deserializing connection..." |
| 1567 | |
| 1568 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1569 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1570 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1571 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 1578 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1579 | "$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] | 1580 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1581 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1582 | -s "Deserializing connection..." |
| 1583 | |
| 1584 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1585 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1586 | run_test "Context serialization, server serializes, with CID" \ |
| 1587 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1588 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1589 | 0 \ |
| 1590 | -C "Deserializing connection..." \ |
| 1591 | -s "Deserializing connection..." |
| 1592 | |
| 1593 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1594 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1595 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1596 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1597 | 0 \ |
| 1598 | -c "Deserializing connection..." \ |
| 1599 | -s "Deserializing connection..." |
| 1600 | |
| 1601 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1602 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1603 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1604 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 1611 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1612 | "$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] | 1613 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1614 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1615 | -s "Deserializing connection..." |
| 1616 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1617 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1618 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1619 | run_test "Context serialization, both serialize, with CID" \ |
| 1620 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1621 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1622 | 0 \ |
| 1623 | -c "Deserializing connection..." \ |
| 1624 | -s "Deserializing connection..." |
| 1625 | |
| 1626 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1627 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1628 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1629 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1630 | 0 \ |
| 1631 | -c "Deserializing connection..." \ |
| 1632 | -S "Deserializing connection..." |
| 1633 | |
| 1634 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1635 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1636 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1637 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 1644 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1645 | "$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] | 1646 | 0 \ |
| 1647 | -c "Deserializing connection..." \ |
| 1648 | -S "Deserializing connection..." |
| 1649 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1650 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1651 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1652 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1653 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1654 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1655 | 0 \ |
| 1656 | -c "Deserializing connection..." \ |
| 1657 | -S "Deserializing connection..." |
| 1658 | |
| 1659 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1660 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1661 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1662 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1663 | 0 \ |
| 1664 | -C "Deserializing connection..." \ |
| 1665 | -s "Deserializing connection..." |
| 1666 | |
| 1667 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1668 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1669 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1670 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 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" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1679 | 0 \ |
| 1680 | -C "Deserializing connection..." \ |
| 1681 | -s "Deserializing connection..." |
| 1682 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1683 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1684 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1685 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1686 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1687 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1688 | 0 \ |
| 1689 | -C "Deserializing connection..." \ |
| 1690 | -s "Deserializing connection..." |
| 1691 | |
| 1692 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1693 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1694 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1695 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1696 | 0 \ |
| 1697 | -c "Deserializing connection..." \ |
| 1698 | -s "Deserializing connection..." |
| 1699 | |
| 1700 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1701 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1702 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1703 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 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" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1712 | 0 \ |
| 1713 | -c "Deserializing connection..." \ |
| 1714 | -s "Deserializing connection..." |
| 1715 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1716 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1717 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1718 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1719 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1720 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1721 | 0 \ |
| 1722 | -c "Deserializing connection..." \ |
| 1723 | -s "Deserializing connection..." |
| 1724 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1725 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1726 | run_test "Saving the serialized context to a file" \ |
| 1727 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1728 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1729 | 0 \ |
| 1730 | -s "Save serialized context to a file... ok" \ |
| 1731 | -c "Save serialized context to a file... ok" |
| 1732 | rm -f context_srv.txt |
| 1733 | rm -f context_cli.txt |
| 1734 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1735 | # Tests for DTLS Connection ID extension |
| 1736 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1737 | # So far, the CID API isn't implemented, so we can't |
| 1738 | # grep for output witnessing its use. This needs to be |
| 1739 | # changed once the CID extension is implemented. |
| 1740 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1741 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1742 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1743 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1744 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1745 | 0 \ |
| 1746 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1747 | -s "found CID extension" \ |
| 1748 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1749 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1750 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1751 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1752 | -C "found CID extension" \ |
| 1753 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1754 | -C "Copy CIDs into SSL transform" \ |
| 1755 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1756 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1757 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1758 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1759 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1760 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1761 | 0 \ |
| 1762 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1763 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1764 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1765 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1766 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1767 | -C "found CID extension" \ |
| 1768 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1769 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1770 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1771 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1772 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1773 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1774 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1775 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1776 | 0 \ |
| 1777 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1778 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1779 | -c "client hello, adding CID extension" \ |
| 1780 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1781 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1782 | -s "server hello, adding CID extension" \ |
| 1783 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1784 | -c "Use of CID extension negotiated" \ |
| 1785 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1786 | -c "Copy CIDs into SSL transform" \ |
| 1787 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1788 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1789 | -s "Use of Connection ID has been negotiated" \ |
| 1790 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1791 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1792 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1793 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1794 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1795 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1796 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1797 | 0 \ |
| 1798 | -c "Enable use of CID extension." \ |
| 1799 | -s "Enable use of CID extension." \ |
| 1800 | -c "client hello, adding CID extension" \ |
| 1801 | -s "found CID extension" \ |
| 1802 | -s "Use of CID extension negotiated" \ |
| 1803 | -s "server hello, adding CID extension" \ |
| 1804 | -c "found CID extension" \ |
| 1805 | -c "Use of CID extension negotiated" \ |
| 1806 | -s "Copy CIDs into SSL transform" \ |
| 1807 | -c "Copy CIDs into SSL transform" \ |
| 1808 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1809 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1810 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1811 | -c "Use of Connection ID has been negotiated" \ |
| 1812 | -c "ignoring unexpected CID" \ |
| 1813 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1814 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1815 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1816 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1817 | -p "$P_PXY mtu=800" \ |
| 1818 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1819 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1820 | 0 \ |
| 1821 | -c "Enable use of CID extension." \ |
| 1822 | -s "Enable use of CID extension." \ |
| 1823 | -c "client hello, adding CID extension" \ |
| 1824 | -s "found CID extension" \ |
| 1825 | -s "Use of CID extension negotiated" \ |
| 1826 | -s "server hello, adding CID extension" \ |
| 1827 | -c "found CID extension" \ |
| 1828 | -c "Use of CID extension negotiated" \ |
| 1829 | -s "Copy CIDs into SSL transform" \ |
| 1830 | -c "Copy CIDs into SSL transform" \ |
| 1831 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1832 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1833 | -s "Use of Connection ID has been negotiated" \ |
| 1834 | -c "Use of Connection ID has been negotiated" |
| 1835 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1836 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1837 | 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] | 1838 | -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] | 1839 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1840 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1841 | 0 \ |
| 1842 | -c "Enable use of CID extension." \ |
| 1843 | -s "Enable use of CID extension." \ |
| 1844 | -c "client hello, adding CID extension" \ |
| 1845 | -s "found CID extension" \ |
| 1846 | -s "Use of CID extension negotiated" \ |
| 1847 | -s "server hello, adding CID extension" \ |
| 1848 | -c "found CID extension" \ |
| 1849 | -c "Use of CID extension negotiated" \ |
| 1850 | -s "Copy CIDs into SSL transform" \ |
| 1851 | -c "Copy CIDs into SSL transform" \ |
| 1852 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1853 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1854 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1855 | -c "Use of Connection ID has been negotiated" \ |
| 1856 | -c "ignoring unexpected CID" \ |
| 1857 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1858 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1859 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1860 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1861 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1862 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1863 | 0 \ |
| 1864 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1865 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1866 | -c "client hello, adding CID extension" \ |
| 1867 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1868 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1869 | -s "server hello, adding CID extension" \ |
| 1870 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1871 | -c "Use of CID extension negotiated" \ |
| 1872 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1873 | -c "Copy CIDs into SSL transform" \ |
| 1874 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1875 | -s "Peer CID (length 0 Bytes):" \ |
| 1876 | -s "Use of Connection ID has been negotiated" \ |
| 1877 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1878 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1879 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1880 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1881 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1882 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1883 | 0 \ |
| 1884 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1885 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1886 | -c "client hello, adding CID extension" \ |
| 1887 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1888 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1889 | -s "server hello, adding CID extension" \ |
| 1890 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1891 | -c "Use of CID extension negotiated" \ |
| 1892 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1893 | -c "Copy CIDs into SSL transform" \ |
| 1894 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1895 | -c "Peer CID (length 0 Bytes):" \ |
| 1896 | -s "Use of Connection ID has been negotiated" \ |
| 1897 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1898 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1899 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1900 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1901 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1902 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1903 | 0 \ |
| 1904 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1905 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1906 | -c "client hello, adding CID extension" \ |
| 1907 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1908 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1909 | -s "server hello, adding CID extension" \ |
| 1910 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1911 | -c "Use of CID extension negotiated" \ |
| 1912 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1913 | -c "Copy CIDs into SSL transform" \ |
| 1914 | -S "Use of Connection ID has been negotiated" \ |
| 1915 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1916 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1917 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1918 | 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] | 1919 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1920 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1921 | 0 \ |
| 1922 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1923 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1924 | -c "client hello, adding CID extension" \ |
| 1925 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1926 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1927 | -s "server hello, adding CID extension" \ |
| 1928 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1929 | -c "Use of CID extension negotiated" \ |
| 1930 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1931 | -c "Copy CIDs into SSL transform" \ |
| 1932 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1933 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1934 | -s "Use of Connection ID has been negotiated" \ |
| 1935 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1936 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1937 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1938 | 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] | 1939 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1940 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1941 | 0 \ |
| 1942 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1943 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1944 | -c "client hello, adding CID extension" \ |
| 1945 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1946 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1947 | -s "server hello, adding CID extension" \ |
| 1948 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1949 | -c "Use of CID extension negotiated" \ |
| 1950 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1951 | -c "Copy CIDs into SSL transform" \ |
| 1952 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1953 | -s "Peer CID (length 0 Bytes):" \ |
| 1954 | -s "Use of Connection ID has been negotiated" \ |
| 1955 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1956 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1958 | 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] | 1959 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1960 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1961 | 0 \ |
| 1962 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1963 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1964 | -c "client hello, adding CID extension" \ |
| 1965 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1966 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1967 | -s "server hello, adding CID extension" \ |
| 1968 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1969 | -c "Use of CID extension negotiated" \ |
| 1970 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1971 | -c "Copy CIDs into SSL transform" \ |
| 1972 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1973 | -c "Peer CID (length 0 Bytes):" \ |
| 1974 | -s "Use of Connection ID has been negotiated" \ |
| 1975 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1976 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1977 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1978 | 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] | 1979 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1980 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1981 | 0 \ |
| 1982 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1983 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1984 | -c "client hello, adding CID extension" \ |
| 1985 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1986 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1987 | -s "server hello, adding CID extension" \ |
| 1988 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1989 | -c "Use of CID extension negotiated" \ |
| 1990 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1991 | -c "Copy CIDs into SSL transform" \ |
| 1992 | -S "Use of Connection ID has been negotiated" \ |
| 1993 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1994 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1995 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1996 | 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] | 1997 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1998 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1999 | 0 \ |
| 2000 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2001 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2002 | -c "client hello, adding CID extension" \ |
| 2003 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2004 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2005 | -s "server hello, adding CID extension" \ |
| 2006 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2007 | -c "Use of CID extension negotiated" \ |
| 2008 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2009 | -c "Copy CIDs into SSL transform" \ |
| 2010 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2011 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2012 | -s "Use of Connection ID has been negotiated" \ |
| 2013 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2014 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2016 | 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] | 2017 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2018 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2019 | 0 \ |
| 2020 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2021 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2022 | -c "client hello, adding CID extension" \ |
| 2023 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2024 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2025 | -s "server hello, adding CID extension" \ |
| 2026 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2027 | -c "Use of CID extension negotiated" \ |
| 2028 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2029 | -c "Copy CIDs into SSL transform" \ |
| 2030 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2031 | -s "Peer CID (length 0 Bytes):" \ |
| 2032 | -s "Use of Connection ID has been negotiated" \ |
| 2033 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2034 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2035 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2036 | 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] | 2037 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2038 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2039 | 0 \ |
| 2040 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2041 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2042 | -c "client hello, adding CID extension" \ |
| 2043 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2044 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2045 | -s "server hello, adding CID extension" \ |
| 2046 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2047 | -c "Use of CID extension negotiated" \ |
| 2048 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2049 | -c "Copy CIDs into SSL transform" \ |
| 2050 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2051 | -c "Peer CID (length 0 Bytes):" \ |
| 2052 | -s "Use of Connection ID has been negotiated" \ |
| 2053 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2054 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2055 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2056 | 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] | 2057 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2058 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2059 | 0 \ |
| 2060 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2061 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2062 | -c "client hello, adding CID extension" \ |
| 2063 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2064 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2065 | -s "server hello, adding CID extension" \ |
| 2066 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2067 | -c "Use of CID extension negotiated" \ |
| 2068 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2069 | -c "Copy CIDs into SSL transform" \ |
| 2070 | -S "Use of Connection ID has been negotiated" \ |
| 2071 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2072 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2073 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2074 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2075 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2076 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2077 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2078 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2079 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2080 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2081 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2082 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2083 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2084 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2085 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2086 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2087 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2088 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2089 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2090 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2091 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2092 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2093 | 0 \ |
| 2094 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2095 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2096 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2097 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2098 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2099 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2100 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2101 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2102 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2103 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2104 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2105 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2106 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2107 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2108 | 0 \ |
| 2109 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2110 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2111 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2112 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2113 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2114 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2115 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2116 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2117 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2118 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2119 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2120 | 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] | 2121 | -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] | 2122 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2123 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2124 | 0 \ |
| 2125 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2126 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2127 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2128 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2129 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2130 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2131 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2132 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2133 | -c "ignoring unexpected CID" \ |
| 2134 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2135 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2136 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2137 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2138 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2139 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2140 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2141 | 0 \ |
| 2142 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2143 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2144 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2145 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2146 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2147 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2148 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2149 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2150 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2151 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2152 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2153 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2154 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2155 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2156 | 0 \ |
| 2157 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2158 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2159 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2160 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2161 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2162 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2163 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2164 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2165 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2167 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2168 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2169 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2170 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2171 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2172 | 0 \ |
| 2173 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2174 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2175 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2176 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2177 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2178 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2179 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2180 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2181 | -c "ignoring unexpected CID" \ |
| 2182 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2183 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2184 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2185 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2186 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2187 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2188 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2189 | 0 \ |
| 2190 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2191 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2192 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2193 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2194 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2195 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2196 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2197 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2198 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2199 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2200 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2201 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2202 | 0 \ |
| 2203 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2204 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2205 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2206 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2207 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2208 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2209 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2210 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2211 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2212 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2213 | -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] | 2214 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2215 | "$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" \ |
| 2216 | 0 \ |
| 2217 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2218 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2219 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2220 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2221 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2222 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2223 | -c "ignoring unexpected CID" \ |
| 2224 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2225 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2226 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2227 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2228 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2229 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2230 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2231 | 0 \ |
| 2232 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2233 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2234 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2235 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2236 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2237 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2238 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2239 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2240 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2241 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2242 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2243 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2244 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2245 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2246 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2247 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2248 | 0 \ |
| 2249 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2250 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2251 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2252 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2253 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2254 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2255 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2256 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2257 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2258 | -c "ignoring unexpected CID" \ |
| 2259 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2260 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2261 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2262 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2263 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2264 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2265 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2266 | 0 \ |
| 2267 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2268 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2269 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2270 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2271 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2272 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2273 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2274 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2275 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2276 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2277 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2278 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2279 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2280 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2281 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2282 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2283 | 0 \ |
| 2284 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2285 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2286 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2287 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2288 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2289 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2290 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2291 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2292 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2293 | -c "ignoring unexpected CID" \ |
| 2294 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2295 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2297 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2298 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2299 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2300 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2301 | 0 \ |
| 2302 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2303 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2304 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2305 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2306 | -s "Reallocating in_buf" \ |
| 2307 | -s "Reallocating out_buf" |
| 2308 | |
| 2309 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2310 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2311 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2312 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2313 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2314 | 0 \ |
| 2315 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2316 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2317 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2318 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2319 | -s "Reallocating in_buf" \ |
| 2320 | -s "Reallocating out_buf" |
| 2321 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2322 | # Tests for Encrypt-then-MAC extension |
| 2323 | |
| 2324 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2325 | "$P_SRV debug_level=3 \ |
| 2326 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2327 | "$P_CLI debug_level=3" \ |
| 2328 | 0 \ |
| 2329 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2330 | -s "found encrypt then mac extension" \ |
| 2331 | -s "server hello, adding encrypt then mac extension" \ |
| 2332 | -c "found encrypt_then_mac extension" \ |
| 2333 | -c "using encrypt then mac" \ |
| 2334 | -s "using encrypt then mac" |
| 2335 | |
| 2336 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2337 | "$P_SRV debug_level=3 etm=0 \ |
| 2338 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2339 | "$P_CLI debug_level=3 etm=1" \ |
| 2340 | 0 \ |
| 2341 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2342 | -s "found encrypt then mac extension" \ |
| 2343 | -S "server hello, adding encrypt then mac extension" \ |
| 2344 | -C "found encrypt_then_mac extension" \ |
| 2345 | -C "using encrypt then mac" \ |
| 2346 | -S "using encrypt then mac" |
| 2347 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2348 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2349 | "$P_SRV debug_level=3 etm=1 \ |
| 2350 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2351 | "$P_CLI debug_level=3 etm=1" \ |
| 2352 | 0 \ |
| 2353 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2354 | -s "found encrypt then mac extension" \ |
| 2355 | -S "server hello, adding encrypt then mac extension" \ |
| 2356 | -C "found encrypt_then_mac extension" \ |
| 2357 | -C "using encrypt then mac" \ |
| 2358 | -S "using encrypt then mac" |
| 2359 | |
| 2360 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2361 | "$P_SRV debug_level=3 etm=1 \ |
| 2362 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2363 | "$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] | 2364 | 0 \ |
| 2365 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2366 | -s "found encrypt then mac extension" \ |
| 2367 | -S "server hello, adding encrypt then mac extension" \ |
| 2368 | -C "found encrypt_then_mac extension" \ |
| 2369 | -C "using encrypt then mac" \ |
| 2370 | -S "using encrypt then mac" |
| 2371 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2372 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2373 | "$P_SRV debug_level=3 etm=1 \ |
| 2374 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2375 | "$P_CLI debug_level=3 etm=0" \ |
| 2376 | 0 \ |
| 2377 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2378 | -S "found encrypt then mac extension" \ |
| 2379 | -S "server hello, adding encrypt then mac extension" \ |
| 2380 | -C "found encrypt_then_mac extension" \ |
| 2381 | -C "using encrypt then mac" \ |
| 2382 | -S "using encrypt then mac" |
| 2383 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2384 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2385 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2386 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2387 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2388 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2389 | 0 \ |
| 2390 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2391 | -S "found encrypt then mac extension" \ |
| 2392 | -S "server hello, adding encrypt then mac extension" \ |
| 2393 | -C "found encrypt_then_mac extension" \ |
| 2394 | -C "using encrypt then mac" \ |
| 2395 | -S "using encrypt then mac" |
| 2396 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2397 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2398 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2399 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2400 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2401 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2402 | 0 \ |
| 2403 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2404 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2405 | -S "server hello, adding encrypt then mac extension" \ |
| 2406 | -C "found encrypt_then_mac extension" \ |
| 2407 | -C "using encrypt then mac" \ |
| 2408 | -S "using encrypt then mac" |
| 2409 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2410 | # Tests for Extended Master Secret extension |
| 2411 | |
| 2412 | run_test "Extended Master Secret: default" \ |
| 2413 | "$P_SRV debug_level=3" \ |
| 2414 | "$P_CLI debug_level=3" \ |
| 2415 | 0 \ |
| 2416 | -c "client hello, adding extended_master_secret extension" \ |
| 2417 | -s "found extended master secret extension" \ |
| 2418 | -s "server hello, adding extended master secret extension" \ |
| 2419 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2420 | -c "session hash for extended master secret" \ |
| 2421 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2422 | |
| 2423 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2424 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2425 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2426 | 0 \ |
| 2427 | -c "client hello, adding extended_master_secret extension" \ |
| 2428 | -s "found extended master secret extension" \ |
| 2429 | -S "server hello, adding extended master secret extension" \ |
| 2430 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2431 | -C "session hash for extended master secret" \ |
| 2432 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2433 | |
| 2434 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2435 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2436 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2437 | 0 \ |
| 2438 | -C "client hello, adding extended_master_secret extension" \ |
| 2439 | -S "found extended master secret extension" \ |
| 2440 | -S "server hello, adding extended master secret extension" \ |
| 2441 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2442 | -C "session hash for extended master secret" \ |
| 2443 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2444 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2445 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2446 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2447 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2448 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2449 | 0 \ |
| 2450 | -C "client hello, adding extended_master_secret extension" \ |
| 2451 | -S "found extended master secret extension" \ |
| 2452 | -S "server hello, adding extended master secret extension" \ |
| 2453 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2454 | -C "session hash for extended master secret" \ |
| 2455 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2456 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2457 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2458 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2459 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2460 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2461 | 0 \ |
| 2462 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2463 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2464 | -S "server hello, adding extended master secret extension" \ |
| 2465 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2466 | -C "session hash for extended master secret" \ |
| 2467 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2468 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2469 | # Tests for FALLBACK_SCSV |
| 2470 | |
| 2471 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2472 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2473 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2474 | 0 \ |
| 2475 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2476 | -S "received FALLBACK_SCSV" \ |
| 2477 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2478 | -C "is a fatal alert message (msg 86)" |
| 2479 | |
| 2480 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2481 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2482 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2483 | 0 \ |
| 2484 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2485 | -S "received FALLBACK_SCSV" \ |
| 2486 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2487 | -C "is a fatal alert message (msg 86)" |
| 2488 | |
| 2489 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2490 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2491 | "$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] | 2492 | 1 \ |
| 2493 | -c "adding FALLBACK_SCSV" \ |
| 2494 | -s "received FALLBACK_SCSV" \ |
| 2495 | -s "inapropriate fallback" \ |
| 2496 | -c "is a fatal alert message (msg 86)" |
| 2497 | |
| 2498 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2499 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2500 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2501 | 0 \ |
| 2502 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2503 | -s "received FALLBACK_SCSV" \ |
| 2504 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2505 | -C "is a fatal alert message (msg 86)" |
| 2506 | |
| 2507 | requires_openssl_with_fallback_scsv |
| 2508 | run_test "Fallback SCSV: default, openssl server" \ |
| 2509 | "$O_SRV" \ |
| 2510 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2511 | 0 \ |
| 2512 | -C "adding FALLBACK_SCSV" \ |
| 2513 | -C "is a fatal alert message (msg 86)" |
| 2514 | |
| 2515 | requires_openssl_with_fallback_scsv |
| 2516 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2517 | "$O_SRV" \ |
| 2518 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2519 | 1 \ |
| 2520 | -c "adding FALLBACK_SCSV" \ |
| 2521 | -c "is a fatal alert message (msg 86)" |
| 2522 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2523 | requires_openssl_with_fallback_scsv |
| 2524 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2525 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2526 | "$O_CLI -tls1_1" \ |
| 2527 | 0 \ |
| 2528 | -S "received FALLBACK_SCSV" \ |
| 2529 | -S "inapropriate fallback" |
| 2530 | |
| 2531 | requires_openssl_with_fallback_scsv |
| 2532 | run_test "Fallback SCSV: enabled, 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 -fallback_scsv" \ |
| 2535 | 1 \ |
| 2536 | -s "received FALLBACK_SCSV" \ |
| 2537 | -s "inapropriate fallback" |
| 2538 | |
| 2539 | requires_openssl_with_fallback_scsv |
| 2540 | run_test "Fallback SCSV: enabled, max version, 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 -fallback_scsv" \ |
| 2543 | 0 \ |
| 2544 | -s "received FALLBACK_SCSV" \ |
| 2545 | -S "inapropriate fallback" |
| 2546 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2547 | # Test sending and receiving empty application data records |
| 2548 | |
| 2549 | run_test "Encrypt then MAC: empty application data record" \ |
| 2550 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2551 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2552 | 0 \ |
| 2553 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2554 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2555 | -c "0 bytes written in 1 fragments" |
| 2556 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2557 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2558 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2559 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2560 | 0 \ |
| 2561 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2562 | -c "0 bytes written in 1 fragments" |
| 2563 | |
| 2564 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2565 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2566 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2567 | 0 \ |
| 2568 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2569 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2570 | -c "0 bytes written in 1 fragments" |
| 2571 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2572 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2573 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2574 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2575 | 0 \ |
| 2576 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2577 | -c "0 bytes written in 1 fragments" |
| 2578 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2579 | ## ClientHello generated with |
| 2580 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2581 | ## then manually twiddling the ciphersuite list. |
| 2582 | ## The ClientHello content is spelled out below as a hex string as |
| 2583 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2584 | ## The expected response is an inappropriate_fallback alert. |
| 2585 | requires_openssl_with_fallback_scsv |
| 2586 | run_test "Fallback SCSV: beginning of list" \ |
| 2587 | "$P_SRV debug_level=2" \ |
| 2588 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2589 | 0 \ |
| 2590 | -s "received FALLBACK_SCSV" \ |
| 2591 | -s "inapropriate fallback" |
| 2592 | |
| 2593 | requires_openssl_with_fallback_scsv |
| 2594 | run_test "Fallback SCSV: end of list" \ |
| 2595 | "$P_SRV debug_level=2" \ |
| 2596 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2597 | 0 \ |
| 2598 | -s "received FALLBACK_SCSV" \ |
| 2599 | -s "inapropriate fallback" |
| 2600 | |
| 2601 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2602 | requires_openssl_with_fallback_scsv |
| 2603 | run_test "Fallback SCSV: not in list" \ |
| 2604 | "$P_SRV debug_level=2" \ |
| 2605 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2606 | 0 \ |
| 2607 | -S "received FALLBACK_SCSV" \ |
| 2608 | -S "inapropriate fallback" |
| 2609 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2610 | # Tests for CBC 1/n-1 record splitting |
| 2611 | |
| 2612 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2613 | "$P_SRV" \ |
| 2614 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2615 | request_size=123 force_version=tls1_2" \ |
| 2616 | 0 \ |
| 2617 | -s "Read from client: 123 bytes read" \ |
| 2618 | -S "Read from client: 1 bytes read" \ |
| 2619 | -S "122 bytes read" |
| 2620 | |
| 2621 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2622 | "$P_SRV" \ |
| 2623 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2624 | request_size=123 force_version=tls1_1" \ |
| 2625 | 0 \ |
| 2626 | -s "Read from client: 123 bytes read" \ |
| 2627 | -S "Read from client: 1 bytes read" \ |
| 2628 | -S "122 bytes read" |
| 2629 | |
| 2630 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2631 | "$P_SRV" \ |
| 2632 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2633 | request_size=123 force_version=tls1" \ |
| 2634 | 0 \ |
| 2635 | -S "Read from client: 123 bytes read" \ |
| 2636 | -s "Read from client: 1 bytes read" \ |
| 2637 | -s "122 bytes read" |
| 2638 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2639 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2640 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2641 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2642 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2643 | request_size=123 force_version=ssl3" \ |
| 2644 | 0 \ |
| 2645 | -S "Read from client: 123 bytes read" \ |
| 2646 | -s "Read from client: 1 bytes read" \ |
| 2647 | -s "122 bytes read" |
| 2648 | |
| 2649 | 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] | 2650 | "$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] | 2651 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2652 | request_size=123 force_version=tls1" \ |
| 2653 | 0 \ |
| 2654 | -s "Read from client: 123 bytes read" \ |
| 2655 | -S "Read from client: 1 bytes read" \ |
| 2656 | -S "122 bytes read" |
| 2657 | |
| 2658 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2659 | "$P_SRV" \ |
| 2660 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2661 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2662 | 0 \ |
| 2663 | -s "Read from client: 123 bytes read" \ |
| 2664 | -S "Read from client: 1 bytes read" \ |
| 2665 | -S "122 bytes read" |
| 2666 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2667 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2668 | "$P_SRV nbio=2" \ |
| 2669 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2670 | request_size=123 force_version=tls1" \ |
| 2671 | 0 \ |
| 2672 | -S "Read from client: 123 bytes read" \ |
| 2673 | -s "Read from client: 1 bytes read" \ |
| 2674 | -s "122 bytes read" |
| 2675 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2676 | # Tests for Session Tickets |
| 2677 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2678 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2679 | "$P_SRV debug_level=3 tickets=1" \ |
| 2680 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2681 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2682 | -c "client hello, adding session ticket extension" \ |
| 2683 | -s "found session ticket extension" \ |
| 2684 | -s "server hello, adding session ticket extension" \ |
| 2685 | -c "found session_ticket extension" \ |
| 2686 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2687 | -S "session successfully restored from cache" \ |
| 2688 | -s "session successfully restored from ticket" \ |
| 2689 | -s "a session has been resumed" \ |
| 2690 | -c "a session has been resumed" |
| 2691 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2692 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2693 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2694 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2695 | 0 \ |
| 2696 | -c "client hello, adding session ticket extension" \ |
| 2697 | -s "found session ticket extension" \ |
| 2698 | -s "server hello, adding session ticket extension" \ |
| 2699 | -c "found session_ticket extension" \ |
| 2700 | -c "parse new session ticket" \ |
| 2701 | -S "session successfully restored from cache" \ |
| 2702 | -s "session successfully restored from ticket" \ |
| 2703 | -s "a session has been resumed" \ |
| 2704 | -c "a session has been resumed" |
| 2705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2706 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2707 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2708 | "$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] | 2709 | 0 \ |
| 2710 | -c "client hello, adding session ticket extension" \ |
| 2711 | -s "found session ticket extension" \ |
| 2712 | -s "server hello, adding session ticket extension" \ |
| 2713 | -c "found session_ticket extension" \ |
| 2714 | -c "parse new session ticket" \ |
| 2715 | -S "session successfully restored from cache" \ |
| 2716 | -S "session successfully restored from ticket" \ |
| 2717 | -S "a session has been resumed" \ |
| 2718 | -C "a session has been resumed" |
| 2719 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2720 | run_test "Session resume using tickets: session copy" \ |
| 2721 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2722 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2723 | 0 \ |
| 2724 | -c "client hello, adding session ticket extension" \ |
| 2725 | -s "found session ticket extension" \ |
| 2726 | -s "server hello, adding session ticket extension" \ |
| 2727 | -c "found session_ticket extension" \ |
| 2728 | -c "parse new session ticket" \ |
| 2729 | -S "session successfully restored from cache" \ |
| 2730 | -s "session successfully restored from ticket" \ |
| 2731 | -s "a session has been resumed" \ |
| 2732 | -c "a session has been resumed" |
| 2733 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2734 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2735 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2736 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2737 | 0 \ |
| 2738 | -c "client hello, adding session ticket extension" \ |
| 2739 | -c "found session_ticket extension" \ |
| 2740 | -c "parse new session ticket" \ |
| 2741 | -c "a session has been resumed" |
| 2742 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2743 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2744 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2745 | "( $O_CLI -sess_out $SESSION; \ |
| 2746 | $O_CLI -sess_in $SESSION; \ |
| 2747 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2748 | 0 \ |
| 2749 | -s "found session ticket extension" \ |
| 2750 | -s "server hello, adding session ticket extension" \ |
| 2751 | -S "session successfully restored from cache" \ |
| 2752 | -s "session successfully restored from ticket" \ |
| 2753 | -s "a session has been resumed" |
| 2754 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2755 | # Tests for Session Tickets with DTLS |
| 2756 | |
| 2757 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2758 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2759 | "$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] | 2760 | 0 \ |
| 2761 | -c "client hello, adding session ticket extension" \ |
| 2762 | -s "found session ticket extension" \ |
| 2763 | -s "server hello, adding session ticket extension" \ |
| 2764 | -c "found session_ticket extension" \ |
| 2765 | -c "parse new session ticket" \ |
| 2766 | -S "session successfully restored from cache" \ |
| 2767 | -s "session successfully restored from ticket" \ |
| 2768 | -s "a session has been resumed" \ |
| 2769 | -c "a session has been resumed" |
| 2770 | |
| 2771 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2772 | "$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] | 2773 | "$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] | 2774 | 0 \ |
| 2775 | -c "client hello, adding session ticket extension" \ |
| 2776 | -s "found session ticket extension" \ |
| 2777 | -s "server hello, adding session ticket extension" \ |
| 2778 | -c "found session_ticket extension" \ |
| 2779 | -c "parse new session ticket" \ |
| 2780 | -S "session successfully restored from cache" \ |
| 2781 | -s "session successfully restored from ticket" \ |
| 2782 | -s "a session has been resumed" \ |
| 2783 | -c "a session has been resumed" |
| 2784 | |
| 2785 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2786 | "$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] | 2787 | "$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] | 2788 | 0 \ |
| 2789 | -c "client hello, adding session ticket extension" \ |
| 2790 | -s "found session ticket extension" \ |
| 2791 | -s "server hello, adding session ticket extension" \ |
| 2792 | -c "found session_ticket extension" \ |
| 2793 | -c "parse new session ticket" \ |
| 2794 | -S "session successfully restored from cache" \ |
| 2795 | -S "session successfully restored from ticket" \ |
| 2796 | -S "a session has been resumed" \ |
| 2797 | -C "a session has been resumed" |
| 2798 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2799 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2800 | "$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] | 2801 | "$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] | 2802 | 0 \ |
| 2803 | -c "client hello, adding session ticket extension" \ |
| 2804 | -s "found session ticket extension" \ |
| 2805 | -s "server hello, adding session ticket extension" \ |
| 2806 | -c "found session_ticket extension" \ |
| 2807 | -c "parse new session ticket" \ |
| 2808 | -S "session successfully restored from cache" \ |
| 2809 | -s "session successfully restored from ticket" \ |
| 2810 | -s "a session has been resumed" \ |
| 2811 | -c "a session has been resumed" |
| 2812 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2813 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2814 | "$O_SRV -dtls1" \ |
| 2815 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2816 | 0 \ |
| 2817 | -c "client hello, adding session ticket extension" \ |
| 2818 | -c "found session_ticket extension" \ |
| 2819 | -c "parse new session ticket" \ |
| 2820 | -c "a session has been resumed" |
| 2821 | |
| 2822 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2823 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2824 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2825 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2826 | rm -f $SESSION )" \ |
| 2827 | 0 \ |
| 2828 | -s "found session ticket extension" \ |
| 2829 | -s "server hello, adding session ticket extension" \ |
| 2830 | -S "session successfully restored from cache" \ |
| 2831 | -s "session successfully restored from ticket" \ |
| 2832 | -s "a session has been resumed" |
| 2833 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2834 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2835 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2836 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2837 | "$P_SRV debug_level=3 tickets=0" \ |
| 2838 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2839 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2840 | -c "client hello, adding session ticket extension" \ |
| 2841 | -s "found session ticket extension" \ |
| 2842 | -S "server hello, adding session ticket extension" \ |
| 2843 | -C "found session_ticket extension" \ |
| 2844 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2845 | -s "session successfully restored from cache" \ |
| 2846 | -S "session successfully restored from ticket" \ |
| 2847 | -s "a session has been resumed" \ |
| 2848 | -c "a session has been resumed" |
| 2849 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2850 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2851 | "$P_SRV debug_level=3 tickets=1" \ |
| 2852 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2853 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2854 | -C "client hello, adding session ticket extension" \ |
| 2855 | -S "found session ticket extension" \ |
| 2856 | -S "server hello, adding session ticket extension" \ |
| 2857 | -C "found session_ticket extension" \ |
| 2858 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2859 | -s "session successfully restored from cache" \ |
| 2860 | -S "session successfully restored from ticket" \ |
| 2861 | -s "a session has been resumed" \ |
| 2862 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2863 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2864 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2865 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2866 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2867 | 0 \ |
| 2868 | -S "session successfully restored from cache" \ |
| 2869 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2870 | -S "a session has been resumed" \ |
| 2871 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2872 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2873 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2874 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2875 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2876 | 0 \ |
| 2877 | -s "session successfully restored from cache" \ |
| 2878 | -S "session successfully restored from ticket" \ |
| 2879 | -s "a session has been resumed" \ |
| 2880 | -c "a session has been resumed" |
| 2881 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2882 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2883 | "$P_SRV debug_level=3 tickets=0" \ |
| 2884 | "$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] | 2885 | 0 \ |
| 2886 | -s "session successfully restored from cache" \ |
| 2887 | -S "session successfully restored from ticket" \ |
| 2888 | -s "a session has been resumed" \ |
| 2889 | -c "a session has been resumed" |
| 2890 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2891 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2892 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2893 | "$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] | 2894 | 0 \ |
| 2895 | -S "session successfully restored from cache" \ |
| 2896 | -S "session successfully restored from ticket" \ |
| 2897 | -S "a session has been resumed" \ |
| 2898 | -C "a session has been resumed" |
| 2899 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2900 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2901 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2902 | "$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] | 2903 | 0 \ |
| 2904 | -s "session successfully restored from cache" \ |
| 2905 | -S "session successfully restored from ticket" \ |
| 2906 | -s "a session has been resumed" \ |
| 2907 | -c "a session has been resumed" |
| 2908 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2909 | run_test "Session resume using cache: session copy" \ |
| 2910 | "$P_SRV debug_level=3 tickets=0" \ |
| 2911 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2912 | 0 \ |
| 2913 | -s "session successfully restored from cache" \ |
| 2914 | -S "session successfully restored from ticket" \ |
| 2915 | -s "a session has been resumed" \ |
| 2916 | -c "a session has been resumed" |
| 2917 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2918 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2919 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2920 | "( $O_CLI -sess_out $SESSION; \ |
| 2921 | $O_CLI -sess_in $SESSION; \ |
| 2922 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2923 | 0 \ |
| 2924 | -s "found session ticket extension" \ |
| 2925 | -S "server hello, adding session ticket extension" \ |
| 2926 | -s "session successfully restored from cache" \ |
| 2927 | -S "session successfully restored from ticket" \ |
| 2928 | -s "a session has been resumed" |
| 2929 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2930 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2931 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2932 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2933 | 0 \ |
| 2934 | -C "found session_ticket extension" \ |
| 2935 | -C "parse new session ticket" \ |
| 2936 | -c "a session has been resumed" |
| 2937 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2938 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2939 | |
| 2940 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2941 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2942 | "$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] | 2943 | 0 \ |
| 2944 | -c "client hello, adding session ticket extension" \ |
| 2945 | -s "found session ticket extension" \ |
| 2946 | -S "server hello, adding session ticket extension" \ |
| 2947 | -C "found session_ticket extension" \ |
| 2948 | -C "parse new session ticket" \ |
| 2949 | -s "session successfully restored from cache" \ |
| 2950 | -S "session successfully restored from ticket" \ |
| 2951 | -s "a session has been resumed" \ |
| 2952 | -c "a session has been resumed" |
| 2953 | |
| 2954 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2955 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2956 | "$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] | 2957 | 0 \ |
| 2958 | -C "client hello, adding session ticket extension" \ |
| 2959 | -S "found session ticket extension" \ |
| 2960 | -S "server hello, adding session ticket extension" \ |
| 2961 | -C "found session_ticket extension" \ |
| 2962 | -C "parse new session ticket" \ |
| 2963 | -s "session successfully restored from cache" \ |
| 2964 | -S "session successfully restored from ticket" \ |
| 2965 | -s "a session has been resumed" \ |
| 2966 | -c "a session has been resumed" |
| 2967 | |
| 2968 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2969 | "$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] | 2970 | "$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] | 2971 | 0 \ |
| 2972 | -S "session successfully restored from cache" \ |
| 2973 | -S "session successfully restored from ticket" \ |
| 2974 | -S "a session has been resumed" \ |
| 2975 | -C "a session has been resumed" |
| 2976 | |
| 2977 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2978 | "$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] | 2979 | "$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] | 2980 | 0 \ |
| 2981 | -s "session successfully restored from cache" \ |
| 2982 | -S "session successfully restored from ticket" \ |
| 2983 | -s "a session has been resumed" \ |
| 2984 | -c "a session has been resumed" |
| 2985 | |
| 2986 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2987 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2988 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=0" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2989 | 0 \ |
| 2990 | -s "session successfully restored from cache" \ |
| 2991 | -S "session successfully restored from ticket" \ |
| 2992 | -s "a session has been resumed" \ |
| 2993 | -c "a session has been resumed" |
| 2994 | |
| 2995 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2996 | "$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] | 2997 | "$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] | 2998 | 0 \ |
| 2999 | -S "session successfully restored from cache" \ |
| 3000 | -S "session successfully restored from ticket" \ |
| 3001 | -S "a session has been resumed" \ |
| 3002 | -C "a session has been resumed" |
| 3003 | |
| 3004 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3005 | "$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] | 3006 | "$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] | 3007 | 0 \ |
| 3008 | -s "session successfully restored from cache" \ |
| 3009 | -S "session successfully restored from ticket" \ |
| 3010 | -s "a session has been resumed" \ |
| 3011 | -c "a session has been resumed" |
| 3012 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3013 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3014 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3015 | "$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] | 3016 | 0 \ |
| 3017 | -s "session successfully restored from cache" \ |
| 3018 | -S "session successfully restored from ticket" \ |
| 3019 | -s "a session has been resumed" \ |
| 3020 | -c "a session has been resumed" |
| 3021 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3022 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3023 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 3024 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 3025 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 3026 | rm -f $SESSION )" \ |
| 3027 | 0 \ |
| 3028 | -s "found session ticket extension" \ |
| 3029 | -S "server hello, adding session ticket extension" \ |
| 3030 | -s "session successfully restored from cache" \ |
| 3031 | -S "session successfully restored from ticket" \ |
| 3032 | -s "a session has been resumed" |
| 3033 | |
| 3034 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3035 | "$O_SRV -dtls1" \ |
| 3036 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3037 | 0 \ |
| 3038 | -C "found session_ticket extension" \ |
| 3039 | -C "parse new session ticket" \ |
| 3040 | -c "a session has been resumed" |
| 3041 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3042 | # Tests for Max Fragment Length extension |
| 3043 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3044 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 3045 | printf "${CONFIG_H} defines MBEDTLS_SSL_MAX_CONTENT_LEN to be less than 4096. Fragment length tests will fail.\n" |
Hanno Becker | 6428f8d | 2017-09-22 16:58:50 +0100 | [diff] [blame] | 3046 | exit 1 |
| 3047 | fi |
| 3048 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3049 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 3050 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 3051 | fi |
| 3052 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3053 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3054 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3055 | "$P_SRV debug_level=3" \ |
| 3056 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3057 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3058 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3059 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3060 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3061 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3062 | -C "client hello, adding max_fragment_length extension" \ |
| 3063 | -S "found max fragment length extension" \ |
| 3064 | -S "server hello, max_fragment_length extension" \ |
| 3065 | -C "found max_fragment_length extension" |
| 3066 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3067 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3068 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3069 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3070 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3071 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3072 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3073 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3074 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3075 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3076 | -C "client hello, adding max_fragment_length extension" \ |
| 3077 | -S "found max fragment length extension" \ |
| 3078 | -S "server hello, max_fragment_length extension" \ |
| 3079 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3080 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3081 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3082 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3083 | |
| 3084 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3085 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3086 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3087 | "$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] | 3088 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3089 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3090 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3091 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3092 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3093 | -C "client hello, adding max_fragment_length extension" \ |
| 3094 | -S "found max fragment length extension" \ |
| 3095 | -S "server hello, max_fragment_length extension" \ |
| 3096 | -C "found max_fragment_length extension" \ |
| 3097 | -c "fragment larger than.*maximum " |
| 3098 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3099 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3100 | # (session fragment length will be 16384 regardless of mbedtls |
| 3101 | # content length configuration.) |
| 3102 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3103 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3104 | run_test "Max fragment length: disabled, larger message" \ |
| 3105 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3106 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3107 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3108 | -C "Maximum input fragment length is 16384" \ |
| 3109 | -C "Maximum output fragment length is 16384" \ |
| 3110 | -S "Maximum input fragment length is 16384" \ |
| 3111 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3112 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3113 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3114 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3115 | |
| 3116 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3117 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 3118 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3119 | "$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] | 3120 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3121 | -C "Maximum input fragment length is 16384" \ |
| 3122 | -C "Maximum output fragment length is 16384" \ |
| 3123 | -S "Maximum input fragment length is 16384" \ |
| 3124 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3125 | -c "fragment larger than.*maximum " |
| 3126 | |
| 3127 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3128 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3129 | "$P_SRV debug_level=3" \ |
| 3130 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3131 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3132 | -c "Maximum input fragment length is 4096" \ |
| 3133 | -c "Maximum output fragment length is 4096" \ |
| 3134 | -s "Maximum input fragment length is 4096" \ |
| 3135 | -s "Maximum output fragment length is 4096" \ |
| 3136 | -c "client hello, adding max_fragment_length extension" \ |
| 3137 | -s "found max fragment length extension" \ |
| 3138 | -s "server hello, max_fragment_length extension" \ |
| 3139 | -c "found max_fragment_length extension" |
| 3140 | |
| 3141 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3142 | run_test "Max fragment length: client 512, server 1024" \ |
| 3143 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3144 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3145 | 0 \ |
| 3146 | -c "Maximum input fragment length is 512" \ |
| 3147 | -c "Maximum output fragment length is 512" \ |
| 3148 | -s "Maximum input fragment length is 512" \ |
| 3149 | -s "Maximum output fragment length is 512" \ |
| 3150 | -c "client hello, adding max_fragment_length extension" \ |
| 3151 | -s "found max fragment length extension" \ |
| 3152 | -s "server hello, max_fragment_length extension" \ |
| 3153 | -c "found max_fragment_length extension" |
| 3154 | |
| 3155 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3156 | run_test "Max fragment length: client 512, server 2048" \ |
| 3157 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3158 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3159 | 0 \ |
| 3160 | -c "Maximum input fragment length is 512" \ |
| 3161 | -c "Maximum output fragment length is 512" \ |
| 3162 | -s "Maximum input fragment length is 512" \ |
| 3163 | -s "Maximum output fragment length is 512" \ |
| 3164 | -c "client hello, adding max_fragment_length extension" \ |
| 3165 | -s "found max fragment length extension" \ |
| 3166 | -s "server hello, max_fragment_length extension" \ |
| 3167 | -c "found max_fragment_length extension" |
| 3168 | |
| 3169 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3170 | run_test "Max fragment length: client 512, server 4096" \ |
| 3171 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3172 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3173 | 0 \ |
| 3174 | -c "Maximum input fragment length is 512" \ |
| 3175 | -c "Maximum output fragment length is 512" \ |
| 3176 | -s "Maximum input fragment length is 512" \ |
| 3177 | -s "Maximum output fragment length is 512" \ |
| 3178 | -c "client hello, adding max_fragment_length extension" \ |
| 3179 | -s "found max fragment length extension" \ |
| 3180 | -s "server hello, max_fragment_length extension" \ |
| 3181 | -c "found max_fragment_length extension" |
| 3182 | |
| 3183 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3184 | run_test "Max fragment length: client 1024, server 512" \ |
| 3185 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3186 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3187 | 0 \ |
| 3188 | -c "Maximum input fragment length is 1024" \ |
| 3189 | -c "Maximum output fragment length is 1024" \ |
| 3190 | -s "Maximum input fragment length is 1024" \ |
| 3191 | -s "Maximum output fragment length is 512" \ |
| 3192 | -c "client hello, adding max_fragment_length extension" \ |
| 3193 | -s "found max fragment length extension" \ |
| 3194 | -s "server hello, max_fragment_length extension" \ |
| 3195 | -c "found max_fragment_length extension" |
| 3196 | |
| 3197 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3198 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3199 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3200 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3201 | 0 \ |
| 3202 | -c "Maximum input fragment length is 1024" \ |
| 3203 | -c "Maximum output fragment length is 1024" \ |
| 3204 | -s "Maximum input fragment length is 1024" \ |
| 3205 | -s "Maximum output fragment length is 1024" \ |
| 3206 | -c "client hello, adding max_fragment_length extension" \ |
| 3207 | -s "found max fragment length extension" \ |
| 3208 | -s "server hello, max_fragment_length extension" \ |
| 3209 | -c "found max_fragment_length extension" |
| 3210 | |
| 3211 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3212 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3213 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3214 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3215 | 0 \ |
| 3216 | -c "Maximum input fragment length is 1024" \ |
| 3217 | -c "Maximum output fragment length is 1024" \ |
| 3218 | -s "Maximum input fragment length is 1024" \ |
| 3219 | -s "Maximum output fragment length is 1024" \ |
| 3220 | -c "client hello, adding max_fragment_length extension" \ |
| 3221 | -s "found max fragment length extension" \ |
| 3222 | -s "server hello, max_fragment_length extension" \ |
| 3223 | -c "found max_fragment_length extension" |
| 3224 | |
| 3225 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3226 | run_test "Max fragment length: client 2048, server 512" \ |
| 3227 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3228 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3229 | 0 \ |
| 3230 | -c "Maximum input fragment length is 2048" \ |
| 3231 | -c "Maximum output fragment length is 2048" \ |
| 3232 | -s "Maximum input fragment length is 2048" \ |
| 3233 | -s "Maximum output fragment length is 512" \ |
| 3234 | -c "client hello, adding max_fragment_length extension" \ |
| 3235 | -s "found max fragment length extension" \ |
| 3236 | -s "server hello, max_fragment_length extension" \ |
| 3237 | -c "found max_fragment_length extension" |
| 3238 | |
| 3239 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3240 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3241 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3242 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3243 | 0 \ |
| 3244 | -c "Maximum input fragment length is 2048" \ |
| 3245 | -c "Maximum output fragment length is 2048" \ |
| 3246 | -s "Maximum input fragment length is 2048" \ |
| 3247 | -s "Maximum output fragment length is 1024" \ |
| 3248 | -c "client hello, adding max_fragment_length extension" \ |
| 3249 | -s "found max fragment length extension" \ |
| 3250 | -s "server hello, max_fragment_length extension" \ |
| 3251 | -c "found max_fragment_length extension" |
| 3252 | |
| 3253 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3254 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3255 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3256 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3257 | 0 \ |
| 3258 | -c "Maximum input fragment length is 2048" \ |
| 3259 | -c "Maximum output fragment length is 2048" \ |
| 3260 | -s "Maximum input fragment length is 2048" \ |
| 3261 | -s "Maximum output fragment length is 2048" \ |
| 3262 | -c "client hello, adding max_fragment_length extension" \ |
| 3263 | -s "found max fragment length extension" \ |
| 3264 | -s "server hello, max_fragment_length extension" \ |
| 3265 | -c "found max_fragment_length extension" |
| 3266 | |
| 3267 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3268 | run_test "Max fragment length: client 4096, server 512" \ |
| 3269 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3270 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3271 | 0 \ |
| 3272 | -c "Maximum input fragment length is 4096" \ |
| 3273 | -c "Maximum output fragment length is 4096" \ |
| 3274 | -s "Maximum input fragment length is 4096" \ |
| 3275 | -s "Maximum output fragment length is 512" \ |
| 3276 | -c "client hello, adding max_fragment_length extension" \ |
| 3277 | -s "found max fragment length extension" \ |
| 3278 | -s "server hello, max_fragment_length extension" \ |
| 3279 | -c "found max_fragment_length extension" |
| 3280 | |
| 3281 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3282 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3283 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3284 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3285 | 0 \ |
| 3286 | -c "Maximum input fragment length is 4096" \ |
| 3287 | -c "Maximum output fragment length is 4096" \ |
| 3288 | -s "Maximum input fragment length is 4096" \ |
| 3289 | -s "Maximum output fragment length is 1024" \ |
| 3290 | -c "client hello, adding max_fragment_length extension" \ |
| 3291 | -s "found max fragment length extension" \ |
| 3292 | -s "server hello, max_fragment_length extension" \ |
| 3293 | -c "found max_fragment_length extension" |
| 3294 | |
| 3295 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3296 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3297 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3298 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3299 | 0 \ |
| 3300 | -c "Maximum input fragment length is 4096" \ |
| 3301 | -c "Maximum output fragment length is 4096" \ |
| 3302 | -s "Maximum input fragment length is 4096" \ |
| 3303 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3304 | -c "client hello, adding max_fragment_length extension" \ |
| 3305 | -s "found max fragment length extension" \ |
| 3306 | -s "server hello, max_fragment_length extension" \ |
| 3307 | -c "found max_fragment_length extension" |
| 3308 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3309 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3310 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3311 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3312 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3313 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3314 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3315 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3316 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3317 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3318 | -C "client hello, adding max_fragment_length extension" \ |
| 3319 | -S "found max fragment length extension" \ |
| 3320 | -S "server hello, max_fragment_length extension" \ |
| 3321 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3322 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3323 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3324 | requires_gnutls |
| 3325 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3326 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3327 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3328 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3329 | -c "Maximum input fragment length is 4096" \ |
| 3330 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3331 | -c "client hello, adding max_fragment_length extension" \ |
| 3332 | -c "found max_fragment_length extension" |
| 3333 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3334 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3335 | run_test "Max fragment length: client, message just fits" \ |
| 3336 | "$P_SRV debug_level=3" \ |
| 3337 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3338 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3339 | -c "Maximum input fragment length is 2048" \ |
| 3340 | -c "Maximum output fragment length is 2048" \ |
| 3341 | -s "Maximum input fragment length is 2048" \ |
| 3342 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3343 | -c "client hello, adding max_fragment_length extension" \ |
| 3344 | -s "found max fragment length extension" \ |
| 3345 | -s "server hello, max_fragment_length extension" \ |
| 3346 | -c "found max_fragment_length extension" \ |
| 3347 | -c "2048 bytes written in 1 fragments" \ |
| 3348 | -s "2048 bytes read" |
| 3349 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3350 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3351 | run_test "Max fragment length: client, larger message" \ |
| 3352 | "$P_SRV debug_level=3" \ |
| 3353 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3354 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3355 | -c "Maximum input fragment length is 2048" \ |
| 3356 | -c "Maximum output fragment length is 2048" \ |
| 3357 | -s "Maximum input fragment length is 2048" \ |
| 3358 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3359 | -c "client hello, adding max_fragment_length extension" \ |
| 3360 | -s "found max fragment length extension" \ |
| 3361 | -s "server hello, max_fragment_length extension" \ |
| 3362 | -c "found max_fragment_length extension" \ |
| 3363 | -c "2345 bytes written in 2 fragments" \ |
| 3364 | -s "2048 bytes read" \ |
| 3365 | -s "297 bytes read" |
| 3366 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3367 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3368 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3369 | "$P_SRV debug_level=3 dtls=1" \ |
| 3370 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3371 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3372 | -c "Maximum input fragment length is 2048" \ |
| 3373 | -c "Maximum output fragment length is 2048" \ |
| 3374 | -s "Maximum input fragment length is 2048" \ |
| 3375 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3376 | -c "client hello, adding max_fragment_length extension" \ |
| 3377 | -s "found max fragment length extension" \ |
| 3378 | -s "server hello, max_fragment_length extension" \ |
| 3379 | -c "found max_fragment_length extension" \ |
| 3380 | -c "fragment larger than.*maximum" |
| 3381 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3382 | # Tests for renegotiation |
| 3383 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3384 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3385 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3386 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3387 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3388 | 0 \ |
| 3389 | -C "client hello, adding renegotiation extension" \ |
| 3390 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3391 | -S "found renegotiation extension" \ |
| 3392 | -s "server hello, secure renegotiation extension" \ |
| 3393 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3394 | -C "=> renegotiate" \ |
| 3395 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3396 | -S "write hello request" |
| 3397 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3398 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3399 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3400 | "$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] | 3401 | "$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] | 3402 | 0 \ |
| 3403 | -c "client hello, adding renegotiation extension" \ |
| 3404 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3405 | -s "found renegotiation extension" \ |
| 3406 | -s "server hello, secure renegotiation extension" \ |
| 3407 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3408 | -c "=> renegotiate" \ |
| 3409 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3410 | -S "write hello request" |
| 3411 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3412 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3413 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3414 | "$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] | 3415 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3416 | 0 \ |
| 3417 | -c "client hello, adding renegotiation extension" \ |
| 3418 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3419 | -s "found renegotiation extension" \ |
| 3420 | -s "server hello, secure renegotiation extension" \ |
| 3421 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3422 | -c "=> renegotiate" \ |
| 3423 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3424 | -s "write hello request" |
| 3425 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3426 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3427 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3428 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3429 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3430 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3431 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3432 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3433 | 0 \ |
| 3434 | -c "client hello, adding renegotiation extension" \ |
| 3435 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3436 | -s "found renegotiation extension" \ |
| 3437 | -s "server hello, secure renegotiation extension" \ |
| 3438 | -c "found renegotiation extension" \ |
| 3439 | -c "=> renegotiate" \ |
| 3440 | -s "=> renegotiate" \ |
| 3441 | -S "write hello request" \ |
| 3442 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3443 | |
| 3444 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3445 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3446 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3447 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3448 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3449 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3450 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3451 | 0 \ |
| 3452 | -c "client hello, adding renegotiation extension" \ |
| 3453 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3454 | -s "found renegotiation extension" \ |
| 3455 | -s "server hello, secure renegotiation extension" \ |
| 3456 | -c "found renegotiation extension" \ |
| 3457 | -c "=> renegotiate" \ |
| 3458 | -s "=> renegotiate" \ |
| 3459 | -s "write hello request" \ |
| 3460 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3461 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3462 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3463 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3464 | "$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] | 3465 | "$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] | 3466 | 0 \ |
| 3467 | -c "client hello, adding renegotiation extension" \ |
| 3468 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3469 | -s "found renegotiation extension" \ |
| 3470 | -s "server hello, secure renegotiation extension" \ |
| 3471 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3472 | -c "=> renegotiate" \ |
| 3473 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3474 | -s "write hello request" |
| 3475 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3477 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3478 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3479 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3480 | "$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" \ |
| 3481 | 0 \ |
| 3482 | -c "Maximum input fragment length is 2048" \ |
| 3483 | -c "Maximum output fragment length is 2048" \ |
| 3484 | -s "Maximum input fragment length is 2048" \ |
| 3485 | -s "Maximum output fragment length is 512" \ |
| 3486 | -c "client hello, adding max_fragment_length extension" \ |
| 3487 | -s "found max fragment length extension" \ |
| 3488 | -s "server hello, max_fragment_length extension" \ |
| 3489 | -c "found max_fragment_length extension" \ |
| 3490 | -c "client hello, adding renegotiation extension" \ |
| 3491 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3492 | -s "found renegotiation extension" \ |
| 3493 | -s "server hello, secure renegotiation extension" \ |
| 3494 | -c "found renegotiation extension" \ |
| 3495 | -c "=> renegotiate" \ |
| 3496 | -s "=> renegotiate" \ |
| 3497 | -s "write hello request" |
| 3498 | |
| 3499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3500 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3501 | "$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] | 3502 | "$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] | 3503 | 1 \ |
| 3504 | -c "client hello, adding renegotiation extension" \ |
| 3505 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3506 | -S "found renegotiation extension" \ |
| 3507 | -s "server hello, secure renegotiation extension" \ |
| 3508 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3509 | -c "=> renegotiate" \ |
| 3510 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3511 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3512 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3513 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3514 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3515 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3516 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3517 | "$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] | 3518 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3519 | 0 \ |
| 3520 | -C "client hello, adding renegotiation extension" \ |
| 3521 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3522 | -S "found renegotiation extension" \ |
| 3523 | -s "server hello, secure renegotiation extension" \ |
| 3524 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3525 | -C "=> renegotiate" \ |
| 3526 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3527 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3528 | -S "SSL - An unexpected message was received from our peer" \ |
| 3529 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3530 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3531 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3532 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3533 | "$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] | 3534 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3535 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3536 | 0 \ |
| 3537 | -C "client hello, adding renegotiation extension" \ |
| 3538 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3539 | -S "found renegotiation extension" \ |
| 3540 | -s "server hello, secure renegotiation extension" \ |
| 3541 | -c "found renegotiation extension" \ |
| 3542 | -C "=> renegotiate" \ |
| 3543 | -S "=> renegotiate" \ |
| 3544 | -s "write hello request" \ |
| 3545 | -S "SSL - An unexpected message was received from our peer" \ |
| 3546 | -S "failed" |
| 3547 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3548 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3549 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3550 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3551 | "$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] | 3552 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3553 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3554 | 0 \ |
| 3555 | -C "client hello, adding renegotiation extension" \ |
| 3556 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3557 | -S "found renegotiation extension" \ |
| 3558 | -s "server hello, secure renegotiation extension" \ |
| 3559 | -c "found renegotiation extension" \ |
| 3560 | -C "=> renegotiate" \ |
| 3561 | -S "=> renegotiate" \ |
| 3562 | -s "write hello request" \ |
| 3563 | -S "SSL - An unexpected message was received from our peer" \ |
| 3564 | -S "failed" |
| 3565 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3566 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3567 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3568 | "$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] | 3569 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3570 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3571 | 0 \ |
| 3572 | -C "client hello, adding renegotiation extension" \ |
| 3573 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3574 | -S "found renegotiation extension" \ |
| 3575 | -s "server hello, secure renegotiation extension" \ |
| 3576 | -c "found renegotiation extension" \ |
| 3577 | -C "=> renegotiate" \ |
| 3578 | -S "=> renegotiate" \ |
| 3579 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3580 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3581 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3582 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3583 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3584 | "$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] | 3585 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3586 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3587 | 0 \ |
| 3588 | -c "client hello, adding renegotiation extension" \ |
| 3589 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3590 | -s "found renegotiation extension" \ |
| 3591 | -s "server hello, secure renegotiation extension" \ |
| 3592 | -c "found renegotiation extension" \ |
| 3593 | -c "=> renegotiate" \ |
| 3594 | -s "=> renegotiate" \ |
| 3595 | -s "write hello request" \ |
| 3596 | -S "SSL - An unexpected message was received from our peer" \ |
| 3597 | -S "failed" |
| 3598 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3599 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3600 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3601 | "$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] | 3602 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3603 | 0 \ |
| 3604 | -C "client hello, adding renegotiation extension" \ |
| 3605 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3606 | -S "found renegotiation extension" \ |
| 3607 | -s "server hello, secure renegotiation extension" \ |
| 3608 | -c "found renegotiation extension" \ |
| 3609 | -S "record counter limit reached: renegotiate" \ |
| 3610 | -C "=> renegotiate" \ |
| 3611 | -S "=> renegotiate" \ |
| 3612 | -S "write hello request" \ |
| 3613 | -S "SSL - An unexpected message was received from our peer" \ |
| 3614 | -S "failed" |
| 3615 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3616 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3617 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3618 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3619 | "$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] | 3620 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3621 | 0 \ |
| 3622 | -c "client hello, adding renegotiation extension" \ |
| 3623 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3624 | -s "found renegotiation extension" \ |
| 3625 | -s "server hello, secure renegotiation extension" \ |
| 3626 | -c "found renegotiation extension" \ |
| 3627 | -s "record counter limit reached: renegotiate" \ |
| 3628 | -c "=> renegotiate" \ |
| 3629 | -s "=> renegotiate" \ |
| 3630 | -s "write hello request" \ |
| 3631 | -S "SSL - An unexpected message was received from our peer" \ |
| 3632 | -S "failed" |
| 3633 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3634 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3635 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3636 | "$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] | 3637 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3638 | 0 \ |
| 3639 | -c "client hello, adding renegotiation extension" \ |
| 3640 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3641 | -s "found renegotiation extension" \ |
| 3642 | -s "server hello, secure renegotiation extension" \ |
| 3643 | -c "found renegotiation extension" \ |
| 3644 | -s "record counter limit reached: renegotiate" \ |
| 3645 | -c "=> renegotiate" \ |
| 3646 | -s "=> renegotiate" \ |
| 3647 | -s "write hello request" \ |
| 3648 | -S "SSL - An unexpected message was received from our peer" \ |
| 3649 | -S "failed" |
| 3650 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3651 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3652 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3653 | "$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] | 3654 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3655 | 0 \ |
| 3656 | -C "client hello, adding renegotiation extension" \ |
| 3657 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3658 | -S "found renegotiation extension" \ |
| 3659 | -s "server hello, secure renegotiation extension" \ |
| 3660 | -c "found renegotiation extension" \ |
| 3661 | -S "record counter limit reached: renegotiate" \ |
| 3662 | -C "=> renegotiate" \ |
| 3663 | -S "=> renegotiate" \ |
| 3664 | -S "write hello request" \ |
| 3665 | -S "SSL - An unexpected message was received from our peer" \ |
| 3666 | -S "failed" |
| 3667 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3668 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3669 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3670 | "$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] | 3671 | "$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] | 3672 | 0 \ |
| 3673 | -c "client hello, adding renegotiation extension" \ |
| 3674 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3675 | -s "found renegotiation extension" \ |
| 3676 | -s "server hello, secure renegotiation extension" \ |
| 3677 | -c "found renegotiation extension" \ |
| 3678 | -c "=> renegotiate" \ |
| 3679 | -s "=> renegotiate" \ |
| 3680 | -S "write hello request" |
| 3681 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3682 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3683 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3684 | "$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] | 3685 | "$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] | 3686 | 0 \ |
| 3687 | -c "client hello, adding renegotiation extension" \ |
| 3688 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3689 | -s "found renegotiation extension" \ |
| 3690 | -s "server hello, secure renegotiation extension" \ |
| 3691 | -c "found renegotiation extension" \ |
| 3692 | -c "=> renegotiate" \ |
| 3693 | -s "=> renegotiate" \ |
| 3694 | -s "write hello request" |
| 3695 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3696 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3697 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3698 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3699 | "$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] | 3700 | 0 \ |
| 3701 | -c "client hello, adding renegotiation extension" \ |
| 3702 | -c "found renegotiation extension" \ |
| 3703 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3704 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3705 | -C "error" \ |
| 3706 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3707 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3708 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3709 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3710 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3711 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3712 | "$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] | 3713 | 0 \ |
| 3714 | -c "client hello, adding renegotiation extension" \ |
| 3715 | -c "found renegotiation extension" \ |
| 3716 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3717 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3718 | -C "error" \ |
| 3719 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3720 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3721 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3722 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3723 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3724 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3725 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3726 | 1 \ |
| 3727 | -c "client hello, adding renegotiation extension" \ |
| 3728 | -C "found renegotiation extension" \ |
| 3729 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3730 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3731 | -c "error" \ |
| 3732 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3733 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3734 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3735 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3736 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3737 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3738 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3739 | allow_legacy=0" \ |
| 3740 | 1 \ |
| 3741 | -c "client hello, adding renegotiation extension" \ |
| 3742 | -C "found renegotiation extension" \ |
| 3743 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3744 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3745 | -c "error" \ |
| 3746 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3747 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3748 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3749 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3750 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3751 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3752 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3753 | allow_legacy=1" \ |
| 3754 | 0 \ |
| 3755 | -c "client hello, adding renegotiation extension" \ |
| 3756 | -C "found renegotiation extension" \ |
| 3757 | -c "=> renegotiate" \ |
| 3758 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3759 | -C "error" \ |
| 3760 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3761 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3762 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3763 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3764 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3765 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3766 | 0 \ |
| 3767 | -c "client hello, adding renegotiation extension" \ |
| 3768 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3769 | -s "found renegotiation extension" \ |
| 3770 | -s "server hello, secure renegotiation extension" \ |
| 3771 | -c "found renegotiation extension" \ |
| 3772 | -c "=> renegotiate" \ |
| 3773 | -s "=> renegotiate" \ |
| 3774 | -S "write hello request" |
| 3775 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3776 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3777 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3778 | "$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] | 3779 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3780 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3781 | 0 \ |
| 3782 | -c "client hello, adding renegotiation extension" \ |
| 3783 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3784 | -s "found renegotiation extension" \ |
| 3785 | -s "server hello, secure renegotiation extension" \ |
| 3786 | -c "found renegotiation extension" \ |
| 3787 | -c "=> renegotiate" \ |
| 3788 | -s "=> renegotiate" \ |
| 3789 | -s "write hello request" |
| 3790 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3791 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3792 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3793 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3794 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3795 | 0 \ |
| 3796 | -c "client hello, adding renegotiation extension" \ |
| 3797 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3798 | -s "found renegotiation extension" \ |
| 3799 | -s "server hello, secure renegotiation extension" \ |
| 3800 | -s "record counter limit reached: renegotiate" \ |
| 3801 | -c "=> renegotiate" \ |
| 3802 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3803 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3804 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3805 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3806 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3807 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3808 | "$G_SRV -u --mtu 4096" \ |
| 3809 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3810 | 0 \ |
| 3811 | -c "client hello, adding renegotiation extension" \ |
| 3812 | -c "found renegotiation extension" \ |
| 3813 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3814 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3815 | -C "error" \ |
| 3816 | -s "Extra-header:" |
| 3817 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3818 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3819 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3820 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3821 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3822 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3823 | "$P_CLI debug_level=3" \ |
| 3824 | 0 \ |
| 3825 | -c "found renegotiation extension" \ |
| 3826 | -C "error" \ |
| 3827 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3828 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3829 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3830 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3831 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3832 | "$P_CLI debug_level=3" \ |
| 3833 | 0 \ |
| 3834 | -C "found renegotiation extension" \ |
| 3835 | -C "error" \ |
| 3836 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3837 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3838 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3839 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3840 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3841 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3842 | 1 \ |
| 3843 | -C "found renegotiation extension" \ |
| 3844 | -c "error" \ |
| 3845 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3846 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3847 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3848 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3849 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3850 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3851 | 0 \ |
| 3852 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3853 | -s "server hello, secure renegotiation extension" |
| 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 unsafe, 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:%DISABLE_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 break legacy" \ |
| 3865 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
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 | 1 \ |
| 3868 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3869 | -S "server hello, secure renegotiation extension" |
| 3870 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3871 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3872 | |
| 3873 | requires_gnutls |
| 3874 | run_test "DER format: no trailing bytes" \ |
| 3875 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3876 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3877 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3878 | 0 \ |
| 3879 | -c "Handshake was completed" \ |
| 3880 | |
| 3881 | requires_gnutls |
| 3882 | run_test "DER format: with a trailing zero byte" \ |
| 3883 | "$P_SRV crt_file=data_files/server5-der1a.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 random byte" \ |
| 3891 | "$P_SRV crt_file=data_files/server5-der1b.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 2 trailing random bytes" \ |
| 3899 | "$P_SRV crt_file=data_files/server5-der2.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 4 trailing random bytes" \ |
| 3907 | "$P_SRV crt_file=data_files/server5-der4.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 8 trailing random bytes" \ |
| 3915 | "$P_SRV crt_file=data_files/server5-der8.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 9 trailing random bytes" \ |
| 3923 | "$P_SRV crt_file=data_files/server5-der9.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 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3929 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3930 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3931 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3932 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3933 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3934 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3935 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3936 | 1 \ |
| 3937 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3938 | -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] | 3939 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3940 | -c "X509 - Certificate verification failed" |
| 3941 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3942 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3943 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3944 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3945 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3946 | 0 \ |
| 3947 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3948 | -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] | 3949 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3950 | -C "X509 - Certificate verification failed" |
| 3951 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3952 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3953 | "$P_SRV" \ |
| 3954 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3955 | 0 \ |
| 3956 | -c "x509_verify_cert() returned" \ |
| 3957 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3958 | -c "! Certificate verification flags"\ |
| 3959 | -C "! mbedtls_ssl_handshake returned" \ |
| 3960 | -C "X509 - Certificate verification failed" \ |
| 3961 | -C "SSL - No CA Chain is set, but required to operate" |
| 3962 | |
| 3963 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3964 | "$P_SRV" \ |
| 3965 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3966 | 1 \ |
| 3967 | -c "x509_verify_cert() returned" \ |
| 3968 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3969 | -c "! Certificate verification flags"\ |
| 3970 | -c "! mbedtls_ssl_handshake returned" \ |
| 3971 | -c "SSL - No CA Chain is set, but required to operate" |
| 3972 | |
| 3973 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3974 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3975 | # the client informs the server about the supported curves - it does, though, in the |
| 3976 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3977 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3978 | # different means to have the server ignoring the client's supported curve list. |
| 3979 | |
| 3980 | requires_config_enabled MBEDTLS_ECP_C |
| 3981 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3982 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3983 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3984 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3985 | 1 \ |
| 3986 | -c "bad certificate (EC key curve)"\ |
| 3987 | -c "! Certificate verification flags"\ |
| 3988 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3989 | |
| 3990 | requires_config_enabled MBEDTLS_ECP_C |
| 3991 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3992 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3993 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3994 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3995 | 1 \ |
| 3996 | -c "bad certificate (EC key curve)"\ |
| 3997 | -c "! Certificate verification flags"\ |
| 3998 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3999 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4000 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4001 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4002 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4003 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4004 | 0 \ |
| 4005 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4006 | -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] | 4007 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4008 | -C "X509 - Certificate verification failed" |
| 4009 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4010 | run_test "Authentication: client SHA256, server required" \ |
| 4011 | "$P_SRV auth_mode=required" \ |
| 4012 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4013 | key_file=data_files/server6.key \ |
| 4014 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4015 | 0 \ |
| 4016 | -c "Supported Signature Algorithm found: 4," \ |
| 4017 | -c "Supported Signature Algorithm found: 5," |
| 4018 | |
| 4019 | run_test "Authentication: client SHA384, server required" \ |
| 4020 | "$P_SRV auth_mode=required" \ |
| 4021 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4022 | key_file=data_files/server6.key \ |
| 4023 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4024 | 0 \ |
| 4025 | -c "Supported Signature Algorithm found: 4," \ |
| 4026 | -c "Supported Signature Algorithm found: 5," |
| 4027 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4028 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4029 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4030 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4031 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4032 | key_file=data_files/server5.key" \ |
| 4033 | 1 \ |
| 4034 | -S "skip write certificate request" \ |
| 4035 | -C "skip parse certificate request" \ |
| 4036 | -c "got a certificate request" \ |
| 4037 | -c "got no certificate to send" \ |
| 4038 | -S "x509_verify_cert() returned" \ |
| 4039 | -s "client has no certificate" \ |
| 4040 | -s "! mbedtls_ssl_handshake returned" \ |
| 4041 | -c "! mbedtls_ssl_handshake returned" \ |
| 4042 | -s "No client certification received from the client, but required by the authentication mode" |
| 4043 | |
| 4044 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4045 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4046 | "$P_CLI debug_level=3 crt_file=none \ |
| 4047 | key_file=data_files/server5.key" \ |
| 4048 | 1 \ |
| 4049 | -S "skip write certificate request" \ |
| 4050 | -C "skip parse certificate request" \ |
| 4051 | -c "got a certificate request" \ |
| 4052 | -c "= write certificate$" \ |
| 4053 | -C "skip write certificate$" \ |
| 4054 | -S "x509_verify_cert() returned" \ |
| 4055 | -s "client has no certificate" \ |
| 4056 | -s "! mbedtls_ssl_handshake returned" \ |
| 4057 | -c "! mbedtls_ssl_handshake returned" \ |
| 4058 | -s "No client certification received from the client, but required by the authentication mode" |
| 4059 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4060 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4061 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4062 | "$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] | 4063 | key_file=data_files/server5.key" \ |
| 4064 | 1 \ |
| 4065 | -S "skip write certificate request" \ |
| 4066 | -C "skip parse certificate request" \ |
| 4067 | -c "got a certificate request" \ |
| 4068 | -C "skip write certificate" \ |
| 4069 | -C "skip write certificate verify" \ |
| 4070 | -S "skip parse certificate verify" \ |
| 4071 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4072 | -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] | 4073 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4074 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4075 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4076 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4077 | # We don't check that the client receives the alert because it might |
| 4078 | # detect that its write end of the connection is closed and abort |
| 4079 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4080 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4081 | run_test "Authentication: client cert not trusted, server required" \ |
| 4082 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4083 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4084 | key_file=data_files/server5.key" \ |
| 4085 | 1 \ |
| 4086 | -S "skip write certificate request" \ |
| 4087 | -C "skip parse certificate request" \ |
| 4088 | -c "got a certificate request" \ |
| 4089 | -C "skip write certificate" \ |
| 4090 | -C "skip write certificate verify" \ |
| 4091 | -S "skip parse certificate verify" \ |
| 4092 | -s "x509_verify_cert() returned" \ |
| 4093 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4094 | -s "! mbedtls_ssl_handshake returned" \ |
| 4095 | -c "! mbedtls_ssl_handshake returned" \ |
| 4096 | -s "X509 - Certificate verification failed" |
| 4097 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4098 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4099 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4100 | "$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] | 4101 | key_file=data_files/server5.key" \ |
| 4102 | 0 \ |
| 4103 | -S "skip write certificate request" \ |
| 4104 | -C "skip parse certificate request" \ |
| 4105 | -c "got a certificate request" \ |
| 4106 | -C "skip write certificate" \ |
| 4107 | -C "skip write certificate verify" \ |
| 4108 | -S "skip parse certificate verify" \ |
| 4109 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4110 | -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] | 4111 | -S "! mbedtls_ssl_handshake returned" \ |
| 4112 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4113 | -S "X509 - Certificate verification failed" |
| 4114 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4115 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4116 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4117 | "$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] | 4118 | key_file=data_files/server5.key" \ |
| 4119 | 0 \ |
| 4120 | -s "skip write certificate request" \ |
| 4121 | -C "skip parse certificate request" \ |
| 4122 | -c "got no certificate request" \ |
| 4123 | -c "skip write certificate" \ |
| 4124 | -c "skip write certificate verify" \ |
| 4125 | -s "skip parse certificate verify" \ |
| 4126 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4127 | -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] | 4128 | -S "! mbedtls_ssl_handshake returned" \ |
| 4129 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4130 | -S "X509 - Certificate verification failed" |
| 4131 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4132 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4133 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4134 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4135 | 0 \ |
| 4136 | -S "skip write certificate request" \ |
| 4137 | -C "skip parse certificate request" \ |
| 4138 | -c "got a certificate request" \ |
| 4139 | -C "skip write certificate$" \ |
| 4140 | -C "got no certificate to send" \ |
| 4141 | -S "SSLv3 client has no certificate" \ |
| 4142 | -c "skip write certificate verify" \ |
| 4143 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4144 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4145 | -S "! mbedtls_ssl_handshake returned" \ |
| 4146 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4147 | -S "X509 - Certificate verification failed" |
| 4148 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4149 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4150 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4151 | "$O_CLI" \ |
| 4152 | 0 \ |
| 4153 | -S "skip write certificate request" \ |
| 4154 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4155 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4156 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4157 | -S "X509 - Certificate verification failed" |
| 4158 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4159 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4160 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4161 | "$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] | 4162 | 0 \ |
| 4163 | -C "skip parse certificate request" \ |
| 4164 | -c "got a certificate request" \ |
| 4165 | -C "skip write certificate$" \ |
| 4166 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4167 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4168 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4169 | run_test "Authentication: client no cert, openssl server required" \ |
| 4170 | "$O_SRV -Verify 10" \ |
| 4171 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4172 | 1 \ |
| 4173 | -C "skip parse certificate request" \ |
| 4174 | -c "got a certificate request" \ |
| 4175 | -C "skip write certificate$" \ |
| 4176 | -c "skip write certificate verify" \ |
| 4177 | -c "! mbedtls_ssl_handshake returned" |
| 4178 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4179 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4180 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4181 | "$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] | 4182 | "$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] | 4183 | 0 \ |
| 4184 | -S "skip write certificate request" \ |
| 4185 | -C "skip parse certificate request" \ |
| 4186 | -c "got a certificate request" \ |
| 4187 | -C "skip write certificate$" \ |
| 4188 | -c "skip write certificate verify" \ |
| 4189 | -c "got no certificate to send" \ |
| 4190 | -s "SSLv3 client has no certificate" \ |
| 4191 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4192 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4193 | -S "! mbedtls_ssl_handshake returned" \ |
| 4194 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4195 | -S "X509 - Certificate verification failed" |
| 4196 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 4197 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 4198 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4199 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4200 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 4201 | 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] | 4202 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4203 | if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4204 | printf "The ${CONFIG_H} file contains a value for the configuration of\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4205 | printf "MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script’s\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4206 | printf "test value of ${MAX_IM_CA}. \n" |
| 4207 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4208 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 4209 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4210 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4211 | |
| 4212 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4213 | fi |
| 4214 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4215 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4216 | run_test "Authentication: server max_int chain, client default" \ |
| 4217 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4218 | key_file=data_files/dir-maxpath/09.key" \ |
| 4219 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4220 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4221 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 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+1 chain, client default" \ |
| 4225 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4226 | key_file=data_files/dir-maxpath/10.key" \ |
| 4227 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4228 | 1 \ |
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 optional" \ |
| 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 | auth_mode=optional" \ |
| 4237 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4238 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4239 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4240 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4241 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4242 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4243 | key_file=data_files/dir-maxpath/10.key" \ |
| 4244 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4245 | auth_mode=none" \ |
| 4246 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4247 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4248 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4249 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4250 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4251 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4252 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4253 | key_file=data_files/dir-maxpath/10.key" \ |
| 4254 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4255 | -S "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 optional" \ |
| 4259 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4260 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4261 | key_file=data_files/dir-maxpath/10.key" \ |
| 4262 | 1 \ |
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 required" \ |
| 4267 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 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 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/c09.pem \ |
| 4277 | key_file=data_files/dir-maxpath/09.key" \ |
| 4278 | 0 \ |
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 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4281 | # Tests for CA list in CertificateRequest messages |
| 4282 | |
| 4283 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4284 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4285 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4286 | key_file=data_files/server6.key" \ |
| 4287 | 0 \ |
| 4288 | -s "requested DN" |
| 4289 | |
| 4290 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4291 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4292 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4293 | key_file=data_files/server6.key" \ |
| 4294 | 0 \ |
| 4295 | -S "requested DN" |
| 4296 | |
| 4297 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4298 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4299 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4300 | key_file=data_files/server5.key" \ |
| 4301 | 1 \ |
| 4302 | -S "requested DN" \ |
| 4303 | -s "x509_verify_cert() returned" \ |
| 4304 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4305 | -s "! mbedtls_ssl_handshake returned" \ |
| 4306 | -c "! mbedtls_ssl_handshake returned" \ |
| 4307 | -s "X509 - Certificate verification failed" |
| 4308 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4309 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4310 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4311 | |
| 4312 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4313 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4314 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4315 | key_file=data_files/server5.key" \ |
| 4316 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4317 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4318 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4319 | -c "x509_verify_cert() returned" \ |
| 4320 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4321 | -c "! mbedtls_ssl_handshake returned" \ |
| 4322 | -c "X509 - Certificate verification failed" |
| 4323 | |
| 4324 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4325 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4326 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4327 | key_file=data_files/server5.key" \ |
| 4328 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4329 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4330 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4331 | -c "x509_verify_cert() returned" \ |
| 4332 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4333 | -C "! mbedtls_ssl_handshake returned" \ |
| 4334 | -C "X509 - Certificate verification failed" |
| 4335 | |
| 4336 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4337 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4338 | # the client informs the server about the supported curves - it does, though, in the |
| 4339 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4340 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4341 | # different means to have the server ignoring the client's supported curve list. |
| 4342 | |
| 4343 | requires_config_enabled MBEDTLS_ECP_C |
| 4344 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4345 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4346 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4347 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4348 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4349 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4350 | -c "use CA callback for X.509 CRT verification" \ |
| 4351 | -c "bad certificate (EC key curve)" \ |
| 4352 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4353 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4354 | |
| 4355 | requires_config_enabled MBEDTLS_ECP_C |
| 4356 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4357 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4358 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4359 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4360 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4361 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4362 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4363 | -c "bad certificate (EC key curve)"\ |
| 4364 | -c "! Certificate verification flags"\ |
| 4365 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4366 | |
| 4367 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4368 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4369 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4370 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4371 | key_file=data_files/server6.key \ |
| 4372 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4373 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4374 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4375 | -c "Supported Signature Algorithm found: 4," \ |
| 4376 | -c "Supported Signature Algorithm found: 5," |
| 4377 | |
| 4378 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4379 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4380 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4381 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4382 | key_file=data_files/server6.key \ |
| 4383 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4384 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4385 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4386 | -c "Supported Signature Algorithm found: 4," \ |
| 4387 | -c "Supported Signature Algorithm found: 5," |
| 4388 | |
| 4389 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4390 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4391 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4392 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4393 | key_file=data_files/server5.key" \ |
| 4394 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4395 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4396 | -S "skip write certificate request" \ |
| 4397 | -C "skip parse certificate request" \ |
| 4398 | -c "got a certificate request" \ |
| 4399 | -C "skip write certificate" \ |
| 4400 | -C "skip write certificate verify" \ |
| 4401 | -S "skip parse certificate verify" \ |
| 4402 | -s "x509_verify_cert() returned" \ |
| 4403 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4404 | -s "! mbedtls_ssl_handshake returned" \ |
| 4405 | -s "send alert level=2 message=48" \ |
| 4406 | -c "! mbedtls_ssl_handshake returned" \ |
| 4407 | -s "X509 - Certificate verification failed" |
| 4408 | # We don't check that the client receives the alert because it might |
| 4409 | # detect that its write end of the connection is closed and abort |
| 4410 | # before reading the alert message. |
| 4411 | |
| 4412 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4413 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4414 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4415 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4416 | key_file=data_files/server5.key" \ |
| 4417 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4418 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4419 | -S "skip write certificate request" \ |
| 4420 | -C "skip parse certificate request" \ |
| 4421 | -c "got a certificate request" \ |
| 4422 | -C "skip write certificate" \ |
| 4423 | -C "skip write certificate verify" \ |
| 4424 | -S "skip parse certificate verify" \ |
| 4425 | -s "x509_verify_cert() returned" \ |
| 4426 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4427 | -s "! mbedtls_ssl_handshake returned" \ |
| 4428 | -c "! mbedtls_ssl_handshake returned" \ |
| 4429 | -s "X509 - Certificate verification failed" |
| 4430 | |
| 4431 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4432 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4433 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4434 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4435 | key_file=data_files/server5.key" \ |
| 4436 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4437 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4438 | -S "skip write certificate request" \ |
| 4439 | -C "skip parse certificate request" \ |
| 4440 | -c "got a certificate request" \ |
| 4441 | -C "skip write certificate" \ |
| 4442 | -C "skip write certificate verify" \ |
| 4443 | -S "skip parse certificate verify" \ |
| 4444 | -s "x509_verify_cert() returned" \ |
| 4445 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4446 | -S "! mbedtls_ssl_handshake returned" \ |
| 4447 | -C "! mbedtls_ssl_handshake returned" \ |
| 4448 | -S "X509 - Certificate verification failed" |
| 4449 | |
| 4450 | requires_full_size_output_buffer |
| 4451 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4452 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4453 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4454 | key_file=data_files/dir-maxpath/09.key" \ |
| 4455 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4456 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4457 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4458 | -C "X509 - A fatal error occurred" |
| 4459 | |
| 4460 | requires_full_size_output_buffer |
| 4461 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4462 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4463 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4464 | key_file=data_files/dir-maxpath/10.key" \ |
| 4465 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4466 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4467 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4468 | -c "X509 - A fatal error occurred" |
| 4469 | |
| 4470 | requires_full_size_output_buffer |
| 4471 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4472 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4473 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4474 | key_file=data_files/dir-maxpath/10.key" \ |
| 4475 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4476 | debug_level=3 auth_mode=optional" \ |
| 4477 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4478 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4479 | -c "X509 - A fatal error occurred" |
| 4480 | |
| 4481 | requires_full_size_output_buffer |
| 4482 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4483 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4484 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4485 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4486 | key_file=data_files/dir-maxpath/10.key" \ |
| 4487 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4488 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4489 | -s "X509 - A fatal error occurred" |
| 4490 | |
| 4491 | requires_full_size_output_buffer |
| 4492 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4493 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4494 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4495 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4496 | key_file=data_files/dir-maxpath/10.key" \ |
| 4497 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4498 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4499 | -s "X509 - A fatal error occurred" |
| 4500 | |
| 4501 | requires_full_size_output_buffer |
| 4502 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4503 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4504 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4505 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4506 | key_file=data_files/dir-maxpath/09.key" \ |
| 4507 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4508 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4509 | -S "X509 - A fatal error occurred" |
| 4510 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4511 | # Tests for certificate selection based on SHA verson |
| 4512 | |
| 4513 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4514 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4515 | key_file=data_files/server5.key \ |
| 4516 | crt_file2=data_files/server5-sha1.crt \ |
| 4517 | key_file2=data_files/server5.key" \ |
| 4518 | "$P_CLI force_version=tls1_2" \ |
| 4519 | 0 \ |
| 4520 | -c "signed using.*ECDSA with SHA256" \ |
| 4521 | -C "signed using.*ECDSA with SHA1" |
| 4522 | |
| 4523 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4524 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4525 | key_file=data_files/server5.key \ |
| 4526 | crt_file2=data_files/server5-sha1.crt \ |
| 4527 | key_file2=data_files/server5.key" \ |
| 4528 | "$P_CLI force_version=tls1_1" \ |
| 4529 | 0 \ |
| 4530 | -C "signed using.*ECDSA with SHA256" \ |
| 4531 | -c "signed using.*ECDSA with SHA1" |
| 4532 | |
| 4533 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4534 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4535 | key_file=data_files/server5.key \ |
| 4536 | crt_file2=data_files/server5-sha1.crt \ |
| 4537 | key_file2=data_files/server5.key" \ |
| 4538 | "$P_CLI force_version=tls1" \ |
| 4539 | 0 \ |
| 4540 | -C "signed using.*ECDSA with SHA256" \ |
| 4541 | -c "signed using.*ECDSA with SHA1" |
| 4542 | |
| 4543 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4544 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4545 | key_file=data_files/server5.key \ |
| 4546 | crt_file2=data_files/server6.crt \ |
| 4547 | key_file2=data_files/server6.key" \ |
| 4548 | "$P_CLI force_version=tls1_1" \ |
| 4549 | 0 \ |
| 4550 | -c "serial number.*09" \ |
| 4551 | -c "signed using.*ECDSA with SHA256" \ |
| 4552 | -C "signed using.*ECDSA with SHA1" |
| 4553 | |
| 4554 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4555 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4556 | key_file=data_files/server6.key \ |
| 4557 | crt_file2=data_files/server5.crt \ |
| 4558 | key_file2=data_files/server5.key" \ |
| 4559 | "$P_CLI force_version=tls1_1" \ |
| 4560 | 0 \ |
| 4561 | -c "serial number.*0A" \ |
| 4562 | -c "signed using.*ECDSA with SHA256" \ |
| 4563 | -C "signed using.*ECDSA with SHA1" |
| 4564 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4565 | # tests for SNI |
| 4566 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4567 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4568 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4569 | 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] | 4570 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4571 | 0 \ |
| 4572 | -S "parse ServerName extension" \ |
| 4573 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4574 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4575 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4576 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4577 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4578 | 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] | 4579 | 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] | 4580 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4581 | 0 \ |
| 4582 | -s "parse ServerName extension" \ |
| 4583 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4584 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4585 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4586 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4587 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4588 | 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] | 4589 | 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] | 4590 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4591 | 0 \ |
| 4592 | -s "parse ServerName extension" \ |
| 4593 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4594 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4595 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4596 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4597 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4598 | 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] | 4599 | 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] | 4600 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4601 | 1 \ |
| 4602 | -s "parse ServerName extension" \ |
| 4603 | -s "ssl_sni_wrapper() returned" \ |
| 4604 | -s "mbedtls_ssl_handshake returned" \ |
| 4605 | -c "mbedtls_ssl_handshake returned" \ |
| 4606 | -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] | 4607 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4608 | run_test "SNI: client auth no override: optional" \ |
| 4609 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4610 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4611 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4612 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4613 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4614 | -S "skip write certificate request" \ |
| 4615 | -C "skip parse certificate request" \ |
| 4616 | -c "got a certificate request" \ |
| 4617 | -C "skip write certificate" \ |
| 4618 | -C "skip write certificate verify" \ |
| 4619 | -S "skip parse certificate verify" |
| 4620 | |
| 4621 | run_test "SNI: client auth override: none -> optional" \ |
| 4622 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4623 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4624 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4625 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4626 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4627 | -S "skip write certificate request" \ |
| 4628 | -C "skip parse certificate request" \ |
| 4629 | -c "got a certificate request" \ |
| 4630 | -C "skip write certificate" \ |
| 4631 | -C "skip write certificate verify" \ |
| 4632 | -S "skip parse certificate verify" |
| 4633 | |
| 4634 | run_test "SNI: client auth override: optional -> none" \ |
| 4635 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4636 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4637 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4638 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4639 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4640 | -s "skip write certificate request" \ |
| 4641 | -C "skip parse certificate request" \ |
| 4642 | -c "got no certificate request" \ |
| 4643 | -c "skip write certificate" \ |
| 4644 | -c "skip write certificate verify" \ |
| 4645 | -s "skip parse certificate verify" |
| 4646 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4647 | run_test "SNI: CA no override" \ |
| 4648 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4649 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4650 | ca_file=data_files/test-ca.crt \ |
| 4651 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4652 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4653 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4654 | 1 \ |
| 4655 | -S "skip write certificate request" \ |
| 4656 | -C "skip parse certificate request" \ |
| 4657 | -c "got a certificate request" \ |
| 4658 | -C "skip write certificate" \ |
| 4659 | -C "skip write certificate verify" \ |
| 4660 | -S "skip parse certificate verify" \ |
| 4661 | -s "x509_verify_cert() returned" \ |
| 4662 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4663 | -S "The certificate has been revoked (is on a CRL)" |
| 4664 | |
| 4665 | run_test "SNI: CA override" \ |
| 4666 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4667 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4668 | ca_file=data_files/test-ca.crt \ |
| 4669 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4670 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4671 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4672 | 0 \ |
| 4673 | -S "skip write certificate request" \ |
| 4674 | -C "skip parse certificate request" \ |
| 4675 | -c "got a certificate request" \ |
| 4676 | -C "skip write certificate" \ |
| 4677 | -C "skip write certificate verify" \ |
| 4678 | -S "skip parse certificate verify" \ |
| 4679 | -S "x509_verify_cert() returned" \ |
| 4680 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4681 | -S "The certificate has been revoked (is on a CRL)" |
| 4682 | |
| 4683 | run_test "SNI: CA override with CRL" \ |
| 4684 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4685 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4686 | ca_file=data_files/test-ca.crt \ |
| 4687 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4688 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4689 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4690 | 1 \ |
| 4691 | -S "skip write certificate request" \ |
| 4692 | -C "skip parse certificate request" \ |
| 4693 | -c "got a certificate request" \ |
| 4694 | -C "skip write certificate" \ |
| 4695 | -C "skip write certificate verify" \ |
| 4696 | -S "skip parse certificate verify" \ |
| 4697 | -s "x509_verify_cert() returned" \ |
| 4698 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4699 | -s "The certificate has been revoked (is on a CRL)" |
| 4700 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4701 | # Tests for SNI and DTLS |
| 4702 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4703 | run_test "SNI: DTLS, no SNI callback" \ |
| 4704 | "$P_SRV debug_level=3 dtls=1 \ |
| 4705 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4706 | "$P_CLI server_name=localhost dtls=1" \ |
| 4707 | 0 \ |
| 4708 | -S "parse ServerName extension" \ |
| 4709 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4710 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4711 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4712 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4713 | "$P_SRV debug_level=3 dtls=1 \ |
| 4714 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4715 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4716 | "$P_CLI server_name=localhost dtls=1" \ |
| 4717 | 0 \ |
| 4718 | -s "parse ServerName extension" \ |
| 4719 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4720 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4721 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4722 | run_test "SNI: DTLS, matching cert 2" \ |
| 4723 | "$P_SRV debug_level=3 dtls=1 \ |
| 4724 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4725 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4726 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4727 | 0 \ |
| 4728 | -s "parse ServerName extension" \ |
| 4729 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4730 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4731 | |
| 4732 | run_test "SNI: DTLS, no matching cert" \ |
| 4733 | "$P_SRV debug_level=3 dtls=1 \ |
| 4734 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4735 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4736 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4737 | 1 \ |
| 4738 | -s "parse ServerName extension" \ |
| 4739 | -s "ssl_sni_wrapper() returned" \ |
| 4740 | -s "mbedtls_ssl_handshake returned" \ |
| 4741 | -c "mbedtls_ssl_handshake returned" \ |
| 4742 | -c "SSL - A fatal alert message was received from our peer" |
| 4743 | |
| 4744 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4745 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4746 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4747 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4748 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4749 | 0 \ |
| 4750 | -S "skip write certificate request" \ |
| 4751 | -C "skip parse certificate request" \ |
| 4752 | -c "got a certificate request" \ |
| 4753 | -C "skip write certificate" \ |
| 4754 | -C "skip write certificate verify" \ |
| 4755 | -S "skip parse certificate verify" |
| 4756 | |
| 4757 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4758 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4759 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4760 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4761 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4762 | 0 \ |
| 4763 | -S "skip write certificate request" \ |
| 4764 | -C "skip parse certificate request" \ |
| 4765 | -c "got a certificate request" \ |
| 4766 | -C "skip write certificate" \ |
| 4767 | -C "skip write certificate verify" \ |
| 4768 | -S "skip parse certificate verify" |
| 4769 | |
| 4770 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4771 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4772 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4773 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4774 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4775 | 0 \ |
| 4776 | -s "skip write certificate request" \ |
| 4777 | -C "skip parse certificate request" \ |
| 4778 | -c "got no certificate request" \ |
| 4779 | -c "skip write certificate" \ |
| 4780 | -c "skip write certificate verify" \ |
| 4781 | -s "skip parse certificate verify" |
| 4782 | |
| 4783 | run_test "SNI: DTLS, CA no override" \ |
| 4784 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4785 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4786 | ca_file=data_files/test-ca.crt \ |
| 4787 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4788 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4789 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4790 | 1 \ |
| 4791 | -S "skip write certificate request" \ |
| 4792 | -C "skip parse certificate request" \ |
| 4793 | -c "got a certificate request" \ |
| 4794 | -C "skip write certificate" \ |
| 4795 | -C "skip write certificate verify" \ |
| 4796 | -S "skip parse certificate verify" \ |
| 4797 | -s "x509_verify_cert() returned" \ |
| 4798 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4799 | -S "The certificate has been revoked (is on a CRL)" |
| 4800 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4801 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4802 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4803 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4804 | ca_file=data_files/test-ca.crt \ |
| 4805 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4806 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4807 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4808 | 0 \ |
| 4809 | -S "skip write certificate request" \ |
| 4810 | -C "skip parse certificate request" \ |
| 4811 | -c "got a certificate request" \ |
| 4812 | -C "skip write certificate" \ |
| 4813 | -C "skip write certificate verify" \ |
| 4814 | -S "skip parse certificate verify" \ |
| 4815 | -S "x509_verify_cert() returned" \ |
| 4816 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4817 | -S "The certificate has been revoked (is on a CRL)" |
| 4818 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4819 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4820 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4821 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4822 | ca_file=data_files/test-ca.crt \ |
| 4823 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4824 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4825 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4826 | 1 \ |
| 4827 | -S "skip write certificate request" \ |
| 4828 | -C "skip parse certificate request" \ |
| 4829 | -c "got a certificate request" \ |
| 4830 | -C "skip write certificate" \ |
| 4831 | -C "skip write certificate verify" \ |
| 4832 | -S "skip parse certificate verify" \ |
| 4833 | -s "x509_verify_cert() returned" \ |
| 4834 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4835 | -s "The certificate has been revoked (is on a CRL)" |
| 4836 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4837 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4838 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4839 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4840 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4841 | "$P_CLI nbio=2 tickets=0" \ |
| 4842 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4843 | -S "mbedtls_ssl_handshake returned" \ |
| 4844 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4845 | -c "Read from server: .* bytes read" |
| 4846 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4847 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4848 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 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: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4856 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4857 | "$P_CLI nbio=2 tickets=1" \ |
| 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 + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4864 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 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 + resume" \ |
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 reconnect=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 + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4880 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 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: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4888 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4889 | "$P_CLI nbio=2 tickets=0 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 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4895 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4896 | |
| 4897 | run_test "Event-driven I/O: basic handshake" \ |
| 4898 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4899 | "$P_CLI event=1 tickets=0" \ |
| 4900 | 0 \ |
| 4901 | -S "mbedtls_ssl_handshake returned" \ |
| 4902 | -C "mbedtls_ssl_handshake returned" \ |
| 4903 | -c "Read from server: .* bytes read" |
| 4904 | |
| 4905 | run_test "Event-driven I/O: client auth" \ |
| 4906 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 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: ticket" \ |
| 4914 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4915 | "$P_CLI event=1 tickets=1" \ |
| 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 + client auth" \ |
| 4922 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 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 + resume" \ |
| 4930 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4931 | "$P_CLI event=1 tickets=1 reconnect=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 + resume" \ |
| 4938 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 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: session-id resume" \ |
| 4946 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4947 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4948 | 0 \ |
| 4949 | -S "mbedtls_ssl_handshake returned" \ |
| 4950 | -C "mbedtls_ssl_handshake returned" \ |
| 4951 | -c "Read from server: .* bytes read" |
| 4952 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4953 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4954 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4955 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4956 | 0 \ |
| 4957 | -c "Read from server: .* bytes read" |
| 4958 | |
| 4959 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4960 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4961 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4962 | 0 \ |
| 4963 | -c "Read from server: .* bytes read" |
| 4964 | |
| 4965 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4966 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4967 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4968 | 0 \ |
| 4969 | -c "Read from server: .* bytes read" |
| 4970 | |
| 4971 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4972 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4973 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4974 | 0 \ |
| 4975 | -c "Read from server: .* bytes read" |
| 4976 | |
| 4977 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4978 | "$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] | 4979 | "$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] | 4980 | 0 \ |
| 4981 | -c "Read from server: .* bytes read" |
| 4982 | |
| 4983 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4984 | "$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] | 4985 | "$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] | 4986 | 0 \ |
| 4987 | -c "Read from server: .* bytes read" |
| 4988 | |
| 4989 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4990 | "$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] | 4991 | "$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] | 4992 | 0 \ |
| 4993 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4994 | |
| 4995 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4996 | # During session resumption, the client will send its ApplicationData record |
| 4997 | # within the same datagram as the Finished messages. In this situation, the |
| 4998 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4999 | # because the ApplicationData request has already been queued internally. |
| 5000 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5001 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5002 | "$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] | 5003 | "$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] | 5004 | 0 \ |
| 5005 | -c "Read from server: .* bytes read" |
| 5006 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5007 | # Tests for version negotiation |
| 5008 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5009 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5010 | "$P_SRV" \ |
| 5011 | "$P_CLI" \ |
| 5012 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5013 | -S "mbedtls_ssl_handshake returned" \ |
| 5014 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5015 | -s "Protocol is TLSv1.2" \ |
| 5016 | -c "Protocol is TLSv1.2" |
| 5017 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5018 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5019 | "$P_SRV" \ |
| 5020 | "$P_CLI max_version=tls1_1" \ |
| 5021 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5022 | -S "mbedtls_ssl_handshake returned" \ |
| 5023 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5024 | -s "Protocol is TLSv1.1" \ |
| 5025 | -c "Protocol is TLSv1.1" |
| 5026 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5027 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5028 | "$P_SRV max_version=tls1_1" \ |
| 5029 | "$P_CLI" \ |
| 5030 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5031 | -S "mbedtls_ssl_handshake returned" \ |
| 5032 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5033 | -s "Protocol is TLSv1.1" \ |
| 5034 | -c "Protocol is TLSv1.1" |
| 5035 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5036 | run_test "Version check: cli+srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5037 | "$P_SRV max_version=tls1_1" \ |
| 5038 | "$P_CLI max_version=tls1_1" \ |
| 5039 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5040 | -S "mbedtls_ssl_handshake returned" \ |
| 5041 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5042 | -s "Protocol is TLSv1.1" \ |
| 5043 | -c "Protocol is TLSv1.1" |
| 5044 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5045 | 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] | 5046 | "$P_SRV min_version=tls1_1" \ |
| 5047 | "$P_CLI max_version=tls1_1" \ |
| 5048 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5049 | -S "mbedtls_ssl_handshake returned" \ |
| 5050 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5051 | -s "Protocol is TLSv1.1" \ |
| 5052 | -c "Protocol is TLSv1.1" |
| 5053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5054 | 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] | 5055 | "$P_SRV max_version=tls1_1" \ |
| 5056 | "$P_CLI min_version=tls1_1" \ |
| 5057 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5058 | -S "mbedtls_ssl_handshake returned" \ |
| 5059 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5060 | -s "Protocol is TLSv1.1" \ |
| 5061 | -c "Protocol is TLSv1.1" |
| 5062 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5063 | 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] | 5064 | "$P_SRV max_version=tls1_1" \ |
| 5065 | "$P_CLI min_version=tls1_2" \ |
| 5066 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5067 | -s "mbedtls_ssl_handshake returned" \ |
| 5068 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5069 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5070 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5071 | 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] | 5072 | "$P_SRV min_version=tls1_2" \ |
| 5073 | "$P_CLI max_version=tls1_1" \ |
| 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 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5078 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5079 | # Tests for ALPN extension |
| 5080 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5081 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5082 | "$P_SRV debug_level=3" \ |
| 5083 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5084 | 0 \ |
| 5085 | -C "client hello, adding alpn extension" \ |
| 5086 | -S "found alpn extension" \ |
| 5087 | -C "got an alert message, type: \\[2:120]" \ |
| 5088 | -S "server hello, adding alpn extension" \ |
| 5089 | -C "found alpn extension " \ |
| 5090 | -C "Application Layer Protocol is" \ |
| 5091 | -S "Application Layer Protocol is" |
| 5092 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5093 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5094 | "$P_SRV debug_level=3" \ |
| 5095 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5096 | 0 \ |
| 5097 | -c "client hello, adding alpn extension" \ |
| 5098 | -s "found alpn extension" \ |
| 5099 | -C "got an alert message, type: \\[2:120]" \ |
| 5100 | -S "server hello, adding alpn extension" \ |
| 5101 | -C "found alpn extension " \ |
| 5102 | -c "Application Layer Protocol is (none)" \ |
| 5103 | -S "Application Layer Protocol is" |
| 5104 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5105 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5106 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5107 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5108 | 0 \ |
| 5109 | -C "client hello, adding alpn extension" \ |
| 5110 | -S "found alpn extension" \ |
| 5111 | -C "got an alert message, type: \\[2:120]" \ |
| 5112 | -S "server hello, adding alpn extension" \ |
| 5113 | -C "found alpn extension " \ |
| 5114 | -C "Application Layer Protocol is" \ |
| 5115 | -s "Application Layer Protocol is (none)" |
| 5116 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5117 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5118 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5119 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5120 | 0 \ |
| 5121 | -c "client hello, adding alpn extension" \ |
| 5122 | -s "found alpn extension" \ |
| 5123 | -C "got an alert message, type: \\[2:120]" \ |
| 5124 | -s "server hello, adding alpn extension" \ |
| 5125 | -c "found alpn extension" \ |
| 5126 | -c "Application Layer Protocol is abc" \ |
| 5127 | -s "Application Layer Protocol is abc" |
| 5128 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5129 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5130 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5131 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5132 | 0 \ |
| 5133 | -c "client hello, adding alpn extension" \ |
| 5134 | -s "found alpn extension" \ |
| 5135 | -C "got an alert message, type: \\[2:120]" \ |
| 5136 | -s "server hello, adding alpn extension" \ |
| 5137 | -c "found alpn extension" \ |
| 5138 | -c "Application Layer Protocol is abc" \ |
| 5139 | -s "Application Layer Protocol is abc" |
| 5140 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5141 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5142 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5143 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5144 | 0 \ |
| 5145 | -c "client hello, adding alpn extension" \ |
| 5146 | -s "found alpn extension" \ |
| 5147 | -C "got an alert message, type: \\[2:120]" \ |
| 5148 | -s "server hello, adding alpn extension" \ |
| 5149 | -c "found alpn extension" \ |
| 5150 | -c "Application Layer Protocol is 1234" \ |
| 5151 | -s "Application Layer Protocol is 1234" |
| 5152 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5153 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5154 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5155 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5156 | 1 \ |
| 5157 | -c "client hello, adding alpn extension" \ |
| 5158 | -s "found alpn extension" \ |
| 5159 | -c "got an alert message, type: \\[2:120]" \ |
| 5160 | -S "server hello, adding alpn extension" \ |
| 5161 | -C "found alpn extension" \ |
| 5162 | -C "Application Layer Protocol is 1234" \ |
| 5163 | -S "Application Layer Protocol is 1234" |
| 5164 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5165 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5166 | # Tests for keyUsage in leaf certificates, part 1: |
| 5167 | # server-side certificate/suite selection |
| 5168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5169 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5170 | "$P_SRV key_file=data_files/server2.key \ |
| 5171 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5172 | "$P_CLI" \ |
| 5173 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5174 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5175 | |
| 5176 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5177 | run_test "keyUsage srv: RSA, keyEncipherment -> 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-ke.crt" \ |
| 5180 | "$P_CLI" \ |
| 5181 | 0 \ |
| 5182 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5183 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5184 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5185 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5186 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5187 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5188 | 1 \ |
| 5189 | -C "Ciphersuite is " |
| 5190 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5191 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5192 | "$P_SRV key_file=data_files/server5.key \ |
| 5193 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5194 | "$P_CLI" \ |
| 5195 | 0 \ |
| 5196 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5197 | |
| 5198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5199 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
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-ka.crt" \ |
| 5202 | "$P_CLI" \ |
| 5203 | 0 \ |
| 5204 | -c "Ciphersuite is TLS-ECDH-" |
| 5205 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5206 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5207 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5208 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5209 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5210 | 1 \ |
| 5211 | -C "Ciphersuite is " |
| 5212 | |
| 5213 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5214 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5215 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5216 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5217 | "$O_SRV -key data_files/server2.key \ |
| 5218 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5219 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5220 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5221 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5222 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5223 | -C "Processing of the Certificate handshake message failed" \ |
| 5224 | -c "Ciphersuite is TLS-" |
| 5225 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5226 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5227 | "$O_SRV -key data_files/server2.key \ |
| 5228 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5229 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5230 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5231 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5232 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5233 | -C "Processing of the Certificate handshake message failed" \ |
| 5234 | -c "Ciphersuite is TLS-" |
| 5235 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5236 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5237 | "$O_SRV -key data_files/server2.key \ |
| 5238 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5239 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5240 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5241 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5242 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5243 | -C "Processing of the Certificate handshake message failed" \ |
| 5244 | -c "Ciphersuite is TLS-" |
| 5245 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5246 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5247 | "$O_SRV -key data_files/server2.key \ |
| 5248 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5249 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5250 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5251 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5252 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5253 | -c "Processing of the Certificate handshake message failed" \ |
| 5254 | -C "Ciphersuite is TLS-" |
| 5255 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5256 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5257 | "$O_SRV -key data_files/server2.key \ |
| 5258 | -cert data_files/server2.ku-ke.crt" \ |
| 5259 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5260 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5261 | 0 \ |
| 5262 | -c "bad certificate (usage extensions)" \ |
| 5263 | -C "Processing of the Certificate handshake message failed" \ |
| 5264 | -c "Ciphersuite is TLS-" \ |
| 5265 | -c "! Usage does not match the keyUsage extension" |
| 5266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5267 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5268 | "$O_SRV -key data_files/server2.key \ |
| 5269 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5270 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5271 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5272 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5273 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5274 | -C "Processing of the Certificate handshake message failed" \ |
| 5275 | -c "Ciphersuite is TLS-" |
| 5276 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5277 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5278 | "$O_SRV -key data_files/server2.key \ |
| 5279 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5280 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5281 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5282 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5283 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5284 | -c "Processing of the Certificate handshake message failed" \ |
| 5285 | -C "Ciphersuite is TLS-" |
| 5286 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5287 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5288 | "$O_SRV -key data_files/server2.key \ |
| 5289 | -cert data_files/server2.ku-ds.crt" \ |
| 5290 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5291 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5292 | 0 \ |
| 5293 | -c "bad certificate (usage extensions)" \ |
| 5294 | -C "Processing of the Certificate handshake message failed" \ |
| 5295 | -c "Ciphersuite is TLS-" \ |
| 5296 | -c "! Usage does not match the keyUsage extension" |
| 5297 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5298 | # Tests for keyUsage in leaf certificates, part 3: |
| 5299 | # server-side checking of client cert |
| 5300 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5301 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5302 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5303 | "$O_CLI -key data_files/server2.key \ |
| 5304 | -cert data_files/server2.ku-ds.crt" \ |
| 5305 | 0 \ |
| 5306 | -S "bad certificate (usage extensions)" \ |
| 5307 | -S "Processing of the Certificate handshake message failed" |
| 5308 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5309 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
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-ke.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 (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5318 | "$P_SRV debug_level=1 auth_mode=required" \ |
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 | 1 \ |
| 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: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5326 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5327 | "$O_CLI -key data_files/server5.key \ |
| 5328 | -cert data_files/server5.ku-ds.crt" \ |
| 5329 | 0 \ |
| 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, KeyAgreement: fail (soft)" \ |
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-ka.crt" \ |
| 5337 | 0 \ |
| 5338 | -s "bad certificate (usage extensions)" \ |
| 5339 | -S "Processing of the Certificate handshake message failed" |
| 5340 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5341 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5342 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5343 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5344 | "$P_SRV key_file=data_files/server5.key \ |
| 5345 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5346 | "$P_CLI" \ |
| 5347 | 0 |
| 5348 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5349 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5350 | "$P_SRV key_file=data_files/server5.key \ |
| 5351 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5352 | "$P_CLI" \ |
| 5353 | 0 |
| 5354 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5355 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5356 | "$P_SRV key_file=data_files/server5.key \ |
| 5357 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5358 | "$P_CLI" \ |
| 5359 | 0 |
| 5360 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5361 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5362 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5363 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5364 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5365 | 1 |
| 5366 | |
| 5367 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5369 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5370 | "$O_SRV -key data_files/server5.key \ |
| 5371 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5372 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5373 | 0 \ |
| 5374 | -C "bad certificate (usage extensions)" \ |
| 5375 | -C "Processing of the Certificate handshake message failed" \ |
| 5376 | -c "Ciphersuite is TLS-" |
| 5377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5378 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5379 | "$O_SRV -key data_files/server5.key \ |
| 5380 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5381 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5382 | 0 \ |
| 5383 | -C "bad certificate (usage extensions)" \ |
| 5384 | -C "Processing of the Certificate handshake message failed" \ |
| 5385 | -c "Ciphersuite is TLS-" |
| 5386 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5387 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5388 | "$O_SRV -key data_files/server5.key \ |
| 5389 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5390 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5391 | 0 \ |
| 5392 | -C "bad certificate (usage extensions)" \ |
| 5393 | -C "Processing of the Certificate handshake message failed" \ |
| 5394 | -c "Ciphersuite is TLS-" |
| 5395 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5396 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5397 | "$O_SRV -key data_files/server5.key \ |
| 5398 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5399 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5400 | 1 \ |
| 5401 | -c "bad certificate (usage extensions)" \ |
| 5402 | -c "Processing of the Certificate handshake message failed" \ |
| 5403 | -C "Ciphersuite is TLS-" |
| 5404 | |
| 5405 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5406 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5407 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5408 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5409 | "$O_CLI -key data_files/server5.key \ |
| 5410 | -cert data_files/server5.eku-cli.crt" \ |
| 5411 | 0 \ |
| 5412 | -S "bad certificate (usage extensions)" \ |
| 5413 | -S "Processing of the Certificate handshake message failed" |
| 5414 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5415 | run_test "extKeyUsage cli-auth: serverAuth,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-srv_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: codeSign,anyEKU -> 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-cs_any.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 -> fail (soft)" \ |
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.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 (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5440 | "$P_SRV debug_level=1 auth_mode=required" \ |
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 | 1 \ |
| 5444 | -s "bad certificate (usage extensions)" \ |
| 5445 | -s "Processing of the Certificate handshake message failed" |
| 5446 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5447 | # Tests for DHM parameters loading |
| 5448 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5449 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5450 | "$P_SRV" \ |
| 5451 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5452 | debug_level=3" \ |
| 5453 | 0 \ |
| 5454 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5455 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5456 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5457 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5458 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 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 ' (1024 bits)" \ |
| 5463 | -c "value of 'DHM: G ' (2 bits)" |
| 5464 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5465 | # Tests for DHM client-side size checking |
| 5466 | |
| 5467 | run_test "DHM size: server default, client default, OK" \ |
| 5468 | "$P_SRV" \ |
| 5469 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5470 | debug_level=1" \ |
| 5471 | 0 \ |
| 5472 | -C "DHM prime too short:" |
| 5473 | |
| 5474 | run_test "DHM size: server default, client 2048, OK" \ |
| 5475 | "$P_SRV" \ |
| 5476 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5477 | debug_level=1 dhmlen=2048" \ |
| 5478 | 0 \ |
| 5479 | -C "DHM prime too short:" |
| 5480 | |
| 5481 | run_test "DHM size: server 1024, client default, OK" \ |
| 5482 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5483 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5484 | debug_level=1" \ |
| 5485 | 0 \ |
| 5486 | -C "DHM prime too short:" |
| 5487 | |
| 5488 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5489 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5490 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5491 | debug_level=1" \ |
| 5492 | 1 \ |
| 5493 | -c "DHM prime too short:" |
| 5494 | |
| 5495 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5496 | "$P_SRV" \ |
| 5497 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5498 | debug_level=1 dhmlen=2049" \ |
| 5499 | 1 \ |
| 5500 | -c "DHM prime too short:" |
| 5501 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5502 | # Tests for PSK callback |
| 5503 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5504 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5505 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5506 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5507 | psk_identity=foo psk=abc123" \ |
| 5508 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5509 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5510 | -S "SSL - Unknown identity received" \ |
| 5511 | -S "SSL - Verification of the message MAC failed" |
| 5512 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5513 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5514 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5515 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5516 | "$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] | 5517 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5518 | 0 \ |
| 5519 | -c "skip PMS generation for opaque PSK"\ |
| 5520 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5521 | -C "session hash for extended master secret"\ |
| 5522 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5523 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5524 | -S "SSL - Unknown identity received" \ |
| 5525 | -S "SSL - Verification of the message MAC failed" |
| 5526 | |
| 5527 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5528 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5529 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5530 | "$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] | 5531 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5532 | 0 \ |
| 5533 | -c "skip PMS generation for opaque PSK"\ |
| 5534 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5535 | -C "session hash for extended master secret"\ |
| 5536 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5537 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5538 | -S "SSL - Unknown identity received" \ |
| 5539 | -S "SSL - Verification of the message MAC failed" |
| 5540 | |
| 5541 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5542 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5543 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5544 | "$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] | 5545 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5546 | 0 \ |
| 5547 | -c "skip PMS generation for opaque PSK"\ |
| 5548 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5549 | -c "session hash for extended master secret"\ |
| 5550 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5551 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5552 | -S "SSL - Unknown identity received" \ |
| 5553 | -S "SSL - Verification of the message MAC failed" |
| 5554 | |
| 5555 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5556 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5557 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5558 | "$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] | 5559 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5560 | 0 \ |
| 5561 | -c "skip PMS generation for opaque PSK"\ |
| 5562 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5563 | -c "session hash for extended master secret"\ |
| 5564 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5565 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5566 | -S "SSL - Unknown identity received" \ |
| 5567 | -S "SSL - Verification of the message MAC failed" |
| 5568 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5569 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5570 | 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] | 5571 | "$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] | 5572 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5573 | psk_identity=foo psk=abc123" \ |
| 5574 | 0 \ |
| 5575 | -C "skip PMS generation for opaque PSK"\ |
| 5576 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5577 | -C "session hash for extended master secret"\ |
| 5578 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5579 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5580 | -S "SSL - Unknown identity received" \ |
| 5581 | -S "SSL - Verification of the message MAC failed" |
| 5582 | |
| 5583 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5584 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5585 | "$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] | 5586 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5587 | psk_identity=foo psk=abc123" \ |
| 5588 | 0 \ |
| 5589 | -C "skip PMS generation for opaque PSK"\ |
| 5590 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5591 | -C "session hash for extended master secret"\ |
| 5592 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5593 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5594 | -S "SSL - Unknown identity received" \ |
| 5595 | -S "SSL - Verification of the message MAC failed" |
| 5596 | |
| 5597 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5598 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5599 | "$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] | 5600 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5601 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5602 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5603 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5604 | -c "session hash for extended master secret"\ |
| 5605 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5606 | -C "skip PMS generation for opaque PSK"\ |
| 5607 | -s "skip PMS generation for opaque PSK"\ |
| 5608 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5609 | -S "SSL - Unknown identity received" \ |
| 5610 | -S "SSL - Verification of the message MAC failed" |
| 5611 | |
| 5612 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5613 | 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] | 5614 | "$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] | 5615 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5616 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5617 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5618 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5619 | -c "session hash for extended master secret"\ |
| 5620 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5621 | -C "skip PMS generation for opaque PSK"\ |
| 5622 | -s "skip PMS generation for opaque PSK"\ |
| 5623 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5624 | -S "SSL - Unknown identity received" \ |
| 5625 | -S "SSL - Verification of the message MAC failed" |
| 5626 | |
| 5627 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5628 | 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] | 5629 | "$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] | 5630 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5631 | psk_identity=def psk=beef" \ |
| 5632 | 0 \ |
| 5633 | -C "skip PMS generation for opaque PSK"\ |
| 5634 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5635 | -C "session hash for extended master secret"\ |
| 5636 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5637 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5638 | -S "SSL - Unknown identity received" \ |
| 5639 | -S "SSL - Verification of the message MAC failed" |
| 5640 | |
| 5641 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5642 | 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] | 5643 | "$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] | 5644 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5645 | psk_identity=def psk=beef" \ |
| 5646 | 0 \ |
| 5647 | -C "skip PMS generation for opaque PSK"\ |
| 5648 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5649 | -C "session hash for extended master secret"\ |
| 5650 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5651 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5652 | -S "SSL - Unknown identity received" \ |
| 5653 | -S "SSL - Verification of the message MAC failed" |
| 5654 | |
| 5655 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5656 | 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] | 5657 | "$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] | 5658 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5659 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5660 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5661 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5662 | -c "session hash for extended master secret"\ |
| 5663 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5664 | -C "skip PMS generation for opaque PSK"\ |
| 5665 | -s "skip PMS generation for opaque PSK"\ |
| 5666 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5667 | -S "SSL - Unknown identity received" \ |
| 5668 | -S "SSL - Verification of the message MAC failed" |
| 5669 | |
| 5670 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5671 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5672 | "$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] | 5673 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5674 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5675 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5676 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5677 | -c "session hash for extended master secret"\ |
| 5678 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5679 | -C "skip PMS generation for opaque PSK"\ |
| 5680 | -s "skip PMS generation for opaque PSK"\ |
| 5681 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5682 | -S "SSL - Unknown identity received" \ |
| 5683 | -S "SSL - Verification of the message MAC failed" |
| 5684 | |
| 5685 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5686 | 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] | 5687 | "$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] | 5688 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5689 | psk_identity=def psk=beef" \ |
| 5690 | 0 \ |
| 5691 | -C "skip PMS generation for opaque PSK"\ |
| 5692 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5693 | -C "session hash for extended master secret"\ |
| 5694 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5695 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5696 | -S "SSL - Unknown identity received" \ |
| 5697 | -S "SSL - Verification of the message MAC failed" |
| 5698 | |
| 5699 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5700 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5701 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=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] | 5702 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5703 | psk_identity=def psk=beef" \ |
| 5704 | 0 \ |
| 5705 | -C "skip PMS generation for opaque PSK"\ |
| 5706 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5707 | -C "session hash for extended master secret"\ |
| 5708 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5709 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5710 | -S "SSL - Unknown identity received" \ |
| 5711 | -S "SSL - Verification of the message MAC failed" |
| 5712 | |
| 5713 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5714 | 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] | 5715 | "$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] | 5716 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5717 | psk_identity=def psk=beef" \ |
| 5718 | 0 \ |
| 5719 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5720 | -C "session hash for extended master secret"\ |
| 5721 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5722 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5723 | -S "SSL - Unknown identity received" \ |
| 5724 | -S "SSL - Verification of the message MAC failed" |
| 5725 | |
| 5726 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5727 | 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] | 5728 | "$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] | 5729 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5730 | psk_identity=def psk=beef" \ |
| 5731 | 0 \ |
| 5732 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5733 | -C "session hash for extended master secret"\ |
| 5734 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5735 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5736 | -S "SSL - Unknown identity received" \ |
| 5737 | -S "SSL - Verification of the message MAC failed" |
| 5738 | |
| 5739 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5740 | 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] | 5741 | "$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] | 5742 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5743 | psk_identity=def psk=beef" \ |
| 5744 | 1 \ |
| 5745 | -s "SSL - Verification of the message MAC failed" |
| 5746 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5747 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5748 | "$P_SRV" \ |
| 5749 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5750 | psk_identity=foo psk=abc123" \ |
| 5751 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5752 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5753 | -S "SSL - Unknown identity received" \ |
| 5754 | -S "SSL - Verification of the message MAC failed" |
| 5755 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5756 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5757 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5758 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5759 | psk_identity=foo psk=abc123" \ |
| 5760 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5761 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5762 | -s "SSL - Unknown identity received" \ |
| 5763 | -S "SSL - Verification of the message MAC failed" |
| 5764 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5765 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5766 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5767 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5768 | psk_identity=abc psk=dead" \ |
| 5769 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5770 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5771 | -S "SSL - Unknown identity received" \ |
| 5772 | -S "SSL - Verification of the message MAC failed" |
| 5773 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5774 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5775 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5776 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5777 | psk_identity=def psk=beef" \ |
| 5778 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5779 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5780 | -S "SSL - Unknown identity received" \ |
| 5781 | -S "SSL - Verification of the message MAC failed" |
| 5782 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5783 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5784 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5785 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5786 | psk_identity=ghi psk=beef" \ |
| 5787 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5788 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5789 | -s "SSL - Unknown identity received" \ |
| 5790 | -S "SSL - Verification of the message MAC failed" |
| 5791 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5792 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5793 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5794 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5795 | psk_identity=abc psk=beef" \ |
| 5796 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5797 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5798 | -S "SSL - Unknown identity received" \ |
| 5799 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5800 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5801 | # Tests for EC J-PAKE |
| 5802 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5803 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5804 | run_test "ECJPAKE: client not configured" \ |
| 5805 | "$P_SRV debug_level=3" \ |
| 5806 | "$P_CLI debug_level=3" \ |
| 5807 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5808 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5809 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5810 | -S "found ecjpake kkpp extension" \ |
| 5811 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5812 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5813 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5814 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5815 | -S "None of the common ciphersuites is usable" |
| 5816 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5817 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5818 | run_test "ECJPAKE: server not configured" \ |
| 5819 | "$P_SRV debug_level=3" \ |
| 5820 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5821 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5822 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5823 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5824 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5825 | -s "found ecjpake kkpp extension" \ |
| 5826 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5827 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5828 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5829 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5830 | -s "None of the common ciphersuites is usable" |
| 5831 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5832 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5833 | run_test "ECJPAKE: working, TLS" \ |
| 5834 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5835 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5836 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5837 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5838 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5839 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5840 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5841 | -s "found ecjpake kkpp extension" \ |
| 5842 | -S "skip ecjpake kkpp extension" \ |
| 5843 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5844 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5845 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5846 | -S "None of the common ciphersuites is usable" \ |
| 5847 | -S "SSL - Verification of the message MAC failed" |
| 5848 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5849 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5850 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5851 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5852 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5853 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5854 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5855 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5856 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5857 | -s "SSL - Verification of the message MAC failed" |
| 5858 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5859 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5860 | run_test "ECJPAKE: working, DTLS" \ |
| 5861 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5862 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5863 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5864 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5865 | -c "re-using cached ecjpake parameters" \ |
| 5866 | -S "SSL - Verification of the message MAC failed" |
| 5867 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5868 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5869 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5870 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5871 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5872 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5873 | 0 \ |
| 5874 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5875 | -S "SSL - Verification of the message MAC failed" |
| 5876 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5877 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5878 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5879 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5880 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5881 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5882 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5883 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5884 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5885 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5886 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5887 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5888 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5889 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5890 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5891 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5892 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5893 | 0 |
| 5894 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5895 | # Tests for ciphersuites per version |
| 5896 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5897 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5898 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5899 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5900 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5901 | "$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] | 5902 | "$P_CLI force_version=ssl3" \ |
| 5903 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5904 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5905 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5906 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5907 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5908 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5909 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5910 | "$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] | 5911 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5912 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5913 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5914 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5915 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5916 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5917 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5918 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5919 | "$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] | 5920 | "$P_CLI force_version=tls1_1" \ |
| 5921 | 0 \ |
| 5922 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5923 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5925 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5926 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5927 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5928 | "$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] | 5929 | "$P_CLI force_version=tls1_2" \ |
| 5930 | 0 \ |
| 5931 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5932 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5933 | # Test for ClientHello without extensions |
| 5934 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5935 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5936 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5937 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5938 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5939 | 0 \ |
| 5940 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5941 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5942 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5943 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5944 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5945 | "$P_SRV" \ |
| 5946 | "$P_CLI request_size=100" \ |
| 5947 | 0 \ |
| 5948 | -s "Read from client: 100 bytes read$" |
| 5949 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5950 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5951 | "$P_SRV" \ |
| 5952 | "$P_CLI request_size=500" \ |
| 5953 | 0 \ |
| 5954 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5955 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5956 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5957 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5958 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5959 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5960 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5961 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5962 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5963 | 0 \ |
| 5964 | -s "Read from client: 1 bytes read" |
| 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 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5968 | "$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] | 5969 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5970 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5971 | 0 \ |
| 5972 | -s "Read from client: 1 bytes read" |
| 5973 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5974 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5975 | "$P_SRV" \ |
| 5976 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5977 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5978 | 0 \ |
| 5979 | -s "Read from client: 1 bytes read" |
| 5980 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5981 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 5982 | "$P_SRV" \ |
| 5983 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5984 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5985 | 0 \ |
| 5986 | -s "Read from client: 1 bytes read" |
| 5987 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5988 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5989 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5990 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5991 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5992 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5993 | 0 \ |
| 5994 | -s "Read from client: 1 bytes read" |
| 5995 | |
Hanno Becker | 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, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5998 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5999 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6000 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6001 | 0 \ |
| 6002 | -s "Read from client: 1 bytes read" |
| 6003 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6004 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6005 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6006 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6007 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6008 | 0 \ |
| 6009 | -s "Read from client: 1 bytes read" |
| 6010 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6011 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6012 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6013 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6014 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6015 | 0 \ |
| 6016 | -s "Read from client: 1 bytes read" |
| 6017 | |
| 6018 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6019 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6020 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6021 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6022 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6023 | 0 \ |
| 6024 | -s "Read from client: 1 bytes read" |
| 6025 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6026 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6027 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6028 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6029 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6030 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6031 | 0 \ |
| 6032 | -s "Read from client: 1 bytes read" |
| 6033 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6034 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6035 | "$P_SRV" \ |
| 6036 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6037 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6038 | 0 \ |
| 6039 | -s "Read from client: 1 bytes read" |
| 6040 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6041 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6042 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6043 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6044 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6045 | 0 \ |
| 6046 | -s "Read from client: 1 bytes read" |
| 6047 | |
| 6048 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6049 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6050 | "$P_SRV trunc_hmac=1" \ |
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 trunc_hmac=1" \ |
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, without EtM, 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 etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6061 | 0 \ |
| 6062 | -s "Read from client: 1 bytes read" |
| 6063 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6064 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6065 | "$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] | 6066 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6067 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6068 | 0 \ |
| 6069 | -s "Read from client: 1 bytes read" |
| 6070 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6071 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6072 | "$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] | 6073 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6074 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6075 | 0 \ |
| 6076 | -s "Read from client: 1 bytes read" |
| 6077 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6078 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6079 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6080 | "$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] | 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 trunc_hmac=1" \ |
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 | 32c5501 | 2017-11-10 08:42:54 +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, without EtM, 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 etm=0" \ |
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 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6094 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6095 | "$P_SRV" \ |
| 6096 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6097 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6098 | 0 \ |
| 6099 | -s "Read from client: 1 bytes read" |
| 6100 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6101 | 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] | 6102 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6103 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6104 | 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] | 6105 | 0 \ |
| 6106 | -s "Read from client: 1 bytes read" |
| 6107 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6108 | 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] | 6109 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6110 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6111 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6112 | 0 \ |
| 6113 | -s "Read from client: 1 bytes read" |
| 6114 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6115 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6116 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6117 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6118 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6119 | 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] | 6120 | 0 \ |
| 6121 | -s "Read from client: 1 bytes read" |
| 6122 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +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, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6125 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [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 etm=0" \ |
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 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6131 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6132 | "$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] | 6133 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6134 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6135 | 0 \ |
| 6136 | -s "Read from client: 1 bytes read" |
| 6137 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6138 | 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] | 6139 | "$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] | 6140 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6141 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6142 | 0 \ |
| 6143 | -s "Read from client: 1 bytes read" |
| 6144 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6145 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6146 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6147 | "$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] | 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 trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6150 | 0 \ |
| 6151 | -s "Read from client: 1 bytes read" |
| 6152 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +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, without EtM, 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" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [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 etm=0" \ |
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 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6161 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6162 | "$P_SRV" \ |
| 6163 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6164 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6165 | 0 \ |
| 6166 | -s "Read from client: 1 bytes read" |
| 6167 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6168 | 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] | 6169 | "$P_SRV" \ |
| 6170 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6171 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6172 | 0 \ |
| 6173 | -s "Read from client: 1 bytes read" |
| 6174 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6175 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6176 | |
| 6177 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6178 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6179 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6180 | "$P_CLI dtls=1 request_size=1 \ |
| 6181 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6182 | 0 \ |
| 6183 | -s "Read from client: 1 bytes read" |
| 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, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6187 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 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 |
| 6194 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6195 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6196 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6197 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6198 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6199 | 0 \ |
| 6200 | -s "Read from client: 1 bytes read" |
| 6201 | |
| 6202 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6203 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6204 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6205 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6206 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6207 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6208 | 0 \ |
| 6209 | -s "Read from client: 1 bytes read" |
| 6210 | |
| 6211 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6212 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6213 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 6214 | "$P_CLI dtls=1 request_size=1 \ |
| 6215 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 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, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6221 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 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 |
| 6228 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6229 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6230 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6231 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6232 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6233 | 0 \ |
| 6234 | -s "Read from client: 1 bytes read" |
| 6235 | |
| 6236 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6237 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6238 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6239 | "$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] | 6240 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6241 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6242 | 0 \ |
| 6243 | -s "Read from client: 1 bytes read" |
| 6244 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6245 | # Tests for small server packets |
| 6246 | |
| 6247 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6248 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6249 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6250 | "$P_CLI force_version=ssl3 \ |
| 6251 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6252 | 0 \ |
| 6253 | -c "Read from server: 1 bytes read" |
| 6254 | |
| 6255 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6256 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6257 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6258 | "$P_CLI force_version=ssl3 \ |
| 6259 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6260 | 0 \ |
| 6261 | -c "Read from server: 1 bytes read" |
| 6262 | |
| 6263 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6264 | "$P_SRV response_size=1" \ |
| 6265 | "$P_CLI force_version=tls1 \ |
| 6266 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6267 | 0 \ |
| 6268 | -c "Read from server: 1 bytes read" |
| 6269 | |
| 6270 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6271 | "$P_SRV response_size=1" \ |
| 6272 | "$P_CLI force_version=tls1 etm=0 \ |
| 6273 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6274 | 0 \ |
| 6275 | -c "Read from server: 1 bytes read" |
| 6276 | |
| 6277 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6278 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6279 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6280 | "$P_CLI force_version=tls1 \ |
| 6281 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 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, without EtM, 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 etm=0" \ |
| 6290 | 0 \ |
| 6291 | -c "Read from server: 1 bytes read" |
| 6292 | |
| 6293 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6294 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6295 | "$P_CLI force_version=tls1 \ |
| 6296 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6297 | 0 \ |
| 6298 | -c "Read from server: 1 bytes read" |
| 6299 | |
| 6300 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6301 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6302 | "$P_CLI force_version=tls1 \ |
| 6303 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6304 | 0 \ |
| 6305 | -c "Read from server: 1 bytes read" |
| 6306 | |
| 6307 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6308 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6309 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6310 | "$P_CLI force_version=tls1 \ |
| 6311 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 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, without EtM, 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 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6319 | trunc_hmac=1 etm=0" \ |
| 6320 | 0 \ |
| 6321 | -c "Read from server: 1 bytes read" |
| 6322 | |
| 6323 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6324 | "$P_SRV response_size=1" \ |
| 6325 | "$P_CLI force_version=tls1_1 \ |
| 6326 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6327 | 0 \ |
| 6328 | -c "Read from server: 1 bytes read" |
| 6329 | |
| 6330 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6331 | "$P_SRV response_size=1" \ |
| 6332 | "$P_CLI force_version=tls1_1 \ |
| 6333 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6334 | 0 \ |
| 6335 | -c "Read from server: 1 bytes read" |
| 6336 | |
| 6337 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6338 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6339 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6340 | "$P_CLI force_version=tls1_1 \ |
| 6341 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 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, without EtM, 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 etm=0" \ |
| 6350 | 0 \ |
| 6351 | -c "Read from server: 1 bytes read" |
| 6352 | |
| 6353 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6354 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6355 | "$P_CLI force_version=tls1_1 \ |
| 6356 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6357 | 0 \ |
| 6358 | -c "Read from server: 1 bytes read" |
| 6359 | |
| 6360 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6361 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6362 | "$P_CLI force_version=tls1_1 \ |
| 6363 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6364 | 0 \ |
| 6365 | -c "Read from server: 1 bytes read" |
| 6366 | |
| 6367 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6368 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6369 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6370 | "$P_CLI force_version=tls1_1 \ |
| 6371 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 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, without EtM, 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 etm=0" \ |
| 6380 | 0 \ |
| 6381 | -c "Read from server: 1 bytes read" |
| 6382 | |
| 6383 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6384 | "$P_SRV response_size=1" \ |
| 6385 | "$P_CLI force_version=tls1_2 \ |
| 6386 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6387 | 0 \ |
| 6388 | -c "Read from server: 1 bytes read" |
| 6389 | |
| 6390 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6391 | "$P_SRV response_size=1" \ |
| 6392 | "$P_CLI force_version=tls1_2 \ |
| 6393 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6394 | 0 \ |
| 6395 | -c "Read from server: 1 bytes read" |
| 6396 | |
| 6397 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6398 | "$P_SRV response_size=1" \ |
| 6399 | "$P_CLI force_version=tls1_2 \ |
| 6400 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6401 | 0 \ |
| 6402 | -c "Read from server: 1 bytes read" |
| 6403 | |
| 6404 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6405 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6406 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6407 | "$P_CLI force_version=tls1_2 \ |
| 6408 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 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, without EtM, 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 etm=0" \ |
| 6417 | 0 \ |
| 6418 | -c "Read from server: 1 bytes read" |
| 6419 | |
| 6420 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6421 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6422 | "$P_CLI force_version=tls1_2 \ |
| 6423 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6424 | 0 \ |
| 6425 | -c "Read from server: 1 bytes read" |
| 6426 | |
| 6427 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6428 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6429 | "$P_CLI force_version=tls1_2 \ |
| 6430 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6431 | 0 \ |
| 6432 | -c "Read from server: 1 bytes read" |
| 6433 | |
| 6434 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6435 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6436 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6437 | "$P_CLI force_version=tls1_2 \ |
| 6438 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 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, without EtM, 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 etm=0" \ |
| 6447 | 0 \ |
| 6448 | -c "Read from server: 1 bytes read" |
| 6449 | |
| 6450 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6451 | "$P_SRV response_size=1" \ |
| 6452 | "$P_CLI force_version=tls1_2 \ |
| 6453 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6454 | 0 \ |
| 6455 | -c "Read from server: 1 bytes read" |
| 6456 | |
| 6457 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6458 | "$P_SRV response_size=1" \ |
| 6459 | "$P_CLI force_version=tls1_2 \ |
| 6460 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6461 | 0 \ |
| 6462 | -c "Read from server: 1 bytes read" |
| 6463 | |
| 6464 | # Tests for small server packets in DTLS |
| 6465 | |
| 6466 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6467 | run_test "Small server packet DTLS 1.0" \ |
| 6468 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6469 | "$P_CLI dtls=1 \ |
| 6470 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6471 | 0 \ |
| 6472 | -c "Read from server: 1 bytes read" |
| 6473 | |
| 6474 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6475 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6476 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 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 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6484 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6485 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6486 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6487 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6488 | 0 \ |
| 6489 | -c "Read from server: 1 bytes read" |
| 6490 | |
| 6491 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6492 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6493 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6494 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6495 | "$P_CLI dtls=1 \ |
| 6496 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6497 | 0 \ |
| 6498 | -c "Read from server: 1 bytes read" |
| 6499 | |
| 6500 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6501 | run_test "Small server packet DTLS 1.2" \ |
| 6502 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6503 | "$P_CLI dtls=1 \ |
| 6504 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 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, without EtM" \ |
| 6510 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 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 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6518 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6519 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6520 | "$P_CLI dtls=1 \ |
| 6521 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6522 | 0 \ |
| 6523 | -c "Read from server: 1 bytes read" |
| 6524 | |
| 6525 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6526 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6527 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6528 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6529 | "$P_CLI dtls=1 \ |
| 6530 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6531 | 0 \ |
| 6532 | -c "Read from server: 1 bytes read" |
| 6533 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6534 | # A test for extensions in SSLv3 |
| 6535 | |
| 6536 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6537 | run_test "SSLv3 with extensions, server side" \ |
| 6538 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6539 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6540 | 0 \ |
| 6541 | -S "dumping 'client hello extensions'" \ |
| 6542 | -S "server hello, total extension length:" |
| 6543 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6544 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6545 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6546 | # How many fragments do we expect to write $1 bytes? |
| 6547 | fragments_for_write() { |
| 6548 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6549 | } |
| 6550 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6551 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6552 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6553 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6554 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6555 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6556 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6557 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6558 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6559 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6560 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6561 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6562 | "$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] | 6563 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6564 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6565 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6566 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6567 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6568 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6569 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6570 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6571 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6572 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-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, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6578 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6579 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 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 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6583 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6584 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6585 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6586 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6587 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6588 | 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] | 6589 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6590 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6591 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6592 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6593 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6594 | 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] | 6595 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6596 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6597 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6598 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6599 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6600 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6601 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6602 | "$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] | 6603 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6604 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6605 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6606 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6607 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6608 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6609 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6610 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6611 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6612 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6613 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6614 | |
| 6615 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6616 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6617 | "$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] | 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 trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [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" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6622 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 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, without EtM, 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" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [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 etm=0" \ |
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 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6630 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6631 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6632 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6633 | "$P_SRV" \ |
| 6634 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6635 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 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, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6641 | "$P_SRV" \ |
| 6642 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6643 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6644 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6645 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6646 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6647 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6648 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6649 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6650 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6651 | 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] | 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, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6657 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [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 etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [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" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6662 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6663 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6664 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6665 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6666 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6667 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6668 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6669 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [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, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6672 | "$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] | 6673 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6674 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 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 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6679 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6680 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6681 | "$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] | 6682 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6683 | 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] | 6684 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 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, without EtM, 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" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [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 etm=0" \ |
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 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6694 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6695 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6696 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6697 | "$P_SRV" \ |
| 6698 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6699 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 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, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6705 | "$P_SRV" \ |
| 6706 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 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 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6710 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6711 | 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] | 6712 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6713 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6714 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6715 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6716 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6717 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6718 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6719 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6720 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6721 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6722 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6723 | 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] | 6724 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 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 | 278fc7a | 2017-11-10 09:16:28 +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, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6729 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [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 etm=0" \ |
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 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6734 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6735 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6736 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6737 | "$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] | 6738 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6739 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 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, without EtM" \ |
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 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6747 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6748 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6749 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6750 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6751 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6752 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6753 | "$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] | 6754 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6755 | 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] | 6756 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6757 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6758 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +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, without EtM, 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" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [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 etm=0" \ |
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 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6766 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6767 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6768 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6769 | "$P_SRV" \ |
| 6770 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6771 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 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 shorter tag" \ |
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-8" \ |
| 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 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6785 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6786 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 6787 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6788 | "$P_CLI force_version=ssl3 \ |
| 6789 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6790 | 0 \ |
| 6791 | -c "Read from server: 16384 bytes read" |
| 6792 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6793 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 6794 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6795 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 6796 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 6797 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 6798 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6799 | 0 \ |
| 6800 | -c "Read from server: 1 bytes read"\ |
| 6801 | -c "16383 bytes read"\ |
| 6802 | -C "Read from server: 16384 bytes read" |
| 6803 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6804 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6805 | "$P_SRV response_size=16384" \ |
| 6806 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6807 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6808 | 0 \ |
| 6809 | -c "Read from server: 1 bytes read"\ |
| 6810 | -c "16383 bytes read"\ |
| 6811 | -C "Read from server: 16384 bytes read" |
| 6812 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6813 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6814 | "$P_SRV response_size=16384" \ |
| 6815 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6816 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6817 | 0 \ |
| 6818 | -c "Read from server: 1 bytes read"\ |
| 6819 | -c "16383 bytes read"\ |
| 6820 | -C "Read from server: 16384 bytes read" |
| 6821 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6822 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6823 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6824 | "$P_SRV response_size=16384" \ |
| 6825 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6826 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6827 | trunc_hmac=1" \ |
| 6828 | 0 \ |
| 6829 | -c "Read from server: 1 bytes read"\ |
| 6830 | -c "16383 bytes read"\ |
| 6831 | -C "Read from server: 16384 bytes read" |
| 6832 | |
| 6833 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6834 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6835 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6836 | "$P_CLI force_version=tls1 \ |
| 6837 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6838 | trunc_hmac=1" \ |
| 6839 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6840 | -s "16384 bytes written in 1 fragments" \ |
| 6841 | -c "Read from server: 16384 bytes read" |
| 6842 | |
| 6843 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6844 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6845 | "$P_CLI force_version=tls1 \ |
| 6846 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6847 | 0 \ |
| 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, without EtM" \ |
| 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 etm=0" \ |
| 6855 | 0 \ |
| 6856 | -s "16384 bytes written in 1 fragments" \ |
| 6857 | -c "Read from server: 16384 bytes read" |
| 6858 | |
| 6859 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6860 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6861 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6862 | "$P_CLI force_version=tls1 \ |
| 6863 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6864 | 0 \ |
| 6865 | -s "16384 bytes written in 1 fragments" \ |
| 6866 | -c "Read from server: 16384 bytes read" |
| 6867 | |
| 6868 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6869 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6870 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6871 | "$P_CLI force_version=tls1 \ |
| 6872 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6873 | 0 \ |
| 6874 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6875 | -c "Read from server: 16384 bytes read" |
| 6876 | |
| 6877 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6878 | "$P_SRV response_size=16384" \ |
| 6879 | "$P_CLI force_version=tls1_1 \ |
| 6880 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6881 | 0 \ |
| 6882 | -c "Read from server: 16384 bytes read" |
| 6883 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6884 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6885 | "$P_SRV response_size=16384" \ |
| 6886 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6887 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6888 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6889 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6890 | -c "Read from server: 16384 bytes read" |
| 6891 | |
| 6892 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6893 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6894 | "$P_SRV response_size=16384" \ |
| 6895 | "$P_CLI force_version=tls1_1 \ |
| 6896 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6897 | trunc_hmac=1" \ |
| 6898 | 0 \ |
| 6899 | -c "Read from server: 16384 bytes read" |
| 6900 | |
| 6901 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6902 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6903 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6904 | "$P_CLI force_version=tls1_1 \ |
| 6905 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6906 | 0 \ |
| 6907 | -s "16384 bytes written in 1 fragments" \ |
| 6908 | -c "Read from server: 16384 bytes read" |
| 6909 | |
| 6910 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6911 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6912 | "$P_CLI force_version=tls1_1 \ |
| 6913 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6914 | 0 \ |
| 6915 | -c "Read from server: 16384 bytes read" |
| 6916 | |
| 6917 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6918 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6919 | "$P_CLI force_version=tls1_1 \ |
| 6920 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6921 | 0 \ |
| 6922 | -s "16384 bytes written in 1 fragments" \ |
| 6923 | -c "Read from server: 16384 bytes read" |
| 6924 | |
| 6925 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6926 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 6927 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6928 | "$P_CLI force_version=tls1_1 \ |
| 6929 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6930 | trunc_hmac=1" \ |
| 6931 | 0 \ |
| 6932 | -c "Read from server: 16384 bytes read" |
| 6933 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6934 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6935 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6936 | "$P_CLI force_version=tls1_1 \ |
| 6937 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6938 | 0 \ |
| 6939 | -s "16384 bytes written in 1 fragments" \ |
| 6940 | -c "Read from server: 16384 bytes read" |
| 6941 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6942 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6943 | "$P_SRV response_size=16384" \ |
| 6944 | "$P_CLI force_version=tls1_2 \ |
| 6945 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6946 | 0 \ |
| 6947 | -c "Read from server: 16384 bytes read" |
| 6948 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6949 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6950 | "$P_SRV response_size=16384" \ |
| 6951 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6952 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6953 | 0 \ |
| 6954 | -s "16384 bytes written in 1 fragments" \ |
| 6955 | -c "Read from server: 16384 bytes read" |
| 6956 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6957 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6958 | "$P_SRV response_size=16384" \ |
| 6959 | "$P_CLI force_version=tls1_2 \ |
| 6960 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6961 | 0 \ |
| 6962 | -c "Read from server: 16384 bytes read" |
| 6963 | |
| 6964 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6965 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6966 | "$P_SRV response_size=16384" \ |
| 6967 | "$P_CLI force_version=tls1_2 \ |
| 6968 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6969 | trunc_hmac=1" \ |
| 6970 | 0 \ |
| 6971 | -c "Read from server: 16384 bytes read" |
| 6972 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6973 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6974 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6975 | "$P_CLI force_version=tls1_2 \ |
| 6976 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6977 | 0 \ |
| 6978 | -s "16384 bytes written in 1 fragments" \ |
| 6979 | -c "Read from server: 16384 bytes read" |
| 6980 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6981 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 6982 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6983 | "$P_CLI force_version=tls1_2 \ |
| 6984 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6985 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6986 | -s "16384 bytes written in 1 fragments" \ |
| 6987 | -c "Read from server: 16384 bytes read" |
| 6988 | |
| 6989 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 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 etm=0" \ |
| 6993 | 0 \ |
| 6994 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6995 | -c "Read from server: 16384 bytes read" |
| 6996 | |
| 6997 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6998 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 6999 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7000 | "$P_CLI force_version=tls1_2 \ |
| 7001 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7002 | trunc_hmac=1" \ |
| 7003 | 0 \ |
| 7004 | -c "Read from server: 16384 bytes read" |
| 7005 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7006 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7007 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7008 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7009 | "$P_CLI force_version=tls1_2 \ |
| 7010 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7011 | 0 \ |
| 7012 | -s "16384 bytes written in 1 fragments" \ |
| 7013 | -c "Read from server: 16384 bytes read" |
| 7014 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7015 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 7016 | "$P_SRV response_size=16384" \ |
| 7017 | "$P_CLI force_version=tls1_2 \ |
| 7018 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7019 | 0 \ |
| 7020 | -c "Read from server: 16384 bytes read" |
| 7021 | |
| 7022 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 7023 | "$P_SRV response_size=16384" \ |
| 7024 | "$P_CLI force_version=tls1_2 \ |
| 7025 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7026 | 0 \ |
| 7027 | -c "Read from server: 16384 bytes read" |
| 7028 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7029 | # Tests for restartable ECC |
| 7030 | |
| 7031 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7032 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7033 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7034 | "$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] | 7035 | 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] | 7036 | debug_level=1" \ |
| 7037 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7038 | -C "x509_verify_cert.*4b00" \ |
| 7039 | -C "mbedtls_pk_verify.*4b00" \ |
| 7040 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7041 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7042 | |
| 7043 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7044 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7045 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7046 | "$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] | 7047 | 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] | 7048 | debug_level=1 ec_max_ops=0" \ |
| 7049 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7050 | -C "x509_verify_cert.*4b00" \ |
| 7051 | -C "mbedtls_pk_verify.*4b00" \ |
| 7052 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7053 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7054 | |
| 7055 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7056 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7057 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7058 | "$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] | 7059 | 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] | 7060 | debug_level=1 ec_max_ops=65535" \ |
| 7061 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7062 | -C "x509_verify_cert.*4b00" \ |
| 7063 | -C "mbedtls_pk_verify.*4b00" \ |
| 7064 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7065 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7066 | |
| 7067 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7068 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7069 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7070 | "$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] | 7071 | 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] | 7072 | debug_level=1 ec_max_ops=1000" \ |
| 7073 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7074 | -c "x509_verify_cert.*4b00" \ |
| 7075 | -c "mbedtls_pk_verify.*4b00" \ |
| 7076 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7077 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7078 | |
| 7079 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7080 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7081 | "$P_SRV auth_mode=required \ |
| 7082 | crt_file=data_files/server5-badsign.crt \ |
| 7083 | key_file=data_files/server5.key" \ |
| 7084 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7085 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7086 | debug_level=1 ec_max_ops=1000" \ |
| 7087 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7088 | -c "x509_verify_cert.*4b00" \ |
| 7089 | -C "mbedtls_pk_verify.*4b00" \ |
| 7090 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7091 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7092 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7093 | -c "! mbedtls_ssl_handshake returned" \ |
| 7094 | -c "X509 - Certificate verification failed" |
| 7095 | |
| 7096 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7097 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7098 | "$P_SRV auth_mode=required \ |
| 7099 | crt_file=data_files/server5-badsign.crt \ |
| 7100 | key_file=data_files/server5.key" \ |
| 7101 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7102 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7103 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7104 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7105 | -c "x509_verify_cert.*4b00" \ |
| 7106 | -c "mbedtls_pk_verify.*4b00" \ |
| 7107 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7108 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7109 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7110 | -C "! mbedtls_ssl_handshake returned" \ |
| 7111 | -C "X509 - Certificate verification failed" |
| 7112 | |
| 7113 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7114 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7115 | "$P_SRV auth_mode=required \ |
| 7116 | crt_file=data_files/server5-badsign.crt \ |
| 7117 | key_file=data_files/server5.key" \ |
| 7118 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7119 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7120 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7121 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7122 | -C "x509_verify_cert.*4b00" \ |
| 7123 | -c "mbedtls_pk_verify.*4b00" \ |
| 7124 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7125 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7126 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7127 | -C "! mbedtls_ssl_handshake returned" \ |
| 7128 | -C "X509 - Certificate verification failed" |
| 7129 | |
| 7130 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7131 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7132 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7133 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7134 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7135 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7136 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7137 | -c "x509_verify_cert.*4b00" \ |
| 7138 | -c "mbedtls_pk_verify.*4b00" \ |
| 7139 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7140 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7141 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7142 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7143 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7144 | "$P_SRV" \ |
| 7145 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7146 | debug_level=1 ec_max_ops=1000" \ |
| 7147 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7148 | -c "x509_verify_cert.*4b00" \ |
| 7149 | -c "mbedtls_pk_verify.*4b00" \ |
| 7150 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7151 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7152 | |
| 7153 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7154 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 7155 | "$P_SRV psk=abc123" \ |
| 7156 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7157 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7158 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7159 | -C "x509_verify_cert.*4b00" \ |
| 7160 | -C "mbedtls_pk_verify.*4b00" \ |
| 7161 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7162 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7163 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7164 | # Tests of asynchronous private key support in SSL |
| 7165 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7166 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7167 | run_test "SSL async private: sign, delay=0" \ |
| 7168 | "$P_SRV \ |
| 7169 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7170 | "$P_CLI" \ |
| 7171 | 0 \ |
| 7172 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7173 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7174 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7175 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7176 | run_test "SSL async private: sign, delay=1" \ |
| 7177 | "$P_SRV \ |
| 7178 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7179 | "$P_CLI" \ |
| 7180 | 0 \ |
| 7181 | -s "Async sign callback: using key slot " \ |
| 7182 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7183 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7184 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7185 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7186 | run_test "SSL async private: sign, delay=2" \ |
| 7187 | "$P_SRV \ |
| 7188 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7189 | "$P_CLI" \ |
| 7190 | 0 \ |
| 7191 | -s "Async sign callback: using key slot " \ |
| 7192 | -U "Async sign callback: using key slot " \ |
| 7193 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7194 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7195 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7196 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7197 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7198 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7199 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7201 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7202 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7203 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7204 | "$P_CLI force_version=tls1_1" \ |
| 7205 | 0 \ |
| 7206 | -s "Async sign callback: using key slot " \ |
| 7207 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7208 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7209 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7210 | run_test "SSL async private: sign, SNI" \ |
| 7211 | "$P_SRV debug_level=3 \ |
| 7212 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7213 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7214 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7215 | "$P_CLI server_name=polarssl.example" \ |
| 7216 | 0 \ |
| 7217 | -s "Async sign callback: using key slot " \ |
| 7218 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7219 | -s "parse ServerName extension" \ |
| 7220 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7221 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7222 | |
| 7223 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7224 | run_test "SSL async private: decrypt, delay=0" \ |
| 7225 | "$P_SRV \ |
| 7226 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7227 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7228 | 0 \ |
| 7229 | -s "Async decrypt callback: using key slot " \ |
| 7230 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7231 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7232 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7233 | run_test "SSL async private: decrypt, delay=1" \ |
| 7234 | "$P_SRV \ |
| 7235 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7236 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7237 | 0 \ |
| 7238 | -s "Async decrypt callback: using key slot " \ |
| 7239 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7240 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7241 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7242 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7243 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7244 | "$P_SRV psk=abc123 \ |
| 7245 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7246 | "$P_CLI psk=abc123 \ |
| 7247 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7248 | 0 \ |
| 7249 | -s "Async decrypt callback: using key slot " \ |
| 7250 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7251 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7252 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7253 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7254 | "$P_SRV psk=abc123 \ |
| 7255 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7256 | "$P_CLI psk=abc123 \ |
| 7257 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7258 | 0 \ |
| 7259 | -s "Async decrypt callback: using key slot " \ |
| 7260 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7261 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7262 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7263 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7264 | run_test "SSL async private: sign callback not present" \ |
| 7265 | "$P_SRV \ |
| 7266 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7267 | "$P_CLI; [ \$? -eq 1 ] && |
| 7268 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7269 | 0 \ |
| 7270 | -S "Async sign callback" \ |
| 7271 | -s "! mbedtls_ssl_handshake returned" \ |
| 7272 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7273 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7274 | -s "Successful connection" |
| 7275 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7276 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7277 | run_test "SSL async private: decrypt callback not present" \ |
| 7278 | "$P_SRV debug_level=1 \ |
| 7279 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7280 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7281 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7282 | 0 \ |
| 7283 | -S "Async decrypt callback" \ |
| 7284 | -s "! mbedtls_ssl_handshake returned" \ |
| 7285 | -s "got no RSA private key" \ |
| 7286 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7287 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7288 | |
| 7289 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7290 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7291 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7292 | "$P_SRV \ |
| 7293 | async_operations=s async_private_delay1=1 \ |
| 7294 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7295 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7296 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7297 | 0 \ |
| 7298 | -s "Async sign callback: using key slot 0," \ |
| 7299 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7300 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7301 | |
| 7302 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7303 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7304 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7305 | "$P_SRV \ |
| 7306 | async_operations=s async_private_delay2=1 \ |
| 7307 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7308 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7309 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7310 | 0 \ |
| 7311 | -s "Async sign callback: using key slot 0," \ |
| 7312 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7313 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7314 | |
| 7315 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7316 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7317 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7318 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7319 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7320 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7321 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7322 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7323 | 0 \ |
| 7324 | -s "Async sign callback: using key slot 1," \ |
| 7325 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7326 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7327 | |
| 7328 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7329 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7330 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7331 | "$P_SRV \ |
| 7332 | async_operations=s async_private_delay1=1 \ |
| 7333 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7334 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7335 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7336 | 0 \ |
| 7337 | -s "Async sign callback: no key matches this certificate." |
| 7338 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7339 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7340 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7341 | "$P_SRV \ |
| 7342 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7343 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7344 | "$P_CLI" \ |
| 7345 | 1 \ |
| 7346 | -s "Async sign callback: injected error" \ |
| 7347 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7348 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7349 | -s "! mbedtls_ssl_handshake returned" |
| 7350 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7351 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7352 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7353 | "$P_SRV \ |
| 7354 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7355 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7356 | "$P_CLI" \ |
| 7357 | 1 \ |
| 7358 | -s "Async sign callback: using key slot " \ |
| 7359 | -S "Async resume" \ |
| 7360 | -s "Async cancel" |
| 7361 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7362 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7363 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7364 | "$P_SRV \ |
| 7365 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7366 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7367 | "$P_CLI" \ |
| 7368 | 1 \ |
| 7369 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7370 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7371 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7372 | -s "! mbedtls_ssl_handshake returned" |
| 7373 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7374 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7375 | run_test "SSL async private: decrypt, error in start" \ |
| 7376 | "$P_SRV \ |
| 7377 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7378 | async_private_error=1" \ |
| 7379 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7380 | 1 \ |
| 7381 | -s "Async decrypt callback: injected error" \ |
| 7382 | -S "Async resume" \ |
| 7383 | -S "Async cancel" \ |
| 7384 | -s "! mbedtls_ssl_handshake returned" |
| 7385 | |
| 7386 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7387 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7388 | "$P_SRV \ |
| 7389 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7390 | async_private_error=2" \ |
| 7391 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7392 | 1 \ |
| 7393 | -s "Async decrypt callback: using key slot " \ |
| 7394 | -S "Async resume" \ |
| 7395 | -s "Async cancel" |
| 7396 | |
| 7397 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7398 | run_test "SSL async private: decrypt, error in resume" \ |
| 7399 | "$P_SRV \ |
| 7400 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7401 | async_private_error=3" \ |
| 7402 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7403 | 1 \ |
| 7404 | -s "Async decrypt callback: using key slot " \ |
| 7405 | -s "Async resume callback: decrypt done but injected error" \ |
| 7406 | -S "Async cancel" \ |
| 7407 | -s "! mbedtls_ssl_handshake returned" |
| 7408 | |
| 7409 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7410 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7411 | "$P_SRV \ |
| 7412 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7413 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7414 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7415 | 0 \ |
| 7416 | -s "Async cancel" \ |
| 7417 | -s "! mbedtls_ssl_handshake returned" \ |
| 7418 | -s "Async resume" \ |
| 7419 | -s "Successful connection" |
| 7420 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7421 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7422 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7423 | "$P_SRV \ |
| 7424 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7425 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7426 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7427 | 0 \ |
| 7428 | -s "! mbedtls_ssl_handshake returned" \ |
| 7429 | -s "Async resume" \ |
| 7430 | -s "Successful connection" |
| 7431 | |
| 7432 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7433 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7434 | 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] | 7435 | "$P_SRV \ |
| 7436 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7437 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7438 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7439 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7440 | [ \$? -eq 1 ] && |
| 7441 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7442 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7443 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7444 | -S "Async resume" \ |
| 7445 | -s "Async cancel" \ |
| 7446 | -s "! mbedtls_ssl_handshake returned" \ |
| 7447 | -s "Async sign callback: no key matches this certificate." \ |
| 7448 | -s "Successful connection" |
| 7449 | |
| 7450 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7451 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7452 | 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] | 7453 | "$P_SRV \ |
| 7454 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7455 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7456 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7457 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7458 | [ \$? -eq 1 ] && |
| 7459 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7460 | 0 \ |
| 7461 | -s "Async resume" \ |
| 7462 | -s "! mbedtls_ssl_handshake returned" \ |
| 7463 | -s "Async sign callback: no key matches this certificate." \ |
| 7464 | -s "Successful connection" |
| 7465 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7466 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7467 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7468 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7469 | "$P_SRV \ |
| 7470 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7471 | exchanges=2 renegotiation=1" \ |
| 7472 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7473 | 0 \ |
| 7474 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7475 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7476 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7477 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7478 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7479 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7480 | "$P_SRV \ |
| 7481 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7482 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7483 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7484 | 0 \ |
| 7485 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7486 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7487 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7488 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7489 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7490 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7491 | "$P_SRV \ |
| 7492 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7493 | exchanges=2 renegotiation=1" \ |
| 7494 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7495 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7496 | 0 \ |
| 7497 | -s "Async decrypt callback: using key slot " \ |
| 7498 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7499 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7500 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7501 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7502 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7503 | "$P_SRV \ |
| 7504 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7505 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7506 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7507 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7508 | 0 \ |
| 7509 | -s "Async decrypt callback: using key slot " \ |
| 7510 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7511 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7512 | # Tests for ECC extensions (rfc 4492) |
| 7513 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7514 | requires_config_enabled MBEDTLS_AES_C |
| 7515 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7516 | requires_config_enabled MBEDTLS_SHA256_C |
| 7517 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7518 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7519 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7520 | "$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] | 7521 | 0 \ |
| 7522 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7523 | -C "client hello, adding supported_point_formats extension" \ |
| 7524 | -S "found supported elliptic curves extension" \ |
| 7525 | -S "found supported point formats extension" |
| 7526 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7527 | requires_config_enabled MBEDTLS_AES_C |
| 7528 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7529 | requires_config_enabled MBEDTLS_SHA256_C |
| 7530 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7531 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7532 | "$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] | 7533 | "$P_CLI debug_level=3" \ |
| 7534 | 0 \ |
| 7535 | -C "found supported_point_formats extension" \ |
| 7536 | -S "server hello, supported_point_formats extension" |
| 7537 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7538 | requires_config_enabled MBEDTLS_AES_C |
| 7539 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7540 | requires_config_enabled MBEDTLS_SHA256_C |
| 7541 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7542 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7543 | "$P_SRV debug_level=3" \ |
| 7544 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7545 | 0 \ |
| 7546 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7547 | -c "client hello, adding supported_point_formats extension" \ |
| 7548 | -s "found supported elliptic curves extension" \ |
| 7549 | -s "found supported point formats extension" |
| 7550 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7551 | requires_config_enabled MBEDTLS_AES_C |
| 7552 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7553 | requires_config_enabled MBEDTLS_SHA256_C |
| 7554 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7555 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7556 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7557 | "$P_CLI debug_level=3" \ |
| 7558 | 0 \ |
| 7559 | -c "found supported_point_formats extension" \ |
| 7560 | -s "server hello, supported_point_formats extension" |
| 7561 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7562 | # Tests for DTLS HelloVerifyRequest |
| 7563 | |
| 7564 | run_test "DTLS cookie: enabled" \ |
| 7565 | "$P_SRV dtls=1 debug_level=2" \ |
| 7566 | "$P_CLI dtls=1 debug_level=2" \ |
| 7567 | 0 \ |
| 7568 | -s "cookie verification failed" \ |
| 7569 | -s "cookie verification passed" \ |
| 7570 | -S "cookie verification skipped" \ |
| 7571 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7572 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7573 | -S "SSL - The requested feature is not available" |
| 7574 | |
| 7575 | run_test "DTLS cookie: disabled" \ |
| 7576 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7577 | "$P_CLI dtls=1 debug_level=2" \ |
| 7578 | 0 \ |
| 7579 | -S "cookie verification failed" \ |
| 7580 | -S "cookie verification passed" \ |
| 7581 | -s "cookie verification skipped" \ |
| 7582 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7583 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7584 | -S "SSL - The requested feature is not available" |
| 7585 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7586 | run_test "DTLS cookie: default (failing)" \ |
| 7587 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7588 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7589 | 1 \ |
| 7590 | -s "cookie verification failed" \ |
| 7591 | -S "cookie verification passed" \ |
| 7592 | -S "cookie verification skipped" \ |
| 7593 | -C "received hello verify request" \ |
| 7594 | -S "hello verification requested" \ |
| 7595 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7596 | |
| 7597 | requires_ipv6 |
| 7598 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7599 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7600 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7601 | 0 \ |
| 7602 | -s "cookie verification failed" \ |
| 7603 | -s "cookie verification passed" \ |
| 7604 | -S "cookie verification skipped" \ |
| 7605 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7606 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7607 | -S "SSL - The requested feature is not available" |
| 7608 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7609 | run_test "DTLS cookie: enabled, nbio" \ |
| 7610 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7611 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7612 | 0 \ |
| 7613 | -s "cookie verification failed" \ |
| 7614 | -s "cookie verification passed" \ |
| 7615 | -S "cookie verification skipped" \ |
| 7616 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7617 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7618 | -S "SSL - The requested feature is not available" |
| 7619 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7620 | # Tests for client reconnecting from the same port with DTLS |
| 7621 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7622 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7623 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7624 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7625 | "$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] | 7626 | 0 \ |
| 7627 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7628 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7629 | -S "Client initiated reconnection from same port" |
| 7630 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7631 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7632 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7633 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7634 | "$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] | 7635 | 0 \ |
| 7636 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7637 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7638 | -s "Client initiated reconnection from same port" |
| 7639 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7640 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7641 | 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] | 7642 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7643 | "$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] | 7644 | 0 \ |
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 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7649 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7650 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7651 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7652 | 0 \ |
| 7653 | -S "The operation timed out" \ |
| 7654 | -s "Client initiated reconnection from same port" |
| 7655 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7656 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7657 | "$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] | 7658 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7659 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7660 | -s "The operation timed out" \ |
| 7661 | -S "Client initiated reconnection from same port" |
| 7662 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7663 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7664 | -p "$P_PXY inject_clihlo=1" \ |
| 7665 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7666 | "$P_CLI dtls=1 exchanges=2" \ |
| 7667 | 0 \ |
| 7668 | -s "possible client reconnect from the same port" \ |
| 7669 | -S "Client initiated reconnection from same port" |
| 7670 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7671 | # Tests for various cases of client authentication with DTLS |
| 7672 | # (focused on handshake flows and message parsing) |
| 7673 | |
| 7674 | run_test "DTLS client auth: required" \ |
| 7675 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7676 | "$P_CLI dtls=1" \ |
| 7677 | 0 \ |
| 7678 | -s "Verifying peer X.509 certificate... ok" |
| 7679 | |
| 7680 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7681 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7682 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7683 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7684 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7685 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7686 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7687 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7688 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7689 | 0 \ |
| 7690 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7691 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7692 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7693 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7694 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7695 | "$P_CLI dtls=1 psk=abc124" \ |
| 7696 | 1 \ |
| 7697 | -s "SSL - Verification of the message MAC failed" \ |
| 7698 | -c "SSL - A fatal alert message was received from our peer" |
| 7699 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7700 | # Tests for receiving fragmented handshake messages with DTLS |
| 7701 | |
| 7702 | requires_gnutls |
| 7703 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7704 | "$G_SRV -u --mtu 2048 -a" \ |
| 7705 | "$P_CLI dtls=1 debug_level=2" \ |
| 7706 | 0 \ |
| 7707 | -C "found fragmented DTLS handshake message" \ |
| 7708 | -C "error" |
| 7709 | |
| 7710 | requires_gnutls |
| 7711 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7712 | "$G_SRV -u --mtu 512" \ |
| 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: more fragmentation (gnutls server)" \ |
| 7720 | "$G_SRV -u --mtu 128" \ |
| 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, nbio (gnutls server)" \ |
| 7728 | "$G_SRV -u --mtu 128" \ |
| 7729 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7730 | 0 \ |
| 7731 | -c "found fragmented DTLS handshake message" \ |
| 7732 | -C "error" |
| 7733 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7734 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7735 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7736 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7737 | "$G_SRV -u --mtu 256" \ |
| 7738 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7739 | 0 \ |
| 7740 | -c "found fragmented DTLS handshake message" \ |
| 7741 | -c "client hello, adding renegotiation extension" \ |
| 7742 | -c "found renegotiation extension" \ |
| 7743 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7744 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7745 | -C "error" \ |
| 7746 | -s "Extra-header:" |
| 7747 | |
| 7748 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7749 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7750 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7751 | "$G_SRV -u --mtu 256" \ |
| 7752 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7753 | 0 \ |
| 7754 | -c "found fragmented DTLS handshake message" \ |
| 7755 | -c "client hello, adding renegotiation extension" \ |
| 7756 | -c "found renegotiation extension" \ |
| 7757 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7758 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7759 | -C "error" \ |
| 7760 | -s "Extra-header:" |
| 7761 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7762 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7763 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7764 | "$P_CLI dtls=1 debug_level=2" \ |
| 7765 | 0 \ |
| 7766 | -C "found fragmented DTLS handshake message" \ |
| 7767 | -C "error" |
| 7768 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7769 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7770 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7771 | "$P_CLI dtls=1 debug_level=2" \ |
| 7772 | 0 \ |
| 7773 | -c "found fragmented DTLS handshake message" \ |
| 7774 | -C "error" |
| 7775 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7776 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7777 | "$O_SRV -dtls1 -mtu 256" \ |
| 7778 | "$P_CLI dtls=1 debug_level=2" \ |
| 7779 | 0 \ |
| 7780 | -c "found fragmented DTLS handshake message" \ |
| 7781 | -C "error" |
| 7782 | |
| 7783 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7784 | "$O_SRV -dtls1 -mtu 256" \ |
| 7785 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7786 | 0 \ |
| 7787 | -c "found fragmented DTLS handshake message" \ |
| 7788 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7789 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7790 | # Tests for sending fragmented handshake messages with DTLS |
| 7791 | # |
| 7792 | # Use client auth when we need the client to send large messages, |
| 7793 | # and use large cert chains on both sides too (the long chains we have all use |
| 7794 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7795 | # Sizes reached (UDP payload): |
| 7796 | # - 2037B for server certificate |
| 7797 | # - 1542B for client certificate |
| 7798 | # - 1013B for newsessionticket |
| 7799 | # - all others below 512B |
| 7800 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7801 | |
| 7802 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7803 | requires_config_enabled MBEDTLS_RSA_C |
| 7804 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7805 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7806 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7807 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7808 | crt_file=data_files/server7_int-ca.crt \ |
| 7809 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7810 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7811 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7812 | "$P_CLI dtls=1 debug_level=2 \ |
| 7813 | crt_file=data_files/server8_int-ca2.crt \ |
| 7814 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7815 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7816 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7817 | 0 \ |
| 7818 | -S "found fragmented DTLS handshake message" \ |
| 7819 | -C "found fragmented DTLS handshake message" \ |
| 7820 | -C "error" |
| 7821 | |
| 7822 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7823 | requires_config_enabled MBEDTLS_RSA_C |
| 7824 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7825 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7826 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7827 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7828 | crt_file=data_files/server7_int-ca.crt \ |
| 7829 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7830 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7831 | max_frag_len=1024" \ |
| 7832 | "$P_CLI dtls=1 debug_level=2 \ |
| 7833 | crt_file=data_files/server8_int-ca2.crt \ |
| 7834 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7835 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7836 | max_frag_len=2048" \ |
| 7837 | 0 \ |
| 7838 | -S "found fragmented DTLS handshake message" \ |
| 7839 | -c "found fragmented DTLS handshake message" \ |
| 7840 | -C "error" |
| 7841 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7842 | # With the MFL extension, the server has no way of forcing |
| 7843 | # the client to not exceed a certain MTU; hence, the following |
| 7844 | # test can't be replicated with an MTU proxy such as the one |
| 7845 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7846 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7847 | requires_config_enabled MBEDTLS_RSA_C |
| 7848 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7849 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7850 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7851 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7852 | crt_file=data_files/server7_int-ca.crt \ |
| 7853 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7854 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7855 | max_frag_len=512" \ |
| 7856 | "$P_CLI dtls=1 debug_level=2 \ |
| 7857 | crt_file=data_files/server8_int-ca2.crt \ |
| 7858 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7859 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7860 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7861 | 0 \ |
| 7862 | -S "found fragmented DTLS handshake message" \ |
| 7863 | -c "found fragmented DTLS handshake message" \ |
| 7864 | -C "error" |
| 7865 | |
| 7866 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7867 | requires_config_enabled MBEDTLS_RSA_C |
| 7868 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7869 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7870 | 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] | 7871 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7872 | crt_file=data_files/server7_int-ca.crt \ |
| 7873 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7874 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7875 | max_frag_len=2048" \ |
| 7876 | "$P_CLI dtls=1 debug_level=2 \ |
| 7877 | crt_file=data_files/server8_int-ca2.crt \ |
| 7878 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7879 | hs_timeout=2500-60000 \ |
| 7880 | max_frag_len=1024" \ |
| 7881 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7882 | -S "found fragmented DTLS handshake message" \ |
| 7883 | -c "found fragmented DTLS handshake message" \ |
| 7884 | -C "error" |
| 7885 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7886 | # While not required by the standard defining the MFL extension |
| 7887 | # (according to which it only applies to records, not to datagrams), |
| 7888 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7889 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7890 | # to the peer. |
| 7891 | # The next test checks that no datagrams significantly larger than the |
| 7892 | # negotiated MFL are sent. |
| 7893 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7894 | requires_config_enabled MBEDTLS_RSA_C |
| 7895 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7896 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7897 | 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] | 7898 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7899 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7900 | crt_file=data_files/server7_int-ca.crt \ |
| 7901 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7902 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7903 | max_frag_len=2048" \ |
| 7904 | "$P_CLI dtls=1 debug_level=2 \ |
| 7905 | crt_file=data_files/server8_int-ca2.crt \ |
| 7906 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7907 | hs_timeout=2500-60000 \ |
| 7908 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7909 | 0 \ |
| 7910 | -S "found fragmented DTLS handshake message" \ |
| 7911 | -c "found fragmented DTLS handshake message" \ |
| 7912 | -C "error" |
| 7913 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7914 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7915 | requires_config_enabled MBEDTLS_RSA_C |
| 7916 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7917 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7918 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7919 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7920 | crt_file=data_files/server7_int-ca.crt \ |
| 7921 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7922 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7923 | max_frag_len=2048" \ |
| 7924 | "$P_CLI dtls=1 debug_level=2 \ |
| 7925 | crt_file=data_files/server8_int-ca2.crt \ |
| 7926 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7927 | hs_timeout=2500-60000 \ |
| 7928 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7929 | 0 \ |
| 7930 | -s "found fragmented DTLS handshake message" \ |
| 7931 | -c "found fragmented DTLS handshake message" \ |
| 7932 | -C "error" |
| 7933 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7934 | # While not required by the standard defining the MFL extension |
| 7935 | # (according to which it only applies to records, not to datagrams), |
| 7936 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7937 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7938 | # to the peer. |
| 7939 | # The next test checks that no datagrams significantly larger than the |
| 7940 | # negotiated MFL are sent. |
| 7941 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7942 | requires_config_enabled MBEDTLS_RSA_C |
| 7943 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7944 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7945 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7946 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7947 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7948 | crt_file=data_files/server7_int-ca.crt \ |
| 7949 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7950 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7951 | max_frag_len=2048" \ |
| 7952 | "$P_CLI dtls=1 debug_level=2 \ |
| 7953 | crt_file=data_files/server8_int-ca2.crt \ |
| 7954 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7955 | hs_timeout=2500-60000 \ |
| 7956 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7957 | 0 \ |
| 7958 | -s "found fragmented DTLS handshake message" \ |
| 7959 | -c "found fragmented DTLS handshake message" \ |
| 7960 | -C "error" |
| 7961 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7962 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7963 | requires_config_enabled MBEDTLS_RSA_C |
| 7964 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7965 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7966 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7967 | crt_file=data_files/server7_int-ca.crt \ |
| 7968 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7969 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7970 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7971 | "$P_CLI dtls=1 debug_level=2 \ |
| 7972 | crt_file=data_files/server8_int-ca2.crt \ |
| 7973 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7974 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7975 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7976 | 0 \ |
| 7977 | -S "found fragmented DTLS handshake message" \ |
| 7978 | -C "found fragmented DTLS handshake message" \ |
| 7979 | -C "error" |
| 7980 | |
| 7981 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7982 | requires_config_enabled MBEDTLS_RSA_C |
| 7983 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7984 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7985 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7986 | crt_file=data_files/server7_int-ca.crt \ |
| 7987 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7988 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7989 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7990 | "$P_CLI dtls=1 debug_level=2 \ |
| 7991 | crt_file=data_files/server8_int-ca2.crt \ |
| 7992 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7993 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7994 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7995 | 0 \ |
| 7996 | -s "found fragmented DTLS handshake message" \ |
| 7997 | -C "found fragmented DTLS handshake message" \ |
| 7998 | -C "error" |
| 7999 | |
| 8000 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8001 | requires_config_enabled MBEDTLS_RSA_C |
| 8002 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8003 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8004 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8005 | crt_file=data_files/server7_int-ca.crt \ |
| 8006 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8007 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8008 | mtu=512" \ |
| 8009 | "$P_CLI dtls=1 debug_level=2 \ |
| 8010 | crt_file=data_files/server8_int-ca2.crt \ |
| 8011 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8012 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8013 | mtu=2048" \ |
| 8014 | 0 \ |
| 8015 | -S "found fragmented DTLS handshake message" \ |
| 8016 | -c "found fragmented DTLS handshake message" \ |
| 8017 | -C "error" |
| 8018 | |
| 8019 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8020 | requires_config_enabled MBEDTLS_RSA_C |
| 8021 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8022 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8023 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8024 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8025 | crt_file=data_files/server7_int-ca.crt \ |
| 8026 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8027 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8028 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8029 | "$P_CLI dtls=1 debug_level=2 \ |
| 8030 | crt_file=data_files/server8_int-ca2.crt \ |
| 8031 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8032 | hs_timeout=2500-60000 \ |
| 8033 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8034 | 0 \ |
| 8035 | -s "found fragmented DTLS handshake message" \ |
| 8036 | -c "found fragmented DTLS handshake message" \ |
| 8037 | -C "error" |
| 8038 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8039 | # 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] | 8040 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8041 | requires_config_enabled MBEDTLS_RSA_C |
| 8042 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8043 | requires_config_enabled MBEDTLS_SHA256_C |
| 8044 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8045 | requires_config_enabled MBEDTLS_AES_C |
| 8046 | requires_config_enabled MBEDTLS_GCM_C |
| 8047 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8048 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8049 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8050 | crt_file=data_files/server7_int-ca.crt \ |
| 8051 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8052 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8053 | mtu=512" \ |
| 8054 | "$P_CLI dtls=1 debug_level=2 \ |
| 8055 | crt_file=data_files/server8_int-ca2.crt \ |
| 8056 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8057 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8058 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8059 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8060 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8061 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8062 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8063 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8064 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8065 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8066 | # 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] | 8067 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8068 | # retransmissions, but in some cases (like both the server and client using |
| 8069 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8070 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8071 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8072 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8073 | requires_config_enabled MBEDTLS_RSA_C |
| 8074 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8075 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8076 | requires_config_enabled MBEDTLS_AES_C |
| 8077 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8078 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8079 | -p "$P_PXY mtu=508" \ |
| 8080 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8081 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8082 | key_file=data_files/server7.key \ |
| 8083 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8084 | "$P_CLI dtls=1 debug_level=2 \ |
| 8085 | crt_file=data_files/server8_int-ca2.crt \ |
| 8086 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8087 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8088 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8089 | 0 \ |
| 8090 | -s "found fragmented DTLS handshake message" \ |
| 8091 | -c "found fragmented DTLS handshake message" \ |
| 8092 | -C "error" |
| 8093 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8094 | # 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] | 8095 | only_with_valgrind |
| 8096 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8097 | requires_config_enabled MBEDTLS_RSA_C |
| 8098 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8099 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8100 | requires_config_enabled MBEDTLS_AES_C |
| 8101 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8102 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8103 | -p "$P_PXY mtu=508" \ |
| 8104 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8105 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8106 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8107 | hs_timeout=250-10000" \ |
| 8108 | "$P_CLI dtls=1 debug_level=2 \ |
| 8109 | crt_file=data_files/server8_int-ca2.crt \ |
| 8110 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8111 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8112 | hs_timeout=250-10000" \ |
| 8113 | 0 \ |
| 8114 | -s "found fragmented DTLS handshake message" \ |
| 8115 | -c "found fragmented DTLS handshake message" \ |
| 8116 | -C "error" |
| 8117 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8118 | # 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] | 8119 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8120 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8121 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8122 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8123 | requires_config_enabled MBEDTLS_RSA_C |
| 8124 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8125 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8126 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8127 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8128 | crt_file=data_files/server7_int-ca.crt \ |
| 8129 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8130 | hs_timeout=10000-60000 \ |
| 8131 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8132 | "$P_CLI dtls=1 debug_level=2 \ |
| 8133 | crt_file=data_files/server8_int-ca2.crt \ |
| 8134 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8135 | hs_timeout=10000-60000 \ |
| 8136 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8137 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8138 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8139 | -s "found fragmented DTLS handshake message" \ |
| 8140 | -c "found fragmented DTLS handshake message" \ |
| 8141 | -C "error" |
| 8142 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8143 | # 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] | 8144 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8145 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8146 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8147 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8148 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8149 | requires_config_enabled MBEDTLS_RSA_C |
| 8150 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8151 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8152 | requires_config_enabled MBEDTLS_AES_C |
| 8153 | requires_config_enabled MBEDTLS_GCM_C |
| 8154 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8155 | -p "$P_PXY mtu=512" \ |
| 8156 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8157 | crt_file=data_files/server7_int-ca.crt \ |
| 8158 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8159 | hs_timeout=10000-60000 \ |
| 8160 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8161 | "$P_CLI dtls=1 debug_level=2 \ |
| 8162 | crt_file=data_files/server8_int-ca2.crt \ |
| 8163 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8164 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8165 | hs_timeout=10000-60000 \ |
| 8166 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8167 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8168 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8169 | -s "found fragmented DTLS handshake message" \ |
| 8170 | -c "found fragmented DTLS handshake message" \ |
| 8171 | -C "error" |
| 8172 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8173 | not_with_valgrind # spurious autoreduction due to timeout |
| 8174 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8175 | requires_config_enabled MBEDTLS_RSA_C |
| 8176 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8177 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8178 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8179 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8180 | crt_file=data_files/server7_int-ca.crt \ |
| 8181 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8182 | hs_timeout=10000-60000 \ |
| 8183 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8184 | "$P_CLI dtls=1 debug_level=2 \ |
| 8185 | crt_file=data_files/server8_int-ca2.crt \ |
| 8186 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8187 | hs_timeout=10000-60000 \ |
| 8188 | mtu=1024 nbio=2" \ |
| 8189 | 0 \ |
| 8190 | -S "autoreduction" \ |
| 8191 | -s "found fragmented DTLS handshake message" \ |
| 8192 | -c "found fragmented DTLS handshake message" \ |
| 8193 | -C "error" |
| 8194 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8195 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8196 | not_with_valgrind # spurious autoreduction due to timeout |
| 8197 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8198 | requires_config_enabled MBEDTLS_RSA_C |
| 8199 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8200 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8201 | requires_config_enabled MBEDTLS_AES_C |
| 8202 | requires_config_enabled MBEDTLS_GCM_C |
| 8203 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8204 | -p "$P_PXY mtu=512" \ |
| 8205 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8206 | crt_file=data_files/server7_int-ca.crt \ |
| 8207 | key_file=data_files/server7.key \ |
| 8208 | hs_timeout=10000-60000 \ |
| 8209 | mtu=512 nbio=2" \ |
| 8210 | "$P_CLI dtls=1 debug_level=2 \ |
| 8211 | crt_file=data_files/server8_int-ca2.crt \ |
| 8212 | key_file=data_files/server8.key \ |
| 8213 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8214 | hs_timeout=10000-60000 \ |
| 8215 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8216 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8217 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8218 | -s "found fragmented DTLS handshake message" \ |
| 8219 | -c "found fragmented DTLS handshake message" \ |
| 8220 | -C "error" |
| 8221 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8222 | # 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] | 8223 | # This ensures things still work after session_reset(). |
| 8224 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8225 | # Since we don't support reading fragmented ClientHello yet, |
| 8226 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8227 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8228 | # An autoreduction on the client-side might happen if the server is |
| 8229 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8230 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8231 | # resumed listening, which would result in a spurious autoreduction. |
| 8232 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8233 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8234 | requires_config_enabled MBEDTLS_RSA_C |
| 8235 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8236 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8237 | requires_config_enabled MBEDTLS_AES_C |
| 8238 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8239 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8240 | -p "$P_PXY mtu=1450" \ |
| 8241 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8242 | crt_file=data_files/server7_int-ca.crt \ |
| 8243 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8244 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8245 | mtu=1450" \ |
| 8246 | "$P_CLI dtls=1 debug_level=2 \ |
| 8247 | crt_file=data_files/server8_int-ca2.crt \ |
| 8248 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8249 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8250 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8251 | 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] | 8252 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8253 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8254 | -s "found fragmented DTLS handshake message" \ |
| 8255 | -c "found fragmented DTLS handshake message" \ |
| 8256 | -C "error" |
| 8257 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8258 | # An autoreduction on the client-side might happen if the server is |
| 8259 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8260 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8261 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8262 | requires_config_enabled MBEDTLS_RSA_C |
| 8263 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8264 | requires_config_enabled MBEDTLS_SHA256_C |
| 8265 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8266 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8267 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 8268 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8269 | -p "$P_PXY mtu=512" \ |
| 8270 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8271 | crt_file=data_files/server7_int-ca.crt \ |
| 8272 | key_file=data_files/server7.key \ |
| 8273 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8274 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8275 | mtu=512" \ |
| 8276 | "$P_CLI dtls=1 debug_level=2 \ |
| 8277 | crt_file=data_files/server8_int-ca2.crt \ |
| 8278 | key_file=data_files/server8.key \ |
| 8279 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8280 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8281 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8282 | mtu=512" \ |
| 8283 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8284 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8285 | -s "found fragmented DTLS handshake message" \ |
| 8286 | -c "found fragmented DTLS handshake message" \ |
| 8287 | -C "error" |
| 8288 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8289 | # An autoreduction on the client-side might happen if the server is |
| 8290 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8291 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8292 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8293 | requires_config_enabled MBEDTLS_RSA_C |
| 8294 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8295 | requires_config_enabled MBEDTLS_SHA256_C |
| 8296 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8297 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8298 | requires_config_enabled MBEDTLS_AES_C |
| 8299 | requires_config_enabled MBEDTLS_GCM_C |
| 8300 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8301 | -p "$P_PXY mtu=512" \ |
| 8302 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8303 | crt_file=data_files/server7_int-ca.crt \ |
| 8304 | key_file=data_files/server7.key \ |
| 8305 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8306 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8307 | mtu=512" \ |
| 8308 | "$P_CLI dtls=1 debug_level=2 \ |
| 8309 | crt_file=data_files/server8_int-ca2.crt \ |
| 8310 | key_file=data_files/server8.key \ |
| 8311 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8312 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8313 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8314 | mtu=512" \ |
| 8315 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8316 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8317 | -s "found fragmented DTLS handshake message" \ |
| 8318 | -c "found fragmented DTLS handshake message" \ |
| 8319 | -C "error" |
| 8320 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8321 | # An autoreduction on the client-side might happen if the server is |
| 8322 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8323 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8324 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8325 | requires_config_enabled MBEDTLS_RSA_C |
| 8326 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8327 | requires_config_enabled MBEDTLS_SHA256_C |
| 8328 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8329 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8330 | requires_config_enabled MBEDTLS_AES_C |
| 8331 | requires_config_enabled MBEDTLS_CCM_C |
| 8332 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8333 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8334 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8335 | crt_file=data_files/server7_int-ca.crt \ |
| 8336 | key_file=data_files/server7.key \ |
| 8337 | exchanges=2 renegotiation=1 \ |
| 8338 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8339 | hs_timeout=10000-60000 \ |
| 8340 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8341 | "$P_CLI dtls=1 debug_level=2 \ |
| 8342 | crt_file=data_files/server8_int-ca2.crt \ |
| 8343 | key_file=data_files/server8.key \ |
| 8344 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8345 | hs_timeout=10000-60000 \ |
| 8346 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8347 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8348 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8349 | -s "found fragmented DTLS handshake message" \ |
| 8350 | -c "found fragmented DTLS handshake message" \ |
| 8351 | -C "error" |
| 8352 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8353 | # An autoreduction on the client-side might happen if the server is |
| 8354 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8355 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8356 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8357 | requires_config_enabled MBEDTLS_RSA_C |
| 8358 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8359 | requires_config_enabled MBEDTLS_SHA256_C |
| 8360 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8361 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8362 | requires_config_enabled MBEDTLS_AES_C |
| 8363 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8364 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 8365 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8366 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8367 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8368 | crt_file=data_files/server7_int-ca.crt \ |
| 8369 | key_file=data_files/server7.key \ |
| 8370 | exchanges=2 renegotiation=1 \ |
| 8371 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8372 | hs_timeout=10000-60000 \ |
| 8373 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8374 | "$P_CLI dtls=1 debug_level=2 \ |
| 8375 | crt_file=data_files/server8_int-ca2.crt \ |
| 8376 | key_file=data_files/server8.key \ |
| 8377 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8378 | hs_timeout=10000-60000 \ |
| 8379 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8380 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8381 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8382 | -s "found fragmented DTLS handshake message" \ |
| 8383 | -c "found fragmented DTLS handshake message" \ |
| 8384 | -C "error" |
| 8385 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8386 | # An autoreduction on the client-side might happen if the server is |
| 8387 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8388 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8389 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8390 | requires_config_enabled MBEDTLS_RSA_C |
| 8391 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8392 | requires_config_enabled MBEDTLS_SHA256_C |
| 8393 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8394 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8395 | requires_config_enabled MBEDTLS_AES_C |
| 8396 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8397 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8398 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8399 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8400 | crt_file=data_files/server7_int-ca.crt \ |
| 8401 | key_file=data_files/server7.key \ |
| 8402 | exchanges=2 renegotiation=1 \ |
| 8403 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8404 | hs_timeout=10000-60000 \ |
| 8405 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8406 | "$P_CLI dtls=1 debug_level=2 \ |
| 8407 | crt_file=data_files/server8_int-ca2.crt \ |
| 8408 | key_file=data_files/server8.key \ |
| 8409 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8410 | hs_timeout=10000-60000 \ |
| 8411 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8412 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8413 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8414 | -s "found fragmented DTLS handshake message" \ |
| 8415 | -c "found fragmented DTLS handshake message" \ |
| 8416 | -C "error" |
| 8417 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8418 | # 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] | 8419 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8420 | requires_config_enabled MBEDTLS_RSA_C |
| 8421 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8422 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8423 | requires_config_enabled MBEDTLS_AES_C |
| 8424 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8425 | client_needs_more_time 2 |
| 8426 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8427 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8428 | "$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] | 8429 | crt_file=data_files/server7_int-ca.crt \ |
| 8430 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8431 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8432 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8433 | crt_file=data_files/server8_int-ca2.crt \ |
| 8434 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8435 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8436 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8437 | 0 \ |
| 8438 | -s "found fragmented DTLS handshake message" \ |
| 8439 | -c "found fragmented DTLS handshake message" \ |
| 8440 | -C "error" |
| 8441 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8442 | # 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] | 8443 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8444 | requires_config_enabled MBEDTLS_RSA_C |
| 8445 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8446 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8447 | requires_config_enabled MBEDTLS_AES_C |
| 8448 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8449 | client_needs_more_time 2 |
| 8450 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8451 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8452 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8453 | crt_file=data_files/server7_int-ca.crt \ |
| 8454 | key_file=data_files/server7.key \ |
| 8455 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8456 | "$P_CLI dtls=1 debug_level=2 \ |
| 8457 | crt_file=data_files/server8_int-ca2.crt \ |
| 8458 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8459 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8460 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8461 | 0 \ |
| 8462 | -s "found fragmented DTLS handshake message" \ |
| 8463 | -c "found fragmented DTLS handshake message" \ |
| 8464 | -C "error" |
| 8465 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8466 | # interop tests for DTLS fragmentating with reliable connection |
| 8467 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8468 | # here and below we just want to test that the we fragment in a way that |
| 8469 | # pleases other implementations, so we don't need the peer to fragment |
| 8470 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8471 | requires_config_enabled MBEDTLS_RSA_C |
| 8472 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8474 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8475 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8476 | "$G_SRV -u" \ |
| 8477 | "$P_CLI dtls=1 debug_level=2 \ |
| 8478 | crt_file=data_files/server8_int-ca2.crt \ |
| 8479 | key_file=data_files/server8.key \ |
| 8480 | mtu=512 force_version=dtls1_2" \ |
| 8481 | 0 \ |
| 8482 | -c "fragmenting handshake message" \ |
| 8483 | -C "error" |
| 8484 | |
| 8485 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8486 | requires_config_enabled MBEDTLS_RSA_C |
| 8487 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8488 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8489 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8490 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8491 | "$G_SRV -u" \ |
| 8492 | "$P_CLI dtls=1 debug_level=2 \ |
| 8493 | crt_file=data_files/server8_int-ca2.crt \ |
| 8494 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8495 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8496 | 0 \ |
| 8497 | -c "fragmenting handshake message" \ |
| 8498 | -C "error" |
| 8499 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8500 | # We use --insecure for the GnuTLS client because it expects |
| 8501 | # the hostname / IP it connects to to be the name used in the |
| 8502 | # certificate obtained from the server. Here, however, it |
| 8503 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8504 | # as the server name in the certificate. This will make the |
| 8505 | # certifiate validation fail, but passing --insecure makes |
| 8506 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8507 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8508 | requires_config_enabled MBEDTLS_RSA_C |
| 8509 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8511 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8512 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8513 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8514 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8515 | crt_file=data_files/server7_int-ca.crt \ |
| 8516 | key_file=data_files/server7.key \ |
| 8517 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8518 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8519 | 0 \ |
| 8520 | -s "fragmenting handshake message" |
| 8521 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8522 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8523 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8524 | requires_config_enabled MBEDTLS_RSA_C |
| 8525 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8527 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8528 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8529 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8530 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8531 | crt_file=data_files/server7_int-ca.crt \ |
| 8532 | key_file=data_files/server7.key \ |
| 8533 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8534 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8535 | 0 \ |
| 8536 | -s "fragmenting handshake message" |
| 8537 | |
| 8538 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8539 | requires_config_enabled MBEDTLS_RSA_C |
| 8540 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8542 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8543 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8544 | "$P_CLI dtls=1 debug_level=2 \ |
| 8545 | crt_file=data_files/server8_int-ca2.crt \ |
| 8546 | key_file=data_files/server8.key \ |
| 8547 | mtu=512 force_version=dtls1_2" \ |
| 8548 | 0 \ |
| 8549 | -c "fragmenting handshake message" \ |
| 8550 | -C "error" |
| 8551 | |
| 8552 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8553 | requires_config_enabled MBEDTLS_RSA_C |
| 8554 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8556 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8557 | "$O_SRV -dtls1 -verify 10" \ |
| 8558 | "$P_CLI dtls=1 debug_level=2 \ |
| 8559 | crt_file=data_files/server8_int-ca2.crt \ |
| 8560 | key_file=data_files/server8.key \ |
| 8561 | mtu=512 force_version=dtls1" \ |
| 8562 | 0 \ |
| 8563 | -c "fragmenting handshake message" \ |
| 8564 | -C "error" |
| 8565 | |
| 8566 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8567 | requires_config_enabled MBEDTLS_RSA_C |
| 8568 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8569 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8570 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8571 | "$P_SRV dtls=1 debug_level=2 \ |
| 8572 | crt_file=data_files/server7_int-ca.crt \ |
| 8573 | key_file=data_files/server7.key \ |
| 8574 | mtu=512 force_version=dtls1_2" \ |
| 8575 | "$O_CLI -dtls1_2" \ |
| 8576 | 0 \ |
| 8577 | -s "fragmenting handshake message" |
| 8578 | |
| 8579 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8580 | requires_config_enabled MBEDTLS_RSA_C |
| 8581 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8583 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8584 | "$P_SRV dtls=1 debug_level=2 \ |
| 8585 | crt_file=data_files/server7_int-ca.crt \ |
| 8586 | key_file=data_files/server7.key \ |
| 8587 | mtu=512 force_version=dtls1" \ |
| 8588 | "$O_CLI -dtls1" \ |
| 8589 | 0 \ |
| 8590 | -s "fragmenting handshake message" |
| 8591 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8592 | # interop tests for DTLS fragmentating with unreliable connection |
| 8593 | # |
| 8594 | # again we just want to test that the we fragment in a way that |
| 8595 | # pleases other implementations, so we don't need the peer to fragment |
| 8596 | requires_gnutls_next |
| 8597 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8598 | requires_config_enabled MBEDTLS_RSA_C |
| 8599 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8601 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8602 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8603 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8604 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8605 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8606 | crt_file=data_files/server8_int-ca2.crt \ |
| 8607 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8608 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8609 | 0 \ |
| 8610 | -c "fragmenting handshake message" \ |
| 8611 | -C "error" |
| 8612 | |
| 8613 | requires_gnutls_next |
| 8614 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8615 | requires_config_enabled MBEDTLS_RSA_C |
| 8616 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8618 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8619 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8620 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8621 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8622 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8623 | crt_file=data_files/server8_int-ca2.crt \ |
| 8624 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8625 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8626 | 0 \ |
| 8627 | -c "fragmenting handshake message" \ |
| 8628 | -C "error" |
| 8629 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8630 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8631 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8632 | requires_config_enabled MBEDTLS_RSA_C |
| 8633 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8635 | client_needs_more_time 4 |
| 8636 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8637 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8638 | "$P_SRV dtls=1 debug_level=2 \ |
| 8639 | crt_file=data_files/server7_int-ca.crt \ |
| 8640 | key_file=data_files/server7.key \ |
| 8641 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8642 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8643 | 0 \ |
| 8644 | -s "fragmenting handshake message" |
| 8645 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8646 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8647 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8648 | requires_config_enabled MBEDTLS_RSA_C |
| 8649 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8650 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8651 | client_needs_more_time 4 |
| 8652 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8653 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8654 | "$P_SRV dtls=1 debug_level=2 \ |
| 8655 | crt_file=data_files/server7_int-ca.crt \ |
| 8656 | key_file=data_files/server7.key \ |
| 8657 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8658 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8659 | 0 \ |
| 8660 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8661 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8662 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8663 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8664 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8665 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8666 | ## (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] | 8667 | skip_next_test |
| 8668 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8669 | requires_config_enabled MBEDTLS_RSA_C |
| 8670 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8671 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8672 | client_needs_more_time 4 |
| 8673 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8674 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8675 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8676 | "$P_CLI dtls=1 debug_level=2 \ |
| 8677 | crt_file=data_files/server8_int-ca2.crt \ |
| 8678 | key_file=data_files/server8.key \ |
| 8679 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8680 | 0 \ |
| 8681 | -c "fragmenting handshake message" \ |
| 8682 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8683 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8684 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8685 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8686 | requires_config_enabled MBEDTLS_RSA_C |
| 8687 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8689 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8690 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8691 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8692 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8693 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8694 | crt_file=data_files/server8_int-ca2.crt \ |
| 8695 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8696 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8697 | 0 \ |
| 8698 | -c "fragmenting handshake message" \ |
| 8699 | -C "error" |
| 8700 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8701 | skip_next_test |
| 8702 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8703 | requires_config_enabled MBEDTLS_RSA_C |
| 8704 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8706 | client_needs_more_time 4 |
| 8707 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8708 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8709 | "$P_SRV dtls=1 debug_level=2 \ |
| 8710 | crt_file=data_files/server7_int-ca.crt \ |
| 8711 | key_file=data_files/server7.key \ |
| 8712 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8713 | "$O_CLI -dtls1_2" \ |
| 8714 | 0 \ |
| 8715 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8716 | |
| 8717 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8718 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8719 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8720 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8721 | requires_config_enabled MBEDTLS_RSA_C |
| 8722 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8724 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8725 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8726 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8727 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8728 | crt_file=data_files/server7_int-ca.crt \ |
| 8729 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8730 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8731 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8732 | 0 \ |
| 8733 | -s "fragmenting handshake message" |
| 8734 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8735 | # Tests for specific things with "unreliable" UDP connection |
| 8736 | |
| 8737 | not_with_valgrind # spurious resend due to timeout |
| 8738 | run_test "DTLS proxy: reference" \ |
| 8739 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8740 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8741 | "$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] | 8742 | 0 \ |
| 8743 | -C "replayed record" \ |
| 8744 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8745 | -C "Buffer record from epoch" \ |
| 8746 | -S "Buffer record from epoch" \ |
| 8747 | -C "ssl_buffer_message" \ |
| 8748 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8749 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8750 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8751 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8752 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8753 | -c "HTTP/1.0 200 OK" |
| 8754 | |
| 8755 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8756 | run_test "DTLS proxy: duplicate every packet" \ |
| 8757 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8758 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8759 | "$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] | 8760 | 0 \ |
| 8761 | -c "replayed record" \ |
| 8762 | -s "replayed record" \ |
| 8763 | -c "record from another epoch" \ |
| 8764 | -s "record from another epoch" \ |
| 8765 | -S "resend" \ |
| 8766 | -s "Extra-header:" \ |
| 8767 | -c "HTTP/1.0 200 OK" |
| 8768 | |
| 8769 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8770 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8771 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8772 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8773 | 0 \ |
| 8774 | -c "replayed record" \ |
| 8775 | -S "replayed record" \ |
| 8776 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8777 | -s "record from another epoch" \ |
| 8778 | -c "resend" \ |
| 8779 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8780 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8781 | -c "HTTP/1.0 200 OK" |
| 8782 | |
| 8783 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8784 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8785 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8786 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8787 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8788 | -c "next record in same datagram" \ |
| 8789 | -s "next record in same datagram" |
| 8790 | |
| 8791 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8792 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8793 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8794 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8795 | 0 \ |
| 8796 | -c "next record in same datagram" \ |
| 8797 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8798 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8799 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8800 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8801 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8802 | "$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] | 8803 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8804 | -c "discarding invalid record (mac)" \ |
| 8805 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8806 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8807 | -c "HTTP/1.0 200 OK" \ |
| 8808 | -S "too many records with bad MAC" \ |
| 8809 | -S "Verification of the message MAC failed" |
| 8810 | |
| 8811 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8812 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8813 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8814 | "$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] | 8815 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8816 | -C "discarding invalid record (mac)" \ |
| 8817 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8818 | -S "Extra-header:" \ |
| 8819 | -C "HTTP/1.0 200 OK" \ |
| 8820 | -s "too many records with bad MAC" \ |
| 8821 | -s "Verification of the message MAC failed" |
| 8822 | |
| 8823 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8824 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8825 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8826 | "$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] | 8827 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8828 | -c "discarding invalid record (mac)" \ |
| 8829 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8830 | -s "Extra-header:" \ |
| 8831 | -c "HTTP/1.0 200 OK" \ |
| 8832 | -S "too many records with bad MAC" \ |
| 8833 | -S "Verification of the message MAC failed" |
| 8834 | |
| 8835 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8836 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8837 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8838 | "$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] | 8839 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8840 | -c "discarding invalid record (mac)" \ |
| 8841 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8842 | -s "Extra-header:" \ |
| 8843 | -c "HTTP/1.0 200 OK" \ |
| 8844 | -s "too many records with bad MAC" \ |
| 8845 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8846 | |
| 8847 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8848 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8849 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8850 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8851 | 0 \ |
| 8852 | -c "record from another epoch" \ |
| 8853 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8854 | -s "Extra-header:" \ |
| 8855 | -c "HTTP/1.0 200 OK" |
| 8856 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8857 | # Tests for reordering support with DTLS |
| 8858 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8859 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8860 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8861 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8862 | hs_timeout=2500-60000" \ |
| 8863 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8864 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8865 | 0 \ |
| 8866 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8867 | -c "Next handshake message has been buffered - load"\ |
| 8868 | -S "Buffering HS message" \ |
| 8869 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8870 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8871 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8872 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8873 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8874 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8875 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8876 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8877 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8878 | hs_timeout=2500-60000" \ |
| 8879 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8880 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8881 | 0 \ |
| 8882 | -c "Buffering HS message" \ |
| 8883 | -c "found fragmented DTLS handshake message"\ |
| 8884 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8885 | -c "Next handshake message has been buffered - load"\ |
| 8886 | -S "Buffering HS message" \ |
| 8887 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8888 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8889 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8890 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8891 | -S "Remember CCS message" |
| 8892 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8893 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8894 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8895 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8896 | # while keeping the ServerKeyExchange. |
| 8897 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8898 | 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] | 8899 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8900 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8901 | hs_timeout=2500-60000" \ |
| 8902 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8903 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8904 | 0 \ |
| 8905 | -c "Buffering HS message" \ |
| 8906 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8907 | -C "attempt to make space by freeing buffered messages" \ |
| 8908 | -S "Buffering HS message" \ |
| 8909 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8910 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8911 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8912 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8913 | -S "Remember CCS message" |
| 8914 | |
| 8915 | # The size constraints ensure that the delayed certificate message can't |
| 8916 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8917 | # when dropping it first. |
| 8918 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8919 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8920 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8921 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8922 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8923 | hs_timeout=2500-60000" \ |
| 8924 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8925 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8926 | 0 \ |
| 8927 | -c "Buffering HS message" \ |
| 8928 | -c "attempt to make space by freeing buffered future messages" \ |
| 8929 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8930 | -S "Buffering HS message" \ |
| 8931 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8932 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8933 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8934 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8935 | -S "Remember CCS message" |
| 8936 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8937 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8938 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8939 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8940 | hs_timeout=2500-60000" \ |
| 8941 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8942 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8943 | 0 \ |
| 8944 | -C "Buffering HS message" \ |
| 8945 | -C "Next handshake message has been buffered - load"\ |
| 8946 | -s "Buffering HS message" \ |
| 8947 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8948 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8949 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8950 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8951 | -S "Remember CCS message" |
| 8952 | |
| 8953 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8954 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8955 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8956 | hs_timeout=2500-60000" \ |
| 8957 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8958 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8959 | 0 \ |
| 8960 | -C "Buffering HS message" \ |
| 8961 | -C "Next handshake message has been buffered - load"\ |
| 8962 | -S "Buffering HS message" \ |
| 8963 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8964 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8965 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8966 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8967 | -S "Remember CCS message" |
| 8968 | |
| 8969 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8970 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8971 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8972 | hs_timeout=2500-60000" \ |
| 8973 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8974 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8975 | 0 \ |
| 8976 | -C "Buffering HS message" \ |
| 8977 | -C "Next handshake message has been buffered - load"\ |
| 8978 | -S "Buffering HS message" \ |
| 8979 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8980 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8981 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8982 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8983 | -s "Remember CCS message" |
| 8984 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8985 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8986 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8987 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8988 | hs_timeout=2500-60000" \ |
| 8989 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8990 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8991 | 0 \ |
| 8992 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8993 | -s "Found buffered record from current epoch - load" \ |
| 8994 | -c "Buffer record from epoch 1" \ |
| 8995 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8996 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8997 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8998 | # from the server are delayed, so that the encrypted Finished message |
| 8999 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9000 | # in afterwards, the encrypted Finished message must be freed in order |
| 9001 | # to make space for the NewSessionTicket to be reassembled. |
| 9002 | # This works only in very particular circumstances: |
| 9003 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9004 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9005 | # the encrypted Finished message. |
| 9006 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9007 | # needs to be fragmented. |
| 9008 | # - All messages sent by the server must be small enough to be either sent |
| 9009 | # without fragmentation or be reassembled within the bounds of |
| 9010 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9011 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9012 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9013 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9014 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9015 | -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] | 9016 | "$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] | 9017 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9018 | 0 \ |
| 9019 | -s "Buffer record from epoch 1" \ |
| 9020 | -s "Found buffered record from current epoch - load" \ |
| 9021 | -c "Buffer record from epoch 1" \ |
| 9022 | -C "Found buffered record from current epoch - load" \ |
| 9023 | -c "Enough space available after freeing future epoch record" |
| 9024 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9025 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9026 | |
| 9027 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9028 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9029 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9030 | "$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] | 9031 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9032 | "$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] | 9033 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9034 | 0 \ |
| 9035 | -s "Extra-header:" \ |
| 9036 | -c "HTTP/1.0 200 OK" |
| 9037 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9038 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9039 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9040 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9041 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9042 | "$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] | 9043 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9044 | 0 \ |
| 9045 | -s "Extra-header:" \ |
| 9046 | -c "HTTP/1.0 200 OK" |
| 9047 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9048 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9049 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9050 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9051 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9052 | "$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] | 9053 | 0 \ |
| 9054 | -s "Extra-header:" \ |
| 9055 | -c "HTTP/1.0 200 OK" |
| 9056 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9057 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9058 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9059 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9060 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9061 | "$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] | 9062 | 0 \ |
| 9063 | -s "Extra-header:" \ |
| 9064 | -c "HTTP/1.0 200 OK" |
| 9065 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9066 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9067 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9068 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9069 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9070 | "$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] | 9071 | 0 \ |
| 9072 | -s "Extra-header:" \ |
| 9073 | -c "HTTP/1.0 200 OK" |
| 9074 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9075 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9076 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9077 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9078 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9079 | "$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] | 9080 | 0 \ |
| 9081 | -s "Extra-header:" \ |
| 9082 | -c "HTTP/1.0 200 OK" |
| 9083 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9084 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9085 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9086 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9087 | "$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] | 9088 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9089 | "$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] | 9090 | 0 \ |
| 9091 | -s "Extra-header:" \ |
| 9092 | -c "HTTP/1.0 200 OK" |
| 9093 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9094 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9095 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9096 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9097 | "$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] | 9098 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9099 | "$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] | 9100 | 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] | 9101 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9102 | 0 \ |
| 9103 | -s "a session has been resumed" \ |
| 9104 | -c "a session has been resumed" \ |
| 9105 | -s "Extra-header:" \ |
| 9106 | -c "HTTP/1.0 200 OK" |
| 9107 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9108 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9109 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9110 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9111 | "$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] | 9112 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9113 | "$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] | 9114 | 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] | 9115 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9116 | 0 \ |
| 9117 | -s "a session has been resumed" \ |
| 9118 | -c "a session has been resumed" \ |
| 9119 | -s "Extra-header:" \ |
| 9120 | -c "HTTP/1.0 200 OK" |
| 9121 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9122 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9123 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9124 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9125 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9126 | "$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] | 9127 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9128 | "$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] | 9129 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9130 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9131 | 0 \ |
| 9132 | -c "=> renegotiate" \ |
| 9133 | -s "=> renegotiate" \ |
| 9134 | -s "Extra-header:" \ |
| 9135 | -c "HTTP/1.0 200 OK" |
| 9136 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9137 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9138 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9139 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9140 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9141 | "$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] | 9142 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9143 | "$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] | 9144 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9145 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9146 | 0 \ |
| 9147 | -c "=> renegotiate" \ |
| 9148 | -s "=> renegotiate" \ |
| 9149 | -s "Extra-header:" \ |
| 9150 | -c "HTTP/1.0 200 OK" |
| 9151 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9152 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9153 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9154 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9155 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9156 | "$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] | 9157 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9158 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9159 | "$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] | 9160 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9161 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9162 | 0 \ |
| 9163 | -c "=> renegotiate" \ |
| 9164 | -s "=> renegotiate" \ |
| 9165 | -s "Extra-header:" \ |
| 9166 | -c "HTTP/1.0 200 OK" |
| 9167 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9168 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9169 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9170 | 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] | 9171 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9172 | "$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] | 9173 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9174 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9175 | "$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] | 9176 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9177 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9178 | 0 \ |
| 9179 | -c "=> renegotiate" \ |
| 9180 | -s "=> renegotiate" \ |
| 9181 | -s "Extra-header:" \ |
| 9182 | -c "HTTP/1.0 200 OK" |
| 9183 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9184 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9185 | ## all versions installed on the CI machines), reported here: |
| 9186 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9187 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9188 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9189 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9190 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9191 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9192 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9193 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9194 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9195 | "$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] | 9196 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9197 | -c "HTTP/1.0 200 OK" |
| 9198 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9199 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9200 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9201 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9202 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9203 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9204 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9205 | "$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] | 9206 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9207 | -c "HTTP/1.0 200 OK" |
| 9208 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9209 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9210 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9211 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9212 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9213 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9214 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9215 | "$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] | 9216 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9217 | -c "HTTP/1.0 200 OK" |
| 9218 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9219 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9220 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9221 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9222 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9223 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9224 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9225 | "$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] | 9226 | 0 \ |
| 9227 | -s "Extra-header:" \ |
| 9228 | -c "Extra-header:" |
| 9229 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9230 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9231 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9232 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9233 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9234 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9235 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9236 | "$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] | 9237 | 0 \ |
| 9238 | -s "Extra-header:" \ |
| 9239 | -c "Extra-header:" |
| 9240 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9241 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9242 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9243 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9244 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9245 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9246 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9247 | "$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] | 9248 | 0 \ |
| 9249 | -s "Extra-header:" \ |
| 9250 | -c "Extra-header:" |
| 9251 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9252 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 9253 | run_test "export keys functionality" \ |
| 9254 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9255 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9256 | 0 \ |
| 9257 | -s "exported maclen is " \ |
| 9258 | -s "exported keylen is " \ |
| 9259 | -s "exported ivlen is " \ |
| 9260 | -c "exported maclen is " \ |
| 9261 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9262 | -c "exported ivlen is " \ |
| 9263 | -c "EAP-TLS key material is:"\ |
| 9264 | -s "EAP-TLS key material is:"\ |
| 9265 | -c "EAP-TLS IV is:" \ |
| 9266 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9267 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9268 | # Test heap memory usage after handshake |
| 9269 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9270 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9271 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 9272 | run_tests_memory_after_hanshake |
| 9273 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9274 | # Final report |
| 9275 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9276 | echo "------------------------------------------------------------------------" |
| 9277 | |
| 9278 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9279 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9280 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9281 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9282 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9283 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9284 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9285 | |
| 9286 | exit $FAILS |