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 | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 117 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 118 | printf " -e|--exclude\tMatching tests are excluded (substring or 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" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 429 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 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 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 655 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 656 | is_gnutls() { |
| 657 | case "$1" in |
| 658 | *gnutls-cli*) |
| 659 | CMD_IS_GNUTLS=1 |
| 660 | ;; |
| 661 | *gnutls-serv*) |
| 662 | CMD_IS_GNUTLS=1 |
| 663 | ;; |
| 664 | *) |
| 665 | CMD_IS_GNUTLS=0 |
| 666 | ;; |
| 667 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 668 | } |
| 669 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 670 | # Compare file content |
| 671 | # Usage: find_in_both pattern file1 file2 |
| 672 | # extract from file1 the first line matching the pattern |
| 673 | # check in file2 that the same line can be found |
| 674 | find_in_both() { |
| 675 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 676 | if [ -z "$srv_pattern" ]; then |
| 677 | return 1; |
| 678 | fi |
| 679 | |
| 680 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 681 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 682 | else |
| 683 | return 1; |
| 684 | fi |
| 685 | } |
| 686 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 687 | # 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] | 688 | # Options: -s pattern pattern that must be present in server output |
| 689 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 690 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 691 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 692 | # -S pattern pattern that must be absent in server output |
| 693 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 694 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 695 | # -F call shell function on server output |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 696 | # -g call shell function on server and client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 697 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 698 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 699 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 700 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 701 | if is_excluded "$NAME"; then |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 702 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 703 | # 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] | 704 | return |
| 705 | fi |
| 706 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 707 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 708 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 709 | # Do we only run numbered tests? |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 710 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 711 | case ",$RUN_TEST_NUMBER," in |
| 712 | *",$TESTS,"*) :;; |
| 713 | *) SKIP_NEXT="YES";; |
| 714 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 715 | fi |
| 716 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 717 | # does this test use a proxy? |
| 718 | if [ "X$1" = "X-p" ]; then |
| 719 | PXY_CMD="$2" |
| 720 | shift 2 |
| 721 | else |
| 722 | PXY_CMD="" |
| 723 | fi |
| 724 | |
| 725 | # get commands and client output |
| 726 | SRV_CMD="$1" |
| 727 | CLI_CMD="$2" |
| 728 | CLI_EXPECT="$3" |
| 729 | shift 3 |
| 730 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 731 | # Check if test uses files |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 732 | case "$SRV_CMD $CLI_CMD" in |
| 733 | *data_files/*) |
| 734 | requires_config_enabled MBEDTLS_FS_IO;; |
| 735 | esac |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 736 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 737 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 738 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 739 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 740 | |
| 741 | # should we skip? |
| 742 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 743 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 744 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 745 | SKIPS=$(( $SKIPS + 1 )) |
| 746 | return |
| 747 | fi |
| 748 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 749 | # update DTLS variable |
| 750 | detect_dtls "$SRV_CMD" |
| 751 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 752 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 753 | # 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] | 754 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 755 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 756 | case " $SRV_CMD " in |
| 757 | *' server_addr=::1 '*) |
| 758 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 759 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 760 | fi |
| 761 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 762 | # update CMD_IS_GNUTLS variable |
| 763 | is_gnutls "$SRV_CMD" |
| 764 | |
| 765 | # if the server uses gnutls but doesn't set priority, explicitly |
| 766 | # set the default priority |
| 767 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 768 | case "$SRV_CMD" in |
| 769 | *--priority*) :;; |
| 770 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 771 | esac |
| 772 | fi |
| 773 | |
| 774 | # update CMD_IS_GNUTLS variable |
| 775 | is_gnutls "$CLI_CMD" |
| 776 | |
| 777 | # if the client uses gnutls but doesn't set priority, explicitly |
| 778 | # set the default priority |
| 779 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 780 | case "$CLI_CMD" in |
| 781 | *--priority*) :;; |
| 782 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 783 | esac |
| 784 | fi |
| 785 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 786 | # fix client port |
| 787 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 788 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 789 | else |
| 790 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 791 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 792 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 793 | # prepend valgrind to our commands if active |
| 794 | if [ "$MEMCHECK" -gt 0 ]; then |
| 795 | if is_polar "$SRV_CMD"; then |
| 796 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 797 | fi |
| 798 | if is_polar "$CLI_CMD"; then |
| 799 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 800 | fi |
| 801 | fi |
| 802 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 803 | TIMES_LEFT=2 |
| 804 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 805 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 806 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 807 | # run the commands |
| 808 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 809 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 810 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 811 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 812 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 813 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 814 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 815 | check_osrv_dtls |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 816 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 817 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 818 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 819 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 820 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 821 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 822 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 823 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 824 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 825 | sleep 0.05 |
| 826 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 827 | # terminate the server (and the proxy) |
| 828 | kill $SRV_PID |
| 829 | wait $SRV_PID |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 830 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 831 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 832 | if [ -n "$PXY_CMD" ]; then |
| 833 | kill $PXY_PID >/dev/null 2>&1 |
| 834 | wait $PXY_PID |
| 835 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 836 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 837 | # retry only on timeouts |
| 838 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 839 | printf "RETRY " |
| 840 | else |
| 841 | TIMES_LEFT=0 |
| 842 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 843 | done |
| 844 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 845 | # 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] | 846 | # (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] | 847 | # expected client exit to incorrectly succeed in case of catastrophic |
| 848 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 849 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 850 | 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] | 851 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 852 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 853 | return |
| 854 | fi |
| 855 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 856 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 857 | 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] | 858 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 859 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 860 | return |
| 861 | fi |
| 862 | fi |
| 863 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 864 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 865 | # exit with status 0 when interrupted by a signal, and we don't really |
| 866 | # care anyway), in case e.g. the server reports a memory leak. |
| 867 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 868 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 869 | return |
| 870 | fi |
| 871 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 872 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 873 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 874 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 875 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 876 | 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] | 877 | return |
| 878 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 879 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 880 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 881 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 882 | # 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] | 883 | while [ $# -gt 0 ] |
| 884 | do |
| 885 | case $1 in |
| 886 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 887 | 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] | 888 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 889 | return |
| 890 | fi |
| 891 | ;; |
| 892 | |
| 893 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 894 | 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] | 895 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 896 | return |
| 897 | fi |
| 898 | ;; |
| 899 | |
| 900 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 901 | 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] | 902 | 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] | 903 | return |
| 904 | fi |
| 905 | ;; |
| 906 | |
| 907 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 908 | 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] | 909 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 910 | return |
| 911 | fi |
| 912 | ;; |
| 913 | |
| 914 | # The filtering in the following two options (-u and -U) do the following |
| 915 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 916 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 917 | # - keep one of each non-unique line |
| 918 | # - count how many lines remain |
| 919 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 920 | # if there were no duplicates. |
| 921 | "-U") |
| 922 | 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 |
| 923 | fail "lines following pattern '$2' must be unique in Server output" |
| 924 | return |
| 925 | fi |
| 926 | ;; |
| 927 | |
| 928 | "-u") |
| 929 | 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 |
| 930 | 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] | 931 | return |
| 932 | fi |
| 933 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 934 | "-F") |
| 935 | if ! $2 "$SRV_OUT"; then |
| 936 | fail "function call to '$2' failed on Server output" |
| 937 | return |
| 938 | fi |
| 939 | ;; |
| 940 | "-f") |
| 941 | if ! $2 "$CLI_OUT"; then |
| 942 | fail "function call to '$2' failed on Client output" |
| 943 | return |
| 944 | fi |
| 945 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 946 | "-g") |
| 947 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 948 | fail "function call to '$2' failed on Server and Client output" |
| 949 | return |
| 950 | fi |
| 951 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 952 | |
| 953 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 954 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 955 | exit 1 |
| 956 | esac |
| 957 | shift 2 |
| 958 | done |
| 959 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 960 | # check valgrind's results |
| 961 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 962 | 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] | 963 | fail "Server has memory errors" |
| 964 | return |
| 965 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 966 | 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] | 967 | fail "Client has memory errors" |
| 968 | return |
| 969 | fi |
| 970 | fi |
| 971 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 972 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 973 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 974 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 975 | mv $SRV_OUT o-srv-${TESTS}.log |
| 976 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 977 | if [ -n "$PXY_CMD" ]; then |
| 978 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 979 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 980 | fi |
| 981 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 982 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 983 | } |
| 984 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 985 | run_test_psa() { |
| 986 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 987 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 988 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 989 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 990 | 0 \ |
| 991 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 992 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 993 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 994 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 995 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 996 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 997 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 998 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 999 | -C "Failed to setup PSA-based cipher context"\ |
| 1000 | -S "Failed to setup PSA-based cipher context"\ |
| 1001 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1002 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1003 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1004 | -S "error" \ |
| 1005 | -C "error" |
| 1006 | } |
| 1007 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1008 | run_test_psa_force_curve() { |
| 1009 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1010 | run_test "PSA - ECDH with $1" \ |
| 1011 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 1012 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1013 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1014 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1015 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1016 | -c "PSA calc verify" \ |
| 1017 | -c "calc PSA finished" \ |
| 1018 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1019 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1020 | -s "PSA calc verify" \ |
| 1021 | -s "calc PSA finished" \ |
| 1022 | -C "Failed to setup PSA-based cipher context"\ |
| 1023 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1024 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1025 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1026 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1027 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1028 | -C "error" |
| 1029 | } |
| 1030 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1031 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1032 | # a maximum fragment length. |
| 1033 | # first argument ($1) is MFL for SSL client |
| 1034 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1035 | run_test_memory_after_hanshake_with_mfl() |
| 1036 | { |
| 1037 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1038 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1039 | |
| 1040 | # Leave some margin for robustness |
| 1041 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1042 | |
| 1043 | run_test "Handshake memory usage (MFL $1)" \ |
| 1044 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1045 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1046 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1047 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1048 | 0 \ |
| 1049 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1050 | } |
| 1051 | |
| 1052 | |
| 1053 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1054 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1055 | run_tests_memory_after_hanshake() |
| 1056 | { |
| 1057 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1058 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1059 | |
| 1060 | # first test with default MFU is to get reference memory usage |
| 1061 | MEMORY_USAGE_MFL_16K=0 |
| 1062 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1063 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1064 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1065 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1066 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1067 | 0 \ |
| 1068 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1069 | |
| 1070 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1071 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1072 | |
| 1073 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1074 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1075 | |
| 1076 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1077 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1078 | |
| 1079 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1080 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1081 | } |
| 1082 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1083 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1084 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1085 | rm -f context_srv.txt |
| 1086 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1087 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1088 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1089 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1090 | 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] | 1091 | exit 1 |
| 1092 | } |
| 1093 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1094 | # |
| 1095 | # MAIN |
| 1096 | # |
| 1097 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1098 | get_options "$@" |
| 1099 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1100 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1101 | # patterns rather than regular expressions, use a case statement instead |
| 1102 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1103 | # detects simple cases: plain substring, everything, nothing. |
| 1104 | # |
| 1105 | # As an exception, the character '.' is treated as an ordinary character |
| 1106 | # if it is the only special character in the string. This is because it's |
| 1107 | # rare to need "any one character", but needing a literal '.' is common |
| 1108 | # (e.g. '-f "DTLS 1.2"'). |
| 1109 | need_grep= |
| 1110 | case "$FILTER" in |
| 1111 | '^$') simple_filter=;; |
| 1112 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1113 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1114 | need_grep=1;; |
| 1115 | *) # No regexp or shell-pattern special character |
| 1116 | simple_filter="*$FILTER*";; |
| 1117 | esac |
| 1118 | case "$EXCLUDE" in |
| 1119 | '^$') simple_exclude=;; |
| 1120 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1121 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1122 | need_grep=1;; |
| 1123 | *) # No regexp or shell-pattern special character |
| 1124 | simple_exclude="*$EXCLUDE*";; |
| 1125 | esac |
| 1126 | if [ -n "$need_grep" ]; then |
| 1127 | is_excluded () { |
| 1128 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1129 | } |
| 1130 | else |
| 1131 | is_excluded () { |
| 1132 | case "$1" in |
| 1133 | $simple_exclude) true;; |
| 1134 | $simple_filter) false;; |
| 1135 | *) true;; |
| 1136 | esac |
| 1137 | } |
| 1138 | fi |
| 1139 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1140 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1141 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1142 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1143 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1144 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1145 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1146 | exit 1 |
| 1147 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1148 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1149 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1150 | exit 1 |
| 1151 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1152 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1153 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1154 | exit 1 |
| 1155 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1156 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1157 | if which valgrind >/dev/null 2>&1; then :; else |
| 1158 | echo "Memcheck not possible. Valgrind not found" |
| 1159 | exit 1 |
| 1160 | fi |
| 1161 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1162 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1163 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1164 | exit 1 |
| 1165 | fi |
| 1166 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1167 | # used by watchdog |
| 1168 | MAIN_PID="$$" |
| 1169 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1170 | # We use somewhat arbitrary delays for tests: |
| 1171 | # - how long do we wait for the server to start (when lsof not available)? |
| 1172 | # - how long do we allow for the client to finish? |
| 1173 | # (not to check performance, just to avoid waiting indefinitely) |
| 1174 | # Things are slower with valgrind, so give extra time here. |
| 1175 | # |
| 1176 | # Note: without lsof, there is a trade-off between the running time of this |
| 1177 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1178 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1179 | # 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] | 1180 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1181 | START_DELAY=6 |
| 1182 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1183 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1184 | START_DELAY=2 |
| 1185 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1186 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1187 | |
| 1188 | # some particular tests need more time: |
| 1189 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1190 | # - for the server, we sleep for a number of seconds after the client exits |
| 1191 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1192 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1193 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1194 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1195 | # 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] | 1196 | # +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] | 1197 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1198 | 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] | 1199 | 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] | 1200 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1201 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1202 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1203 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1204 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1205 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1206 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1207 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1208 | fi |
| 1209 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1210 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1211 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1212 | fi |
| 1213 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1214 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1215 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1216 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1217 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1218 | # Allow SHA-1, because many of our test certificates use it |
| 1219 | P_SRV="$P_SRV allow_sha1=1" |
| 1220 | P_CLI="$P_CLI allow_sha1=1" |
| 1221 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1222 | # Also pick a unique name for intermediate files |
| 1223 | SRV_OUT="srv_out.$$" |
| 1224 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1225 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1226 | SESSION="session.$$" |
| 1227 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1228 | SKIP_NEXT="NO" |
| 1229 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1230 | trap cleanup INT TERM HUP |
| 1231 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1232 | # Basic test |
| 1233 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1234 | # Checks that: |
| 1235 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1236 | # - the expected (highest security) parameters are selected |
| 1237 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1238 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1239 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1240 | "$P_CLI" \ |
| 1241 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1242 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1243 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1244 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1245 | -s "ECDHE curve: secp521r1" \ |
| 1246 | -S "error" \ |
| 1247 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1248 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1249 | run_test "Default, DTLS" \ |
| 1250 | "$P_SRV dtls=1" \ |
| 1251 | "$P_CLI dtls=1" \ |
| 1252 | 0 \ |
| 1253 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1254 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1255 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1256 | run_test "TLS client auth: required" \ |
| 1257 | "$P_SRV auth_mode=required" \ |
| 1258 | "$P_CLI" \ |
| 1259 | 0 \ |
| 1260 | -s "Verifying peer X.509 certificate... ok" |
| 1261 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1262 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1263 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1264 | requires_config_enabled MBEDTLS_SHA256_C |
| 1265 | run_test "TLS: password protected client key" \ |
| 1266 | "$P_SRV auth_mode=required" \ |
| 1267 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1268 | 0 |
| 1269 | |
| 1270 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1271 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1272 | requires_config_enabled MBEDTLS_SHA256_C |
| 1273 | run_test "TLS: password protected server key" \ |
| 1274 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1275 | "$P_CLI" \ |
| 1276 | 0 |
| 1277 | |
| 1278 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1279 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1280 | requires_config_enabled MBEDTLS_RSA_C |
| 1281 | requires_config_enabled MBEDTLS_SHA256_C |
| 1282 | run_test "TLS: password protected server key, two certificates" \ |
| 1283 | "$P_SRV \ |
| 1284 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1285 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1286 | "$P_CLI" \ |
| 1287 | 0 |
| 1288 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1289 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1290 | run_test "CA callback on client" \ |
| 1291 | "$P_SRV debug_level=3" \ |
| 1292 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1293 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1294 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1295 | -S "error" \ |
| 1296 | -C "error" |
| 1297 | |
| 1298 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1299 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1300 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1301 | requires_config_enabled MBEDTLS_SHA256_C |
| 1302 | run_test "CA callback on server" \ |
| 1303 | "$P_SRV auth_mode=required" \ |
| 1304 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1305 | key_file=data_files/server5.key" \ |
| 1306 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1307 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1308 | -s "Verifying peer X.509 certificate... ok" \ |
| 1309 | -S "error" \ |
| 1310 | -C "error" |
| 1311 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1312 | # Test using an opaque private key for client authentication |
| 1313 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1314 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1315 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1316 | requires_config_enabled MBEDTLS_SHA256_C |
| 1317 | run_test "Opaque key for client authentication" \ |
| 1318 | "$P_SRV auth_mode=required" \ |
| 1319 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1320 | key_file=data_files/server5.key" \ |
| 1321 | 0 \ |
| 1322 | -c "key type: Opaque" \ |
| 1323 | -s "Verifying peer X.509 certificate... ok" \ |
| 1324 | -S "error" \ |
| 1325 | -C "error" |
| 1326 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1327 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1328 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1329 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1330 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1331 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1332 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1333 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1334 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1335 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1336 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1337 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1338 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1339 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1340 | run_test_psa_force_curve "secp521r1" |
| 1341 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1342 | run_test_psa_force_curve "brainpoolP512r1" |
| 1343 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1344 | run_test_psa_force_curve "secp384r1" |
| 1345 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1346 | run_test_psa_force_curve "brainpoolP384r1" |
| 1347 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1348 | run_test_psa_force_curve "secp256r1" |
| 1349 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1350 | run_test_psa_force_curve "secp256k1" |
| 1351 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1352 | run_test_psa_force_curve "brainpoolP256r1" |
| 1353 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1354 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1355 | ## SECP224K1 is buggy via the PSA API |
| 1356 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1357 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1358 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1359 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1360 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1361 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1362 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1363 | run_test_psa_force_curve "secp192r1" |
| 1364 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1365 | run_test_psa_force_curve "secp192k1" |
| 1366 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1367 | # Test current time in ServerHello |
| 1368 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1369 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1370 | "$P_SRV debug_level=3" \ |
| 1371 | "$P_CLI debug_level=3" \ |
| 1372 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1373 | -f "check_server_hello_time" \ |
| 1374 | -F "check_server_hello_time" |
| 1375 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1376 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1377 | run_test "Unique IV in GCM" \ |
| 1378 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1379 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1380 | 0 \ |
| 1381 | -u "IV used" \ |
| 1382 | -U "IV used" |
| 1383 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1384 | # Tests for certificate verification callback |
| 1385 | run_test "Configuration-specific CRT verification callback" \ |
| 1386 | "$P_SRV debug_level=3" \ |
| 1387 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1388 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1389 | -S "error" \ |
| 1390 | -c "Verify requested for " \ |
| 1391 | -c "Use configuration-specific verification callback" \ |
| 1392 | -C "Use context-specific verification callback" \ |
| 1393 | -C "error" |
| 1394 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1395 | run_test "Context-specific CRT verification callback" \ |
| 1396 | "$P_SRV debug_level=3" \ |
| 1397 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1398 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1399 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1400 | -c "Verify requested for " \ |
| 1401 | -c "Use context-specific verification callback" \ |
| 1402 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1403 | -C "error" |
| 1404 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1405 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1406 | |
| 1407 | requires_gnutls |
| 1408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1409 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1410 | "$G_SRV"\ |
| 1411 | "$P_CLI force_version=tls1_1" \ |
| 1412 | 0 |
| 1413 | |
| 1414 | requires_gnutls |
| 1415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1416 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1417 | "$G_SRV"\ |
| 1418 | "$P_CLI force_version=tls1" \ |
| 1419 | 0 |
| 1420 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1421 | # Tests for SHA-1 support |
| 1422 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1423 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1424 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1425 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1426 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1427 | 1 \ |
| 1428 | -c "The certificate is signed with an unacceptable hash" |
| 1429 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1430 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1431 | run_test "SHA-1 allowed by default in server certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1432 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1433 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1434 | 0 |
| 1435 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1436 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1437 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1438 | "$P_CLI allow_sha1=1" \ |
| 1439 | 0 |
| 1440 | |
| 1441 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1442 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1443 | "$P_CLI allow_sha1=0" \ |
| 1444 | 0 |
| 1445 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1446 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1447 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1448 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1449 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1450 | 1 \ |
| 1451 | -s "The certificate is signed with an unacceptable hash" |
| 1452 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1453 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1454 | run_test "SHA-1 allowed by default in client certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1455 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1456 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1457 | 0 |
| 1458 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1459 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1460 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1461 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1462 | 0 |
| 1463 | |
| 1464 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1465 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1466 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1467 | 0 |
| 1468 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1469 | # Tests for datagram packing |
| 1470 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1471 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1472 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1473 | 0 \ |
| 1474 | -c "next record in same datagram" \ |
| 1475 | -s "next record in same datagram" |
| 1476 | |
| 1477 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1478 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1479 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1480 | 0 \ |
| 1481 | -s "next record in same datagram" \ |
| 1482 | -C "next record in same datagram" |
| 1483 | |
| 1484 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1485 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1486 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1487 | 0 \ |
| 1488 | -S "next record in same datagram" \ |
| 1489 | -c "next record in same datagram" |
| 1490 | |
| 1491 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1492 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1493 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1494 | 0 \ |
| 1495 | -S "next record in same datagram" \ |
| 1496 | -C "next record in same datagram" |
| 1497 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1498 | # Tests for Truncated HMAC extension |
| 1499 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1500 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1501 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1502 | "$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] | 1503 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1504 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1505 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1506 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1507 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1508 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1509 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1510 | "$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] | 1511 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1512 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1513 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1514 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1515 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1516 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1517 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1518 | "$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] | 1519 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1520 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1521 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1522 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1523 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1524 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1525 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1526 | "$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] | 1527 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1528 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1529 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1530 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1531 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1532 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1533 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1534 | "$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] | 1535 | 0 \ |
| 1536 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1537 | -S "dumping 'expected mac' (10 bytes)" |
| 1538 | |
| 1539 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1540 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1541 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1542 | "$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] | 1543 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1544 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1545 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1546 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1547 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1548 | "$P_SRV dtls=1 debug_level=4" \ |
| 1549 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1550 | 0 \ |
| 1551 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1552 | -S "dumping 'expected mac' (10 bytes)" |
| 1553 | |
| 1554 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1555 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1556 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1557 | "$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] | 1558 | 0 \ |
| 1559 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1560 | -S "dumping 'expected mac' (10 bytes)" |
| 1561 | |
| 1562 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1563 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1564 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1565 | "$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] | 1566 | 0 \ |
| 1567 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1568 | -S "dumping 'expected mac' (10 bytes)" |
| 1569 | |
| 1570 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1571 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1572 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1573 | "$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] | 1574 | 0 \ |
| 1575 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1576 | -S "dumping 'expected mac' (10 bytes)" |
| 1577 | |
| 1578 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1579 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1580 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1581 | "$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] | 1582 | 0 \ |
| 1583 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1584 | -S "dumping 'expected mac' (10 bytes)" |
| 1585 | |
| 1586 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1587 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1588 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1589 | "$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] | 1590 | 0 \ |
| 1591 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1592 | -s "dumping 'expected mac' (10 bytes)" |
| 1593 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1594 | # Tests for Context serialization |
| 1595 | |
| 1596 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1597 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1598 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1599 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1600 | 0 \ |
| 1601 | -c "Deserializing connection..." \ |
| 1602 | -S "Deserializing connection..." |
| 1603 | |
| 1604 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1605 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1606 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1607 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1608 | 0 \ |
| 1609 | -c "Deserializing connection..." \ |
| 1610 | -S "Deserializing connection..." |
| 1611 | |
| 1612 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1613 | run_test "Context serialization, client serializes, GCM" \ |
| 1614 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1615 | "$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] | 1616 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1617 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1618 | -S "Deserializing connection..." |
| 1619 | |
| 1620 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1621 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1622 | run_test "Context serialization, client serializes, with CID" \ |
| 1623 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1624 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1625 | 0 \ |
| 1626 | -c "Deserializing connection..." \ |
| 1627 | -S "Deserializing connection..." |
| 1628 | |
| 1629 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1630 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1631 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1632 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1633 | 0 \ |
| 1634 | -C "Deserializing connection..." \ |
| 1635 | -s "Deserializing connection..." |
| 1636 | |
| 1637 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1638 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1639 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1640 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1641 | 0 \ |
| 1642 | -C "Deserializing connection..." \ |
| 1643 | -s "Deserializing connection..." |
| 1644 | |
| 1645 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1646 | run_test "Context serialization, server serializes, GCM" \ |
| 1647 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1648 | "$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] | 1649 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1650 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1651 | -s "Deserializing connection..." |
| 1652 | |
| 1653 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1654 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1655 | run_test "Context serialization, server serializes, with CID" \ |
| 1656 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1657 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1658 | 0 \ |
| 1659 | -C "Deserializing connection..." \ |
| 1660 | -s "Deserializing connection..." |
| 1661 | |
| 1662 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1663 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1664 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1665 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1666 | 0 \ |
| 1667 | -c "Deserializing connection..." \ |
| 1668 | -s "Deserializing connection..." |
| 1669 | |
| 1670 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1671 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1672 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1673 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1674 | 0 \ |
| 1675 | -c "Deserializing connection..." \ |
| 1676 | -s "Deserializing connection..." |
| 1677 | |
| 1678 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1679 | run_test "Context serialization, both serialize, GCM" \ |
| 1680 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1681 | "$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] | 1682 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1683 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1684 | -s "Deserializing connection..." |
| 1685 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1686 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1687 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1688 | run_test "Context serialization, both serialize, with CID" \ |
| 1689 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1690 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1691 | 0 \ |
| 1692 | -c "Deserializing connection..." \ |
| 1693 | -s "Deserializing connection..." |
| 1694 | |
| 1695 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1696 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1697 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1698 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1699 | 0 \ |
| 1700 | -c "Deserializing connection..." \ |
| 1701 | -S "Deserializing connection..." |
| 1702 | |
| 1703 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1704 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1705 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1706 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1707 | 0 \ |
| 1708 | -c "Deserializing connection..." \ |
| 1709 | -S "Deserializing connection..." |
| 1710 | |
| 1711 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1712 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1713 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1714 | "$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] | 1715 | 0 \ |
| 1716 | -c "Deserializing connection..." \ |
| 1717 | -S "Deserializing connection..." |
| 1718 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1719 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1720 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1721 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1722 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1723 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1724 | 0 \ |
| 1725 | -c "Deserializing connection..." \ |
| 1726 | -S "Deserializing connection..." |
| 1727 | |
| 1728 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1729 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1730 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1731 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1732 | 0 \ |
| 1733 | -C "Deserializing connection..." \ |
| 1734 | -s "Deserializing connection..." |
| 1735 | |
| 1736 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1737 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1738 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1739 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1740 | 0 \ |
| 1741 | -C "Deserializing connection..." \ |
| 1742 | -s "Deserializing connection..." |
| 1743 | |
| 1744 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1745 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1746 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1747 | "$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] | 1748 | 0 \ |
| 1749 | -C "Deserializing connection..." \ |
| 1750 | -s "Deserializing connection..." |
| 1751 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1752 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1753 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1754 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1755 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1756 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1757 | 0 \ |
| 1758 | -C "Deserializing connection..." \ |
| 1759 | -s "Deserializing connection..." |
| 1760 | |
| 1761 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1762 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1763 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1764 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1765 | 0 \ |
| 1766 | -c "Deserializing connection..." \ |
| 1767 | -s "Deserializing connection..." |
| 1768 | |
| 1769 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1770 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1771 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1772 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1773 | 0 \ |
| 1774 | -c "Deserializing connection..." \ |
| 1775 | -s "Deserializing connection..." |
| 1776 | |
| 1777 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1778 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1779 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1780 | "$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] | 1781 | 0 \ |
| 1782 | -c "Deserializing connection..." \ |
| 1783 | -s "Deserializing connection..." |
| 1784 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1785 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1786 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1787 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1788 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1789 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1790 | 0 \ |
| 1791 | -c "Deserializing connection..." \ |
| 1792 | -s "Deserializing connection..." |
| 1793 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1794 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1795 | run_test "Saving the serialized context to a file" \ |
| 1796 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1797 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1798 | 0 \ |
| 1799 | -s "Save serialized context to a file... ok" \ |
| 1800 | -c "Save serialized context to a file... ok" |
| 1801 | rm -f context_srv.txt |
| 1802 | rm -f context_cli.txt |
| 1803 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1804 | # Tests for DTLS Connection ID extension |
| 1805 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1806 | # So far, the CID API isn't implemented, so we can't |
| 1807 | # grep for output witnessing its use. This needs to be |
| 1808 | # changed once the CID extension is implemented. |
| 1809 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1810 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1811 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1812 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1813 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1814 | 0 \ |
| 1815 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1816 | -s "found CID extension" \ |
| 1817 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1818 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1819 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1820 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1821 | -C "found CID extension" \ |
| 1822 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1823 | -C "Copy CIDs into SSL transform" \ |
| 1824 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1825 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1826 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1827 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1828 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1829 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1830 | 0 \ |
| 1831 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1832 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1833 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1834 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1835 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1836 | -C "found CID extension" \ |
| 1837 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1838 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1839 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1840 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1841 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1842 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1843 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1844 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1845 | 0 \ |
| 1846 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1847 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1848 | -c "client hello, adding CID extension" \ |
| 1849 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1850 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1851 | -s "server hello, adding CID extension" \ |
| 1852 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1853 | -c "Use of CID extension negotiated" \ |
| 1854 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1855 | -c "Copy CIDs into SSL transform" \ |
| 1856 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1857 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1858 | -s "Use of Connection ID has been negotiated" \ |
| 1859 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1860 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1861 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1862 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1863 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1864 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1865 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1866 | 0 \ |
| 1867 | -c "Enable use of CID extension." \ |
| 1868 | -s "Enable use of CID extension." \ |
| 1869 | -c "client hello, adding CID extension" \ |
| 1870 | -s "found CID extension" \ |
| 1871 | -s "Use of CID extension negotiated" \ |
| 1872 | -s "server hello, adding CID extension" \ |
| 1873 | -c "found CID extension" \ |
| 1874 | -c "Use of CID extension negotiated" \ |
| 1875 | -s "Copy CIDs into SSL transform" \ |
| 1876 | -c "Copy CIDs into SSL transform" \ |
| 1877 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1878 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1879 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1880 | -c "Use of Connection ID has been negotiated" \ |
| 1881 | -c "ignoring unexpected CID" \ |
| 1882 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1883 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1884 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1885 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1886 | -p "$P_PXY mtu=800" \ |
| 1887 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1888 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1889 | 0 \ |
| 1890 | -c "Enable use of CID extension." \ |
| 1891 | -s "Enable use of CID extension." \ |
| 1892 | -c "client hello, adding CID extension" \ |
| 1893 | -s "found CID extension" \ |
| 1894 | -s "Use of CID extension negotiated" \ |
| 1895 | -s "server hello, adding CID extension" \ |
| 1896 | -c "found CID extension" \ |
| 1897 | -c "Use of CID extension negotiated" \ |
| 1898 | -s "Copy CIDs into SSL transform" \ |
| 1899 | -c "Copy CIDs into SSL transform" \ |
| 1900 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1901 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1902 | -s "Use of Connection ID has been negotiated" \ |
| 1903 | -c "Use of Connection ID has been negotiated" |
| 1904 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1905 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1906 | 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] | 1907 | -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] | 1908 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1909 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1910 | 0 \ |
| 1911 | -c "Enable use of CID extension." \ |
| 1912 | -s "Enable use of CID extension." \ |
| 1913 | -c "client hello, adding CID extension" \ |
| 1914 | -s "found CID extension" \ |
| 1915 | -s "Use of CID extension negotiated" \ |
| 1916 | -s "server hello, adding CID extension" \ |
| 1917 | -c "found CID extension" \ |
| 1918 | -c "Use of CID extension negotiated" \ |
| 1919 | -s "Copy CIDs into SSL transform" \ |
| 1920 | -c "Copy CIDs into SSL transform" \ |
| 1921 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1922 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1923 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1924 | -c "Use of Connection ID has been negotiated" \ |
| 1925 | -c "ignoring unexpected CID" \ |
| 1926 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1927 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1928 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1929 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1930 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1931 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1932 | 0 \ |
| 1933 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1934 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1935 | -c "client hello, adding CID extension" \ |
| 1936 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1937 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1938 | -s "server hello, adding CID extension" \ |
| 1939 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1940 | -c "Use of CID extension negotiated" \ |
| 1941 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1942 | -c "Copy CIDs into SSL transform" \ |
| 1943 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1944 | -s "Peer CID (length 0 Bytes):" \ |
| 1945 | -s "Use of Connection ID has been negotiated" \ |
| 1946 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1947 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1948 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1949 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1950 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1951 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1952 | 0 \ |
| 1953 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1954 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1955 | -c "client hello, adding CID extension" \ |
| 1956 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1957 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1958 | -s "server hello, adding CID extension" \ |
| 1959 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1960 | -c "Use of CID extension negotiated" \ |
| 1961 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1962 | -c "Copy CIDs into SSL transform" \ |
| 1963 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1964 | -c "Peer CID (length 0 Bytes):" \ |
| 1965 | -s "Use of Connection ID has been negotiated" \ |
| 1966 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1967 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1968 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1969 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1970 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1971 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1972 | 0 \ |
| 1973 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1974 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1975 | -c "client hello, adding CID extension" \ |
| 1976 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1977 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1978 | -s "server hello, adding CID extension" \ |
| 1979 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1980 | -c "Use of CID extension negotiated" \ |
| 1981 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1982 | -c "Copy CIDs into SSL transform" \ |
| 1983 | -S "Use of Connection ID has been negotiated" \ |
| 1984 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1985 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1986 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1987 | 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] | 1988 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1989 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1990 | 0 \ |
| 1991 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1992 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1993 | -c "client hello, adding CID extension" \ |
| 1994 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1995 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1996 | -s "server hello, adding CID extension" \ |
| 1997 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1998 | -c "Use of CID extension negotiated" \ |
| 1999 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2000 | -c "Copy CIDs into SSL transform" \ |
| 2001 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2002 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2003 | -s "Use of Connection ID has been negotiated" \ |
| 2004 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2005 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2006 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2007 | 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] | 2008 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2009 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2010 | 0 \ |
| 2011 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2012 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2013 | -c "client hello, adding CID extension" \ |
| 2014 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2015 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2016 | -s "server hello, adding CID extension" \ |
| 2017 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2018 | -c "Use of CID extension negotiated" \ |
| 2019 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2020 | -c "Copy CIDs into SSL transform" \ |
| 2021 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2022 | -s "Peer CID (length 0 Bytes):" \ |
| 2023 | -s "Use of Connection ID has been negotiated" \ |
| 2024 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2025 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2026 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2027 | 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] | 2028 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2029 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2030 | 0 \ |
| 2031 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2032 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2033 | -c "client hello, adding CID extension" \ |
| 2034 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2035 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2036 | -s "server hello, adding CID extension" \ |
| 2037 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2038 | -c "Use of CID extension negotiated" \ |
| 2039 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2040 | -c "Copy CIDs into SSL transform" \ |
| 2041 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2042 | -c "Peer CID (length 0 Bytes):" \ |
| 2043 | -s "Use of Connection ID has been negotiated" \ |
| 2044 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2045 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2046 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2047 | 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] | 2048 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2049 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2050 | 0 \ |
| 2051 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2052 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2053 | -c "client hello, adding CID extension" \ |
| 2054 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2055 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2056 | -s "server hello, adding CID extension" \ |
| 2057 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2058 | -c "Use of CID extension negotiated" \ |
| 2059 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2060 | -c "Copy CIDs into SSL transform" \ |
| 2061 | -S "Use of Connection ID has been negotiated" \ |
| 2062 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2063 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2064 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2065 | 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] | 2066 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2067 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2068 | 0 \ |
| 2069 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2070 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2071 | -c "client hello, adding CID extension" \ |
| 2072 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2073 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2074 | -s "server hello, adding CID extension" \ |
| 2075 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2076 | -c "Use of CID extension negotiated" \ |
| 2077 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2078 | -c "Copy CIDs into SSL transform" \ |
| 2079 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2080 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2081 | -s "Use of Connection ID has been negotiated" \ |
| 2082 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2083 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2084 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2085 | 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] | 2086 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2087 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2088 | 0 \ |
| 2089 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2090 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2091 | -c "client hello, adding CID extension" \ |
| 2092 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2093 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2094 | -s "server hello, adding CID extension" \ |
| 2095 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2096 | -c "Use of CID extension negotiated" \ |
| 2097 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2098 | -c "Copy CIDs into SSL transform" \ |
| 2099 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2100 | -s "Peer CID (length 0 Bytes):" \ |
| 2101 | -s "Use of Connection ID has been negotiated" \ |
| 2102 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2103 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2104 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2105 | 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] | 2106 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2107 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2108 | 0 \ |
| 2109 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2110 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2111 | -c "client hello, adding CID extension" \ |
| 2112 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2113 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2114 | -s "server hello, adding CID extension" \ |
| 2115 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2116 | -c "Use of CID extension negotiated" \ |
| 2117 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2118 | -c "Copy CIDs into SSL transform" \ |
| 2119 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2120 | -c "Peer CID (length 0 Bytes):" \ |
| 2121 | -s "Use of Connection ID has been negotiated" \ |
| 2122 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2123 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2124 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2125 | 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] | 2126 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2127 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2128 | 0 \ |
| 2129 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2130 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2131 | -c "client hello, adding CID extension" \ |
| 2132 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2133 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2134 | -s "server hello, adding CID extension" \ |
| 2135 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2136 | -c "Use of CID extension negotiated" \ |
| 2137 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2138 | -c "Copy CIDs into SSL transform" \ |
| 2139 | -S "Use of Connection ID has been negotiated" \ |
| 2140 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2141 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2142 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2143 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2144 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2145 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2146 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2147 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2148 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2149 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2150 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2151 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2152 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2153 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2154 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2155 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2156 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2157 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2158 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2159 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2160 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2161 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2162 | 0 \ |
| 2163 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2164 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2165 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2166 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2167 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2168 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2169 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2170 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2171 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2172 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2173 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2174 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2175 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2176 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2177 | 0 \ |
| 2178 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2179 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2180 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2181 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2182 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2183 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2184 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2185 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2186 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2187 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2188 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2189 | 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] | 2190 | -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] | 2191 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2192 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2193 | 0 \ |
| 2194 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2195 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2196 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2197 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2198 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2199 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2200 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2201 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2202 | -c "ignoring unexpected CID" \ |
| 2203 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2204 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2205 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2206 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2207 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2208 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2209 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2210 | 0 \ |
| 2211 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2212 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2213 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2214 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2215 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2216 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2217 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2218 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2219 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2221 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2222 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2223 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2224 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2225 | 0 \ |
| 2226 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2227 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2228 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2229 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2230 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2231 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2232 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2233 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2234 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2235 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2237 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2238 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2239 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2240 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2241 | 0 \ |
| 2242 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2243 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2244 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2245 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2246 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2247 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2248 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2249 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2250 | -c "ignoring unexpected CID" \ |
| 2251 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2252 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2253 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2254 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2255 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2256 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2257 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2258 | 0 \ |
| 2259 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2260 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2261 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2262 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2263 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2264 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2265 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2266 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2267 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2268 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2269 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2270 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2271 | 0 \ |
| 2272 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2273 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2274 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2275 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2276 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2277 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2278 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2279 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2280 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2281 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2282 | -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] | 2283 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2284 | "$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" \ |
| 2285 | 0 \ |
| 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" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2291 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2292 | -c "ignoring unexpected CID" \ |
| 2293 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2294 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2297 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2298 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2299 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2300 | 0 \ |
| 2301 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2302 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2303 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2304 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2305 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2306 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2307 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2308 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2309 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2310 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2311 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2312 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2313 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2314 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2315 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2316 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2317 | 0 \ |
| 2318 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2319 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2320 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2321 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2322 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2323 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2324 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2325 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2326 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2327 | -c "ignoring unexpected CID" \ |
| 2328 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2329 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2332 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2333 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2334 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2335 | 0 \ |
| 2336 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2337 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2338 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2339 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2340 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2341 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2342 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2343 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2344 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2345 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2346 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2347 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2348 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2349 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2350 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2351 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2352 | 0 \ |
| 2353 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2354 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2355 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2356 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2357 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2358 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2359 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2360 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2361 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2362 | -c "ignoring unexpected CID" \ |
| 2363 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2364 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2365 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2366 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2367 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2368 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2369 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2370 | 0 \ |
| 2371 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2372 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2373 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2374 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2375 | -s "Reallocating in_buf" \ |
| 2376 | -s "Reallocating out_buf" |
| 2377 | |
| 2378 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2379 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2380 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2381 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2382 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2383 | 0 \ |
| 2384 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2385 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2386 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2387 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2388 | -s "Reallocating in_buf" \ |
| 2389 | -s "Reallocating out_buf" |
| 2390 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2391 | # Tests for Encrypt-then-MAC extension |
| 2392 | |
| 2393 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2394 | "$P_SRV debug_level=3 \ |
| 2395 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2396 | "$P_CLI debug_level=3" \ |
| 2397 | 0 \ |
| 2398 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2399 | -s "found encrypt then mac extension" \ |
| 2400 | -s "server hello, adding encrypt then mac extension" \ |
| 2401 | -c "found encrypt_then_mac extension" \ |
| 2402 | -c "using encrypt then mac" \ |
| 2403 | -s "using encrypt then mac" |
| 2404 | |
| 2405 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2406 | "$P_SRV debug_level=3 etm=0 \ |
| 2407 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2408 | "$P_CLI debug_level=3 etm=1" \ |
| 2409 | 0 \ |
| 2410 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2411 | -s "found encrypt then mac extension" \ |
| 2412 | -S "server hello, adding encrypt then mac extension" \ |
| 2413 | -C "found encrypt_then_mac extension" \ |
| 2414 | -C "using encrypt then mac" \ |
| 2415 | -S "using encrypt then mac" |
| 2416 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2417 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2418 | "$P_SRV debug_level=3 etm=1 \ |
| 2419 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2420 | "$P_CLI debug_level=3 etm=1" \ |
| 2421 | 0 \ |
| 2422 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2423 | -s "found encrypt then mac extension" \ |
| 2424 | -S "server hello, adding encrypt then mac extension" \ |
| 2425 | -C "found encrypt_then_mac extension" \ |
| 2426 | -C "using encrypt then mac" \ |
| 2427 | -S "using encrypt then mac" |
| 2428 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2429 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2430 | "$P_SRV debug_level=3 etm=1 \ |
| 2431 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2432 | "$P_CLI debug_level=3 etm=0" \ |
| 2433 | 0 \ |
| 2434 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2435 | -S "found encrypt then mac extension" \ |
| 2436 | -S "server hello, adding encrypt then mac extension" \ |
| 2437 | -C "found encrypt_then_mac extension" \ |
| 2438 | -C "using encrypt then mac" \ |
| 2439 | -S "using encrypt then mac" |
| 2440 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2441 | # Tests for Extended Master Secret extension |
| 2442 | |
| 2443 | run_test "Extended Master Secret: default" \ |
| 2444 | "$P_SRV debug_level=3" \ |
| 2445 | "$P_CLI debug_level=3" \ |
| 2446 | 0 \ |
| 2447 | -c "client hello, adding extended_master_secret extension" \ |
| 2448 | -s "found extended master secret extension" \ |
| 2449 | -s "server hello, adding extended master secret extension" \ |
| 2450 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2451 | -c "session hash for extended master secret" \ |
| 2452 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2453 | |
| 2454 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2455 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2456 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2457 | 0 \ |
| 2458 | -c "client hello, adding extended_master_secret extension" \ |
| 2459 | -s "found extended master secret extension" \ |
| 2460 | -S "server hello, adding extended master secret extension" \ |
| 2461 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2462 | -C "session hash for extended master secret" \ |
| 2463 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2464 | |
| 2465 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2466 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2467 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2468 | 0 \ |
| 2469 | -C "client hello, adding extended_master_secret extension" \ |
| 2470 | -S "found extended master secret extension" \ |
| 2471 | -S "server hello, adding extended master secret extension" \ |
| 2472 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2473 | -C "session hash for extended master secret" \ |
| 2474 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2475 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2476 | # Tests for FALLBACK_SCSV |
| 2477 | |
| 2478 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2479 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2480 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2481 | 0 \ |
| 2482 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2483 | -S "received FALLBACK_SCSV" \ |
| 2484 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2485 | -C "is a fatal alert message (msg 86)" |
| 2486 | |
| 2487 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2488 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2489 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2490 | 0 \ |
| 2491 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2492 | -S "received FALLBACK_SCSV" \ |
| 2493 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2494 | -C "is a fatal alert message (msg 86)" |
| 2495 | |
| 2496 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2497 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2498 | "$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] | 2499 | 1 \ |
| 2500 | -c "adding FALLBACK_SCSV" \ |
| 2501 | -s "received FALLBACK_SCSV" \ |
| 2502 | -s "inapropriate fallback" \ |
| 2503 | -c "is a fatal alert message (msg 86)" |
| 2504 | |
| 2505 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2506 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2507 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2508 | 0 \ |
| 2509 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2510 | -s "received FALLBACK_SCSV" \ |
| 2511 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2512 | -C "is a fatal alert message (msg 86)" |
| 2513 | |
| 2514 | requires_openssl_with_fallback_scsv |
| 2515 | run_test "Fallback SCSV: default, openssl server" \ |
| 2516 | "$O_SRV" \ |
| 2517 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2518 | 0 \ |
| 2519 | -C "adding FALLBACK_SCSV" \ |
| 2520 | -C "is a fatal alert message (msg 86)" |
| 2521 | |
| 2522 | requires_openssl_with_fallback_scsv |
| 2523 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2524 | "$O_SRV" \ |
| 2525 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2526 | 1 \ |
| 2527 | -c "adding FALLBACK_SCSV" \ |
| 2528 | -c "is a fatal alert message (msg 86)" |
| 2529 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2530 | requires_openssl_with_fallback_scsv |
| 2531 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2532 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2533 | "$O_CLI -tls1_1" \ |
| 2534 | 0 \ |
| 2535 | -S "received FALLBACK_SCSV" \ |
| 2536 | -S "inapropriate fallback" |
| 2537 | |
| 2538 | requires_openssl_with_fallback_scsv |
| 2539 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2540 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2541 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2542 | 1 \ |
| 2543 | -s "received FALLBACK_SCSV" \ |
| 2544 | -s "inapropriate fallback" |
| 2545 | |
| 2546 | requires_openssl_with_fallback_scsv |
| 2547 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2548 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2549 | "$O_CLI -fallback_scsv" \ |
| 2550 | 0 \ |
| 2551 | -s "received FALLBACK_SCSV" \ |
| 2552 | -S "inapropriate fallback" |
| 2553 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2554 | # Test sending and receiving empty application data records |
| 2555 | |
| 2556 | run_test "Encrypt then MAC: empty application data record" \ |
| 2557 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2558 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2559 | 0 \ |
| 2560 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2561 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2562 | -c "0 bytes written in 1 fragments" |
| 2563 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2564 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2565 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2566 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2567 | 0 \ |
| 2568 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2569 | -c "0 bytes written in 1 fragments" |
| 2570 | |
| 2571 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2572 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2573 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2574 | 0 \ |
| 2575 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2576 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2577 | -c "0 bytes written in 1 fragments" |
| 2578 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2579 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2580 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2581 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2582 | 0 \ |
| 2583 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2584 | -c "0 bytes written in 1 fragments" |
| 2585 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2586 | ## ClientHello generated with |
| 2587 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2588 | ## then manually twiddling the ciphersuite list. |
| 2589 | ## The ClientHello content is spelled out below as a hex string as |
| 2590 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2591 | ## The expected response is an inappropriate_fallback alert. |
| 2592 | requires_openssl_with_fallback_scsv |
| 2593 | run_test "Fallback SCSV: beginning of list" \ |
| 2594 | "$P_SRV debug_level=2" \ |
| 2595 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2596 | 0 \ |
| 2597 | -s "received FALLBACK_SCSV" \ |
| 2598 | -s "inapropriate fallback" |
| 2599 | |
| 2600 | requires_openssl_with_fallback_scsv |
| 2601 | run_test "Fallback SCSV: end of list" \ |
| 2602 | "$P_SRV debug_level=2" \ |
| 2603 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2604 | 0 \ |
| 2605 | -s "received FALLBACK_SCSV" \ |
| 2606 | -s "inapropriate fallback" |
| 2607 | |
| 2608 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2609 | requires_openssl_with_fallback_scsv |
| 2610 | run_test "Fallback SCSV: not in list" \ |
| 2611 | "$P_SRV debug_level=2" \ |
| 2612 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2613 | 0 \ |
| 2614 | -S "received FALLBACK_SCSV" \ |
| 2615 | -S "inapropriate fallback" |
| 2616 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2617 | # Tests for CBC 1/n-1 record splitting |
| 2618 | |
| 2619 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2620 | "$P_SRV" \ |
| 2621 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2622 | request_size=123 force_version=tls1_2" \ |
| 2623 | 0 \ |
| 2624 | -s "Read from client: 123 bytes read" \ |
| 2625 | -S "Read from client: 1 bytes read" \ |
| 2626 | -S "122 bytes read" |
| 2627 | |
| 2628 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2629 | "$P_SRV" \ |
| 2630 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2631 | request_size=123 force_version=tls1_1" \ |
| 2632 | 0 \ |
| 2633 | -s "Read from client: 123 bytes read" \ |
| 2634 | -S "Read from client: 1 bytes read" \ |
| 2635 | -S "122 bytes read" |
| 2636 | |
| 2637 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2638 | "$P_SRV" \ |
| 2639 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2640 | request_size=123 force_version=tls1" \ |
| 2641 | 0 \ |
| 2642 | -S "Read from client: 123 bytes read" \ |
| 2643 | -s "Read from client: 1 bytes read" \ |
| 2644 | -s "122 bytes read" |
| 2645 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2646 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2647 | "$P_SRV" \ |
| 2648 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2649 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2650 | 0 \ |
| 2651 | -s "Read from client: 123 bytes read" \ |
| 2652 | -S "Read from client: 1 bytes read" \ |
| 2653 | -S "122 bytes read" |
| 2654 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2655 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2656 | "$P_SRV nbio=2" \ |
| 2657 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2658 | request_size=123 force_version=tls1" \ |
| 2659 | 0 \ |
| 2660 | -S "Read from client: 123 bytes read" \ |
| 2661 | -s "Read from client: 1 bytes read" \ |
| 2662 | -s "122 bytes read" |
| 2663 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2664 | # Tests for Session Tickets |
| 2665 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2666 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2667 | "$P_SRV debug_level=3 tickets=1" \ |
| 2668 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2669 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2670 | -c "client hello, adding session ticket extension" \ |
| 2671 | -s "found session ticket extension" \ |
| 2672 | -s "server hello, adding session ticket extension" \ |
| 2673 | -c "found session_ticket extension" \ |
| 2674 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2675 | -S "session successfully restored from cache" \ |
| 2676 | -s "session successfully restored from ticket" \ |
| 2677 | -s "a session has been resumed" \ |
| 2678 | -c "a session has been resumed" |
| 2679 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2680 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2681 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2682 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2683 | 0 \ |
| 2684 | -c "client hello, adding session ticket extension" \ |
| 2685 | -s "found session ticket extension" \ |
| 2686 | -s "server hello, adding session ticket extension" \ |
| 2687 | -c "found session_ticket extension" \ |
| 2688 | -c "parse new session ticket" \ |
| 2689 | -S "session successfully restored from cache" \ |
| 2690 | -s "session successfully restored from ticket" \ |
| 2691 | -s "a session has been resumed" \ |
| 2692 | -c "a session has been resumed" |
| 2693 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2694 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2695 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2696 | "$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] | 2697 | 0 \ |
| 2698 | -c "client hello, adding session ticket extension" \ |
| 2699 | -s "found session ticket extension" \ |
| 2700 | -s "server hello, adding session ticket extension" \ |
| 2701 | -c "found session_ticket extension" \ |
| 2702 | -c "parse new session ticket" \ |
| 2703 | -S "session successfully restored from cache" \ |
| 2704 | -S "session successfully restored from ticket" \ |
| 2705 | -S "a session has been resumed" \ |
| 2706 | -C "a session has been resumed" |
| 2707 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2708 | run_test "Session resume using tickets: session copy" \ |
| 2709 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2710 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2711 | 0 \ |
| 2712 | -c "client hello, adding session ticket extension" \ |
| 2713 | -s "found session ticket extension" \ |
| 2714 | -s "server hello, adding session ticket extension" \ |
| 2715 | -c "found session_ticket extension" \ |
| 2716 | -c "parse new session ticket" \ |
| 2717 | -S "session successfully restored from cache" \ |
| 2718 | -s "session successfully restored from ticket" \ |
| 2719 | -s "a session has been resumed" \ |
| 2720 | -c "a session has been resumed" |
| 2721 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2722 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2723 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2724 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2725 | 0 \ |
| 2726 | -c "client hello, adding session ticket extension" \ |
| 2727 | -c "found session_ticket extension" \ |
| 2728 | -c "parse new session ticket" \ |
| 2729 | -c "a session has been resumed" |
| 2730 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2731 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2732 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2733 | "( $O_CLI -sess_out $SESSION; \ |
| 2734 | $O_CLI -sess_in $SESSION; \ |
| 2735 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2736 | 0 \ |
| 2737 | -s "found session ticket extension" \ |
| 2738 | -s "server hello, adding session ticket extension" \ |
| 2739 | -S "session successfully restored from cache" \ |
| 2740 | -s "session successfully restored from ticket" \ |
| 2741 | -s "a session has been resumed" |
| 2742 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2743 | # Tests for Session Tickets with DTLS |
| 2744 | |
| 2745 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2746 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2747 | "$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] | 2748 | 0 \ |
| 2749 | -c "client hello, adding session ticket extension" \ |
| 2750 | -s "found session ticket extension" \ |
| 2751 | -s "server hello, adding session ticket extension" \ |
| 2752 | -c "found session_ticket extension" \ |
| 2753 | -c "parse new session ticket" \ |
| 2754 | -S "session successfully restored from cache" \ |
| 2755 | -s "session successfully restored from ticket" \ |
| 2756 | -s "a session has been resumed" \ |
| 2757 | -c "a session has been resumed" |
| 2758 | |
| 2759 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2760 | "$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] | 2761 | "$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] | 2762 | 0 \ |
| 2763 | -c "client hello, adding session ticket extension" \ |
| 2764 | -s "found session ticket extension" \ |
| 2765 | -s "server hello, adding session ticket extension" \ |
| 2766 | -c "found session_ticket extension" \ |
| 2767 | -c "parse new session ticket" \ |
| 2768 | -S "session successfully restored from cache" \ |
| 2769 | -s "session successfully restored from ticket" \ |
| 2770 | -s "a session has been resumed" \ |
| 2771 | -c "a session has been resumed" |
| 2772 | |
| 2773 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2774 | "$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] | 2775 | "$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] | 2776 | 0 \ |
| 2777 | -c "client hello, adding session ticket extension" \ |
| 2778 | -s "found session ticket extension" \ |
| 2779 | -s "server hello, adding session ticket extension" \ |
| 2780 | -c "found session_ticket extension" \ |
| 2781 | -c "parse new session ticket" \ |
| 2782 | -S "session successfully restored from cache" \ |
| 2783 | -S "session successfully restored from ticket" \ |
| 2784 | -S "a session has been resumed" \ |
| 2785 | -C "a session has been resumed" |
| 2786 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2787 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2788 | "$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] | 2789 | "$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] | 2790 | 0 \ |
| 2791 | -c "client hello, adding session ticket extension" \ |
| 2792 | -s "found session ticket extension" \ |
| 2793 | -s "server hello, adding session ticket extension" \ |
| 2794 | -c "found session_ticket extension" \ |
| 2795 | -c "parse new session ticket" \ |
| 2796 | -S "session successfully restored from cache" \ |
| 2797 | -s "session successfully restored from ticket" \ |
| 2798 | -s "a session has been resumed" \ |
| 2799 | -c "a session has been resumed" |
| 2800 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2801 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2802 | "$O_SRV -dtls1" \ |
| 2803 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2804 | 0 \ |
| 2805 | -c "client hello, adding session ticket extension" \ |
| 2806 | -c "found session_ticket extension" \ |
| 2807 | -c "parse new session ticket" \ |
| 2808 | -c "a session has been resumed" |
| 2809 | |
| 2810 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2811 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2812 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2813 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2814 | rm -f $SESSION )" \ |
| 2815 | 0 \ |
| 2816 | -s "found session ticket extension" \ |
| 2817 | -s "server hello, adding session ticket extension" \ |
| 2818 | -S "session successfully restored from cache" \ |
| 2819 | -s "session successfully restored from ticket" \ |
| 2820 | -s "a session has been resumed" |
| 2821 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2822 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2824 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2825 | "$P_SRV debug_level=3 tickets=0" \ |
| 2826 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2827 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2828 | -c "client hello, adding session ticket extension" \ |
| 2829 | -s "found session ticket extension" \ |
| 2830 | -S "server hello, adding session ticket extension" \ |
| 2831 | -C "found session_ticket extension" \ |
| 2832 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2833 | -s "session successfully restored from cache" \ |
| 2834 | -S "session successfully restored from ticket" \ |
| 2835 | -s "a session has been resumed" \ |
| 2836 | -c "a session has been resumed" |
| 2837 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2838 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2839 | "$P_SRV debug_level=3 tickets=1" \ |
| 2840 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2841 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2842 | -C "client hello, adding session ticket extension" \ |
| 2843 | -S "found session ticket extension" \ |
| 2844 | -S "server hello, adding session ticket extension" \ |
| 2845 | -C "found session_ticket extension" \ |
| 2846 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2847 | -s "session successfully restored from cache" \ |
| 2848 | -S "session successfully restored from ticket" \ |
| 2849 | -s "a session has been resumed" \ |
| 2850 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2851 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2852 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2853 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2854 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2855 | 0 \ |
| 2856 | -S "session successfully restored from cache" \ |
| 2857 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2858 | -S "a session has been resumed" \ |
| 2859 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2860 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2861 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2862 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2863 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2864 | 0 \ |
| 2865 | -s "session successfully restored from cache" \ |
| 2866 | -S "session successfully restored from ticket" \ |
| 2867 | -s "a session has been resumed" \ |
| 2868 | -c "a session has been resumed" |
| 2869 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2870 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2871 | "$P_SRV debug_level=3 tickets=0" \ |
| 2872 | "$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] | 2873 | 0 \ |
| 2874 | -s "session successfully restored from cache" \ |
| 2875 | -S "session successfully restored from ticket" \ |
| 2876 | -s "a session has been resumed" \ |
| 2877 | -c "a session has been resumed" |
| 2878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2879 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2880 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2881 | "$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] | 2882 | 0 \ |
| 2883 | -S "session successfully restored from cache" \ |
| 2884 | -S "session successfully restored from ticket" \ |
| 2885 | -S "a session has been resumed" \ |
| 2886 | -C "a session has been resumed" |
| 2887 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2888 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2889 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2890 | "$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] | 2891 | 0 \ |
| 2892 | -s "session successfully restored from cache" \ |
| 2893 | -S "session successfully restored from ticket" \ |
| 2894 | -s "a session has been resumed" \ |
| 2895 | -c "a session has been resumed" |
| 2896 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2897 | run_test "Session resume using cache: session copy" \ |
| 2898 | "$P_SRV debug_level=3 tickets=0" \ |
| 2899 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2900 | 0 \ |
| 2901 | -s "session successfully restored from cache" \ |
| 2902 | -S "session successfully restored from ticket" \ |
| 2903 | -s "a session has been resumed" \ |
| 2904 | -c "a session has been resumed" |
| 2905 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2906 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2907 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2908 | "( $O_CLI -sess_out $SESSION; \ |
| 2909 | $O_CLI -sess_in $SESSION; \ |
| 2910 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2911 | 0 \ |
| 2912 | -s "found session ticket extension" \ |
| 2913 | -S "server hello, adding session ticket extension" \ |
| 2914 | -s "session successfully restored from cache" \ |
| 2915 | -S "session successfully restored from ticket" \ |
| 2916 | -s "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 server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2919 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2920 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2921 | 0 \ |
| 2922 | -C "found session_ticket extension" \ |
| 2923 | -C "parse new session ticket" \ |
| 2924 | -c "a session has been resumed" |
| 2925 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2926 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2927 | |
| 2928 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2929 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2930 | "$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] | 2931 | 0 \ |
| 2932 | -c "client hello, adding session ticket extension" \ |
| 2933 | -s "found session ticket extension" \ |
| 2934 | -S "server hello, adding session ticket extension" \ |
| 2935 | -C "found session_ticket extension" \ |
| 2936 | -C "parse new session ticket" \ |
| 2937 | -s "session successfully restored from cache" \ |
| 2938 | -S "session successfully restored from ticket" \ |
| 2939 | -s "a session has been resumed" \ |
| 2940 | -c "a session has been resumed" |
| 2941 | |
| 2942 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2943 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2944 | "$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] | 2945 | 0 \ |
| 2946 | -C "client hello, adding session ticket extension" \ |
| 2947 | -S "found session ticket extension" \ |
| 2948 | -S "server hello, adding session ticket extension" \ |
| 2949 | -C "found session_ticket extension" \ |
| 2950 | -C "parse new session ticket" \ |
| 2951 | -s "session successfully restored from cache" \ |
| 2952 | -S "session successfully restored from ticket" \ |
| 2953 | -s "a session has been resumed" \ |
| 2954 | -c "a session has been resumed" |
| 2955 | |
| 2956 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2957 | "$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] | 2958 | "$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] | 2959 | 0 \ |
| 2960 | -S "session successfully restored from cache" \ |
| 2961 | -S "session successfully restored from ticket" \ |
| 2962 | -S "a session has been resumed" \ |
| 2963 | -C "a session has been resumed" |
| 2964 | |
| 2965 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2966 | "$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] | 2967 | "$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] | 2968 | 0 \ |
| 2969 | -s "session successfully restored from cache" \ |
| 2970 | -S "session successfully restored from ticket" \ |
| 2971 | -s "a session has been resumed" \ |
| 2972 | -c "a session has been resumed" |
| 2973 | |
| 2974 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2975 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2976 | "$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] | 2977 | 0 \ |
| 2978 | -s "session successfully restored from cache" \ |
| 2979 | -S "session successfully restored from ticket" \ |
| 2980 | -s "a session has been resumed" \ |
| 2981 | -c "a session has been resumed" |
| 2982 | |
| 2983 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2984 | "$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] | 2985 | "$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] | 2986 | 0 \ |
| 2987 | -S "session successfully restored from cache" \ |
| 2988 | -S "session successfully restored from ticket" \ |
| 2989 | -S "a session has been resumed" \ |
| 2990 | -C "a session has been resumed" |
| 2991 | |
| 2992 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2993 | "$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] | 2994 | "$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] | 2995 | 0 \ |
| 2996 | -s "session successfully restored from cache" \ |
| 2997 | -S "session successfully restored from ticket" \ |
| 2998 | -s "a session has been resumed" \ |
| 2999 | -c "a session has been resumed" |
| 3000 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3001 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3002 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3003 | "$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] | 3004 | 0 \ |
| 3005 | -s "session successfully restored from cache" \ |
| 3006 | -S "session successfully restored from ticket" \ |
| 3007 | -s "a session has been resumed" \ |
| 3008 | -c "a session has been resumed" |
| 3009 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3010 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3011 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 3012 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 3013 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 3014 | rm -f $SESSION )" \ |
| 3015 | 0 \ |
| 3016 | -s "found session ticket extension" \ |
| 3017 | -S "server hello, adding session ticket extension" \ |
| 3018 | -s "session successfully restored from cache" \ |
| 3019 | -S "session successfully restored from ticket" \ |
| 3020 | -s "a session has been resumed" |
| 3021 | |
| 3022 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3023 | "$O_SRV -dtls1" \ |
| 3024 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3025 | 0 \ |
| 3026 | -C "found session_ticket extension" \ |
| 3027 | -C "parse new session ticket" \ |
| 3028 | -c "a session has been resumed" |
| 3029 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3030 | # Tests for Max Fragment Length extension |
| 3031 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3032 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3033 | printf '%s defines MBEDTLS_SSL_MAX_CONTENT_LEN to be less than 4096. Fragment length tests will fail.\n' "${CONFIG_H}" |
Hanno Becker | 6428f8d | 2017-09-22 16:58:50 +0100 | [diff] [blame] | 3034 | exit 1 |
| 3035 | fi |
| 3036 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3037 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3038 | echo "Using non-default maximum content length $MAX_CONTENT_LEN" |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3039 | fi |
| 3040 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3041 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3042 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3043 | "$P_SRV debug_level=3" \ |
| 3044 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3045 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3046 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3047 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3048 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3049 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3050 | -C "client hello, adding max_fragment_length extension" \ |
| 3051 | -S "found max fragment length extension" \ |
| 3052 | -S "server hello, max_fragment_length extension" \ |
| 3053 | -C "found max_fragment_length extension" |
| 3054 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3055 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3056 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3057 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3058 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3059 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3060 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3061 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3062 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3063 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3064 | -C "client hello, adding max_fragment_length extension" \ |
| 3065 | -S "found max fragment length extension" \ |
| 3066 | -S "server hello, max_fragment_length extension" \ |
| 3067 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3068 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3069 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3070 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3071 | |
| 3072 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3073 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3074 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3075 | "$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] | 3076 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3077 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3078 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3079 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3080 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3081 | -C "client hello, adding max_fragment_length extension" \ |
| 3082 | -S "found max fragment length extension" \ |
| 3083 | -S "server hello, max_fragment_length extension" \ |
| 3084 | -C "found max_fragment_length extension" \ |
| 3085 | -c "fragment larger than.*maximum " |
| 3086 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3087 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3088 | # (session fragment length will be 16384 regardless of mbedtls |
| 3089 | # content length configuration.) |
| 3090 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3091 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3092 | run_test "Max fragment length: disabled, larger message" \ |
| 3093 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3094 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3095 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3096 | -C "Maximum input fragment length is 16384" \ |
| 3097 | -C "Maximum output fragment length is 16384" \ |
| 3098 | -S "Maximum input fragment length is 16384" \ |
| 3099 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3100 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3101 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3102 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3103 | |
| 3104 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3105 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 3106 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3107 | "$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] | 3108 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3109 | -C "Maximum input fragment length is 16384" \ |
| 3110 | -C "Maximum output fragment length is 16384" \ |
| 3111 | -S "Maximum input fragment length is 16384" \ |
| 3112 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3113 | -c "fragment larger than.*maximum " |
| 3114 | |
| 3115 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3116 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3117 | "$P_SRV debug_level=3" \ |
| 3118 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3119 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3120 | -c "Maximum input fragment length is 4096" \ |
| 3121 | -c "Maximum output fragment length is 4096" \ |
| 3122 | -s "Maximum input fragment length is 4096" \ |
| 3123 | -s "Maximum output fragment length is 4096" \ |
| 3124 | -c "client hello, adding max_fragment_length extension" \ |
| 3125 | -s "found max fragment length extension" \ |
| 3126 | -s "server hello, max_fragment_length extension" \ |
| 3127 | -c "found max_fragment_length extension" |
| 3128 | |
| 3129 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3130 | run_test "Max fragment length: client 512, server 1024" \ |
| 3131 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3132 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3133 | 0 \ |
| 3134 | -c "Maximum input fragment length is 512" \ |
| 3135 | -c "Maximum output fragment length is 512" \ |
| 3136 | -s "Maximum input fragment length is 512" \ |
| 3137 | -s "Maximum output fragment length is 512" \ |
| 3138 | -c "client hello, adding max_fragment_length extension" \ |
| 3139 | -s "found max fragment length extension" \ |
| 3140 | -s "server hello, max_fragment_length extension" \ |
| 3141 | -c "found max_fragment_length extension" |
| 3142 | |
| 3143 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3144 | run_test "Max fragment length: client 512, server 2048" \ |
| 3145 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3146 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3147 | 0 \ |
| 3148 | -c "Maximum input fragment length is 512" \ |
| 3149 | -c "Maximum output fragment length is 512" \ |
| 3150 | -s "Maximum input fragment length is 512" \ |
| 3151 | -s "Maximum output fragment length is 512" \ |
| 3152 | -c "client hello, adding max_fragment_length extension" \ |
| 3153 | -s "found max fragment length extension" \ |
| 3154 | -s "server hello, max_fragment_length extension" \ |
| 3155 | -c "found max_fragment_length extension" |
| 3156 | |
| 3157 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3158 | run_test "Max fragment length: client 512, server 4096" \ |
| 3159 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3160 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3161 | 0 \ |
| 3162 | -c "Maximum input fragment length is 512" \ |
| 3163 | -c "Maximum output fragment length is 512" \ |
| 3164 | -s "Maximum input fragment length is 512" \ |
| 3165 | -s "Maximum output fragment length is 512" \ |
| 3166 | -c "client hello, adding max_fragment_length extension" \ |
| 3167 | -s "found max fragment length extension" \ |
| 3168 | -s "server hello, max_fragment_length extension" \ |
| 3169 | -c "found max_fragment_length extension" |
| 3170 | |
| 3171 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3172 | run_test "Max fragment length: client 1024, server 512" \ |
| 3173 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3174 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3175 | 0 \ |
| 3176 | -c "Maximum input fragment length is 1024" \ |
| 3177 | -c "Maximum output fragment length is 1024" \ |
| 3178 | -s "Maximum input fragment length is 1024" \ |
| 3179 | -s "Maximum output fragment length is 512" \ |
| 3180 | -c "client hello, adding max_fragment_length extension" \ |
| 3181 | -s "found max fragment length extension" \ |
| 3182 | -s "server hello, max_fragment_length extension" \ |
| 3183 | -c "found max_fragment_length extension" |
| 3184 | |
| 3185 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3186 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3187 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3188 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3189 | 0 \ |
| 3190 | -c "Maximum input fragment length is 1024" \ |
| 3191 | -c "Maximum output fragment length is 1024" \ |
| 3192 | -s "Maximum input fragment length is 1024" \ |
| 3193 | -s "Maximum output fragment length is 1024" \ |
| 3194 | -c "client hello, adding max_fragment_length extension" \ |
| 3195 | -s "found max fragment length extension" \ |
| 3196 | -s "server hello, max_fragment_length extension" \ |
| 3197 | -c "found max_fragment_length extension" |
| 3198 | |
| 3199 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3200 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3201 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3202 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3203 | 0 \ |
| 3204 | -c "Maximum input fragment length is 1024" \ |
| 3205 | -c "Maximum output fragment length is 1024" \ |
| 3206 | -s "Maximum input fragment length is 1024" \ |
| 3207 | -s "Maximum output fragment length is 1024" \ |
| 3208 | -c "client hello, adding max_fragment_length extension" \ |
| 3209 | -s "found max fragment length extension" \ |
| 3210 | -s "server hello, max_fragment_length extension" \ |
| 3211 | -c "found max_fragment_length extension" |
| 3212 | |
| 3213 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3214 | run_test "Max fragment length: client 2048, server 512" \ |
| 3215 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3216 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3217 | 0 \ |
| 3218 | -c "Maximum input fragment length is 2048" \ |
| 3219 | -c "Maximum output fragment length is 2048" \ |
| 3220 | -s "Maximum input fragment length is 2048" \ |
| 3221 | -s "Maximum output fragment length is 512" \ |
| 3222 | -c "client hello, adding max_fragment_length extension" \ |
| 3223 | -s "found max fragment length extension" \ |
| 3224 | -s "server hello, max_fragment_length extension" \ |
| 3225 | -c "found max_fragment_length extension" |
| 3226 | |
| 3227 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3228 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3229 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3230 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3231 | 0 \ |
| 3232 | -c "Maximum input fragment length is 2048" \ |
| 3233 | -c "Maximum output fragment length is 2048" \ |
| 3234 | -s "Maximum input fragment length is 2048" \ |
| 3235 | -s "Maximum output fragment length is 1024" \ |
| 3236 | -c "client hello, adding max_fragment_length extension" \ |
| 3237 | -s "found max fragment length extension" \ |
| 3238 | -s "server hello, max_fragment_length extension" \ |
| 3239 | -c "found max_fragment_length extension" |
| 3240 | |
| 3241 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3242 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3243 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3244 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3245 | 0 \ |
| 3246 | -c "Maximum input fragment length is 2048" \ |
| 3247 | -c "Maximum output fragment length is 2048" \ |
| 3248 | -s "Maximum input fragment length is 2048" \ |
| 3249 | -s "Maximum output fragment length is 2048" \ |
| 3250 | -c "client hello, adding max_fragment_length extension" \ |
| 3251 | -s "found max fragment length extension" \ |
| 3252 | -s "server hello, max_fragment_length extension" \ |
| 3253 | -c "found max_fragment_length extension" |
| 3254 | |
| 3255 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3256 | run_test "Max fragment length: client 4096, server 512" \ |
| 3257 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3258 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3259 | 0 \ |
| 3260 | -c "Maximum input fragment length is 4096" \ |
| 3261 | -c "Maximum output fragment length is 4096" \ |
| 3262 | -s "Maximum input fragment length is 4096" \ |
| 3263 | -s "Maximum output fragment length is 512" \ |
| 3264 | -c "client hello, adding max_fragment_length extension" \ |
| 3265 | -s "found max fragment length extension" \ |
| 3266 | -s "server hello, max_fragment_length extension" \ |
| 3267 | -c "found max_fragment_length extension" |
| 3268 | |
| 3269 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3270 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3271 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3272 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3273 | 0 \ |
| 3274 | -c "Maximum input fragment length is 4096" \ |
| 3275 | -c "Maximum output fragment length is 4096" \ |
| 3276 | -s "Maximum input fragment length is 4096" \ |
| 3277 | -s "Maximum output fragment length is 1024" \ |
| 3278 | -c "client hello, adding max_fragment_length extension" \ |
| 3279 | -s "found max fragment length extension" \ |
| 3280 | -s "server hello, max_fragment_length extension" \ |
| 3281 | -c "found max_fragment_length extension" |
| 3282 | |
| 3283 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3284 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3285 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3286 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3287 | 0 \ |
| 3288 | -c "Maximum input fragment length is 4096" \ |
| 3289 | -c "Maximum output fragment length is 4096" \ |
| 3290 | -s "Maximum input fragment length is 4096" \ |
| 3291 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3292 | -c "client hello, adding max_fragment_length extension" \ |
| 3293 | -s "found max fragment length extension" \ |
| 3294 | -s "server hello, max_fragment_length extension" \ |
| 3295 | -c "found max_fragment_length extension" |
| 3296 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3297 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3298 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3299 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3300 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3301 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3302 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3303 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3304 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3305 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3306 | -C "client hello, adding max_fragment_length extension" \ |
| 3307 | -S "found max fragment length extension" \ |
| 3308 | -S "server hello, max_fragment_length extension" \ |
| 3309 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3310 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3311 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3312 | requires_gnutls |
| 3313 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3314 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3315 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3316 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3317 | -c "Maximum input fragment length is 4096" \ |
| 3318 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3319 | -c "client hello, adding max_fragment_length extension" \ |
| 3320 | -c "found max_fragment_length extension" |
| 3321 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3322 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3323 | run_test "Max fragment length: client, message just fits" \ |
| 3324 | "$P_SRV debug_level=3" \ |
| 3325 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3326 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3327 | -c "Maximum input fragment length is 2048" \ |
| 3328 | -c "Maximum output fragment length is 2048" \ |
| 3329 | -s "Maximum input fragment length is 2048" \ |
| 3330 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3331 | -c "client hello, adding max_fragment_length extension" \ |
| 3332 | -s "found max fragment length extension" \ |
| 3333 | -s "server hello, max_fragment_length extension" \ |
| 3334 | -c "found max_fragment_length extension" \ |
| 3335 | -c "2048 bytes written in 1 fragments" \ |
| 3336 | -s "2048 bytes read" |
| 3337 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3338 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3339 | run_test "Max fragment length: client, larger message" \ |
| 3340 | "$P_SRV debug_level=3" \ |
| 3341 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3342 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3343 | -c "Maximum input fragment length is 2048" \ |
| 3344 | -c "Maximum output fragment length is 2048" \ |
| 3345 | -s "Maximum input fragment length is 2048" \ |
| 3346 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3347 | -c "client hello, adding max_fragment_length extension" \ |
| 3348 | -s "found max fragment length extension" \ |
| 3349 | -s "server hello, max_fragment_length extension" \ |
| 3350 | -c "found max_fragment_length extension" \ |
| 3351 | -c "2345 bytes written in 2 fragments" \ |
| 3352 | -s "2048 bytes read" \ |
| 3353 | -s "297 bytes read" |
| 3354 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3355 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3356 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3357 | "$P_SRV debug_level=3 dtls=1" \ |
| 3358 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3359 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3360 | -c "Maximum input fragment length is 2048" \ |
| 3361 | -c "Maximum output fragment length is 2048" \ |
| 3362 | -s "Maximum input fragment length is 2048" \ |
| 3363 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3364 | -c "client hello, adding max_fragment_length extension" \ |
| 3365 | -s "found max fragment length extension" \ |
| 3366 | -s "server hello, max_fragment_length extension" \ |
| 3367 | -c "found max_fragment_length extension" \ |
| 3368 | -c "fragment larger than.*maximum" |
| 3369 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3370 | # Tests for renegotiation |
| 3371 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3372 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3373 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3374 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3375 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3376 | 0 \ |
| 3377 | -C "client hello, adding renegotiation extension" \ |
| 3378 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3379 | -S "found renegotiation extension" \ |
| 3380 | -s "server hello, secure renegotiation extension" \ |
| 3381 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3382 | -C "=> renegotiate" \ |
| 3383 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3384 | -S "write hello request" |
| 3385 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3387 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3388 | "$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] | 3389 | "$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] | 3390 | 0 \ |
| 3391 | -c "client hello, adding renegotiation extension" \ |
| 3392 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3393 | -s "found renegotiation extension" \ |
| 3394 | -s "server hello, secure renegotiation extension" \ |
| 3395 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3396 | -c "=> renegotiate" \ |
| 3397 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3398 | -S "write hello request" |
| 3399 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3400 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3401 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3402 | "$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] | 3403 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3404 | 0 \ |
| 3405 | -c "client hello, adding renegotiation extension" \ |
| 3406 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3407 | -s "found renegotiation extension" \ |
| 3408 | -s "server hello, secure renegotiation extension" \ |
| 3409 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3410 | -c "=> renegotiate" \ |
| 3411 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3412 | -s "write hello request" |
| 3413 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3414 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3415 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3416 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3417 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3418 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3419 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3420 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3421 | 0 \ |
| 3422 | -c "client hello, adding renegotiation extension" \ |
| 3423 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3424 | -s "found renegotiation extension" \ |
| 3425 | -s "server hello, secure renegotiation extension" \ |
| 3426 | -c "found renegotiation extension" \ |
| 3427 | -c "=> renegotiate" \ |
| 3428 | -s "=> renegotiate" \ |
| 3429 | -S "write hello request" \ |
| 3430 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3431 | |
| 3432 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3433 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3434 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3435 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3436 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3437 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3438 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3439 | 0 \ |
| 3440 | -c "client hello, adding renegotiation extension" \ |
| 3441 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3442 | -s "found renegotiation extension" \ |
| 3443 | -s "server hello, secure renegotiation extension" \ |
| 3444 | -c "found renegotiation extension" \ |
| 3445 | -c "=> renegotiate" \ |
| 3446 | -s "=> renegotiate" \ |
| 3447 | -s "write hello request" \ |
| 3448 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3449 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3450 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3451 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3452 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3453 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3454 | 0 \ |
| 3455 | -c "client hello, adding renegotiation extension" \ |
| 3456 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3457 | -s "found renegotiation extension" \ |
| 3458 | -s "server hello, secure renegotiation extension" \ |
| 3459 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3460 | -c "=> renegotiate" \ |
| 3461 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3462 | -s "write hello request" |
| 3463 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3464 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3465 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3466 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3467 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3468 | "$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" \ |
| 3469 | 0 \ |
| 3470 | -c "Maximum input fragment length is 2048" \ |
| 3471 | -c "Maximum output fragment length is 2048" \ |
| 3472 | -s "Maximum input fragment length is 2048" \ |
| 3473 | -s "Maximum output fragment length is 512" \ |
| 3474 | -c "client hello, adding max_fragment_length extension" \ |
| 3475 | -s "found max fragment length extension" \ |
| 3476 | -s "server hello, max_fragment_length extension" \ |
| 3477 | -c "found max_fragment_length extension" \ |
| 3478 | -c "client hello, adding renegotiation extension" \ |
| 3479 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3480 | -s "found renegotiation extension" \ |
| 3481 | -s "server hello, secure renegotiation extension" \ |
| 3482 | -c "found renegotiation extension" \ |
| 3483 | -c "=> renegotiate" \ |
| 3484 | -s "=> renegotiate" \ |
| 3485 | -s "write hello request" |
| 3486 | |
| 3487 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3488 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3489 | "$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] | 3490 | "$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] | 3491 | 1 \ |
| 3492 | -c "client hello, adding renegotiation extension" \ |
| 3493 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3494 | -S "found renegotiation extension" \ |
| 3495 | -s "server hello, secure renegotiation extension" \ |
| 3496 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3497 | -c "=> renegotiate" \ |
| 3498 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3499 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3500 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3501 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3502 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3503 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3504 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3505 | "$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] | 3506 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3507 | 0 \ |
| 3508 | -C "client hello, adding renegotiation extension" \ |
| 3509 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3510 | -S "found renegotiation extension" \ |
| 3511 | -s "server hello, secure renegotiation extension" \ |
| 3512 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3513 | -C "=> renegotiate" \ |
| 3514 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3515 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3516 | -S "SSL - An unexpected message was received from our peer" \ |
| 3517 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3518 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3519 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3520 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3521 | "$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] | 3522 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3523 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3524 | 0 \ |
| 3525 | -C "client hello, adding renegotiation extension" \ |
| 3526 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3527 | -S "found renegotiation extension" \ |
| 3528 | -s "server hello, secure renegotiation extension" \ |
| 3529 | -c "found renegotiation extension" \ |
| 3530 | -C "=> renegotiate" \ |
| 3531 | -S "=> renegotiate" \ |
| 3532 | -s "write hello request" \ |
| 3533 | -S "SSL - An unexpected message was received from our peer" \ |
| 3534 | -S "failed" |
| 3535 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3536 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3537 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3538 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3539 | "$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] | 3540 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3541 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3542 | 0 \ |
| 3543 | -C "client hello, adding renegotiation extension" \ |
| 3544 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3545 | -S "found renegotiation extension" \ |
| 3546 | -s "server hello, secure renegotiation extension" \ |
| 3547 | -c "found renegotiation extension" \ |
| 3548 | -C "=> renegotiate" \ |
| 3549 | -S "=> renegotiate" \ |
| 3550 | -s "write hello request" \ |
| 3551 | -S "SSL - An unexpected message was received from our peer" \ |
| 3552 | -S "failed" |
| 3553 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3554 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3555 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3556 | "$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] | 3557 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3558 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3559 | 0 \ |
| 3560 | -C "client hello, adding renegotiation extension" \ |
| 3561 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3562 | -S "found renegotiation extension" \ |
| 3563 | -s "server hello, secure renegotiation extension" \ |
| 3564 | -c "found renegotiation extension" \ |
| 3565 | -C "=> renegotiate" \ |
| 3566 | -S "=> renegotiate" \ |
| 3567 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3568 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3569 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3570 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3571 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3572 | "$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] | 3573 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3574 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3575 | 0 \ |
| 3576 | -c "client hello, adding renegotiation extension" \ |
| 3577 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3578 | -s "found renegotiation extension" \ |
| 3579 | -s "server hello, secure renegotiation extension" \ |
| 3580 | -c "found renegotiation extension" \ |
| 3581 | -c "=> renegotiate" \ |
| 3582 | -s "=> renegotiate" \ |
| 3583 | -s "write hello request" \ |
| 3584 | -S "SSL - An unexpected message was received from our peer" \ |
| 3585 | -S "failed" |
| 3586 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3587 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3588 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3589 | "$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] | 3590 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3591 | 0 \ |
| 3592 | -C "client hello, adding renegotiation extension" \ |
| 3593 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3594 | -S "found renegotiation extension" \ |
| 3595 | -s "server hello, secure renegotiation extension" \ |
| 3596 | -c "found renegotiation extension" \ |
| 3597 | -S "record counter limit reached: renegotiate" \ |
| 3598 | -C "=> renegotiate" \ |
| 3599 | -S "=> renegotiate" \ |
| 3600 | -S "write hello request" \ |
| 3601 | -S "SSL - An unexpected message was received from our peer" \ |
| 3602 | -S "failed" |
| 3603 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3604 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3605 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3606 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3607 | "$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] | 3608 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3609 | 0 \ |
| 3610 | -c "client hello, adding renegotiation extension" \ |
| 3611 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3612 | -s "found renegotiation extension" \ |
| 3613 | -s "server hello, secure renegotiation extension" \ |
| 3614 | -c "found renegotiation extension" \ |
| 3615 | -s "record counter limit reached: renegotiate" \ |
| 3616 | -c "=> renegotiate" \ |
| 3617 | -s "=> renegotiate" \ |
| 3618 | -s "write hello request" \ |
| 3619 | -S "SSL - An unexpected message was received from our peer" \ |
| 3620 | -S "failed" |
| 3621 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3622 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3623 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3624 | "$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] | 3625 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3626 | 0 \ |
| 3627 | -c "client hello, adding renegotiation extension" \ |
| 3628 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3629 | -s "found renegotiation extension" \ |
| 3630 | -s "server hello, secure renegotiation extension" \ |
| 3631 | -c "found renegotiation extension" \ |
| 3632 | -s "record counter limit reached: renegotiate" \ |
| 3633 | -c "=> renegotiate" \ |
| 3634 | -s "=> renegotiate" \ |
| 3635 | -s "write hello request" \ |
| 3636 | -S "SSL - An unexpected message was received from our peer" \ |
| 3637 | -S "failed" |
| 3638 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3639 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3640 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3641 | "$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] | 3642 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3643 | 0 \ |
| 3644 | -C "client hello, adding renegotiation extension" \ |
| 3645 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3646 | -S "found renegotiation extension" \ |
| 3647 | -s "server hello, secure renegotiation extension" \ |
| 3648 | -c "found renegotiation extension" \ |
| 3649 | -S "record counter limit reached: renegotiate" \ |
| 3650 | -C "=> renegotiate" \ |
| 3651 | -S "=> renegotiate" \ |
| 3652 | -S "write hello request" \ |
| 3653 | -S "SSL - An unexpected message was received from our peer" \ |
| 3654 | -S "failed" |
| 3655 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3656 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3657 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3658 | "$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] | 3659 | "$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] | 3660 | 0 \ |
| 3661 | -c "client hello, adding renegotiation extension" \ |
| 3662 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3663 | -s "found renegotiation extension" \ |
| 3664 | -s "server hello, secure renegotiation extension" \ |
| 3665 | -c "found renegotiation extension" \ |
| 3666 | -c "=> renegotiate" \ |
| 3667 | -s "=> renegotiate" \ |
| 3668 | -S "write hello request" |
| 3669 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3670 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3671 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3672 | "$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] | 3673 | "$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] | 3674 | 0 \ |
| 3675 | -c "client hello, adding renegotiation extension" \ |
| 3676 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3677 | -s "found renegotiation extension" \ |
| 3678 | -s "server hello, secure renegotiation extension" \ |
| 3679 | -c "found renegotiation extension" \ |
| 3680 | -c "=> renegotiate" \ |
| 3681 | -s "=> renegotiate" \ |
| 3682 | -s "write hello request" |
| 3683 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3684 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3685 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3686 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3687 | "$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] | 3688 | 0 \ |
| 3689 | -c "client hello, adding renegotiation extension" \ |
| 3690 | -c "found renegotiation extension" \ |
| 3691 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3692 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3693 | -C "error" \ |
| 3694 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3695 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3696 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3697 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3698 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3699 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3700 | "$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] | 3701 | 0 \ |
| 3702 | -c "client hello, adding renegotiation extension" \ |
| 3703 | -c "found renegotiation extension" \ |
| 3704 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3705 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3706 | -C "error" \ |
| 3707 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3708 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3709 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3710 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3711 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3712 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3713 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3714 | 1 \ |
| 3715 | -c "client hello, adding renegotiation extension" \ |
| 3716 | -C "found renegotiation extension" \ |
| 3717 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3718 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3719 | -c "error" \ |
| 3720 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3721 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3722 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3723 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3724 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3725 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3726 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3727 | allow_legacy=0" \ |
| 3728 | 1 \ |
| 3729 | -c "client hello, adding renegotiation extension" \ |
| 3730 | -C "found renegotiation extension" \ |
| 3731 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3732 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3733 | -c "error" \ |
| 3734 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3735 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3736 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3737 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3738 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3739 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3740 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3741 | allow_legacy=1" \ |
| 3742 | 0 \ |
| 3743 | -c "client hello, adding renegotiation extension" \ |
| 3744 | -C "found renegotiation extension" \ |
| 3745 | -c "=> renegotiate" \ |
| 3746 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3747 | -C "error" \ |
| 3748 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3749 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3750 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3751 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3752 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3753 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3754 | 0 \ |
| 3755 | -c "client hello, adding renegotiation extension" \ |
| 3756 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3757 | -s "found renegotiation extension" \ |
| 3758 | -s "server hello, secure renegotiation extension" \ |
| 3759 | -c "found renegotiation extension" \ |
| 3760 | -c "=> renegotiate" \ |
| 3761 | -s "=> renegotiate" \ |
| 3762 | -S "write hello request" |
| 3763 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3764 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3765 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3766 | "$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] | 3767 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3768 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3769 | 0 \ |
| 3770 | -c "client hello, adding renegotiation extension" \ |
| 3771 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3772 | -s "found renegotiation extension" \ |
| 3773 | -s "server hello, secure renegotiation extension" \ |
| 3774 | -c "found renegotiation extension" \ |
| 3775 | -c "=> renegotiate" \ |
| 3776 | -s "=> renegotiate" \ |
| 3777 | -s "write hello request" |
| 3778 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3779 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3780 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3781 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3782 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3783 | 0 \ |
| 3784 | -c "client hello, adding renegotiation extension" \ |
| 3785 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3786 | -s "found renegotiation extension" \ |
| 3787 | -s "server hello, secure renegotiation extension" \ |
| 3788 | -s "record counter limit reached: renegotiate" \ |
| 3789 | -c "=> renegotiate" \ |
| 3790 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3791 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3792 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3793 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3794 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3795 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3796 | "$G_SRV -u --mtu 4096" \ |
| 3797 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3798 | 0 \ |
| 3799 | -c "client hello, adding renegotiation extension" \ |
| 3800 | -c "found renegotiation extension" \ |
| 3801 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3802 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3803 | -C "error" \ |
| 3804 | -s "Extra-header:" |
| 3805 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3806 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3807 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3808 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3809 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3810 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3811 | "$P_CLI debug_level=3" \ |
| 3812 | 0 \ |
| 3813 | -c "found renegotiation extension" \ |
| 3814 | -C "error" \ |
| 3815 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3816 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3817 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3818 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3819 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3820 | "$P_CLI debug_level=3" \ |
| 3821 | 0 \ |
| 3822 | -C "found renegotiation extension" \ |
| 3823 | -C "error" \ |
| 3824 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3825 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3826 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3827 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3828 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3829 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3830 | 1 \ |
| 3831 | -C "found renegotiation extension" \ |
| 3832 | -c "error" \ |
| 3833 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3834 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3835 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3836 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3837 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3838 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3839 | 0 \ |
| 3840 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3841 | -s "server hello, secure renegotiation extension" |
| 3842 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3843 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3844 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3845 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3846 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3847 | 0 \ |
| 3848 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3849 | -S "server hello, secure renegotiation extension" |
| 3850 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3851 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3852 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3853 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3854 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3855 | 1 \ |
| 3856 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3857 | -S "server hello, secure renegotiation extension" |
| 3858 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3859 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3860 | |
| 3861 | requires_gnutls |
| 3862 | run_test "DER format: no trailing bytes" \ |
| 3863 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3864 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3865 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3866 | 0 \ |
| 3867 | -c "Handshake was completed" \ |
| 3868 | |
| 3869 | requires_gnutls |
| 3870 | run_test "DER format: with a trailing zero byte" \ |
| 3871 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3872 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3873 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3874 | 0 \ |
| 3875 | -c "Handshake was completed" \ |
| 3876 | |
| 3877 | requires_gnutls |
| 3878 | run_test "DER format: with a trailing random byte" \ |
| 3879 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3880 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3881 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3882 | 0 \ |
| 3883 | -c "Handshake was completed" \ |
| 3884 | |
| 3885 | requires_gnutls |
| 3886 | run_test "DER format: with 2 trailing random bytes" \ |
| 3887 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3888 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3889 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3890 | 0 \ |
| 3891 | -c "Handshake was completed" \ |
| 3892 | |
| 3893 | requires_gnutls |
| 3894 | run_test "DER format: with 4 trailing random bytes" \ |
| 3895 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3896 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3897 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3898 | 0 \ |
| 3899 | -c "Handshake was completed" \ |
| 3900 | |
| 3901 | requires_gnutls |
| 3902 | run_test "DER format: with 8 trailing random bytes" \ |
| 3903 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3904 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3905 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3906 | 0 \ |
| 3907 | -c "Handshake was completed" \ |
| 3908 | |
| 3909 | requires_gnutls |
| 3910 | run_test "DER format: with 9 trailing random bytes" \ |
| 3911 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3912 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3913 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3914 | 0 \ |
| 3915 | -c "Handshake was completed" \ |
| 3916 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3917 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3918 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3919 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3920 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3921 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3922 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3923 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3924 | 1 \ |
| 3925 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3926 | -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] | 3927 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3928 | -c "X509 - Certificate verification failed" |
| 3929 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3930 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3931 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3932 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3933 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3934 | 0 \ |
| 3935 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3936 | -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] | 3937 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3938 | -C "X509 - Certificate verification failed" |
| 3939 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3940 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3941 | "$P_SRV" \ |
| 3942 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3943 | 0 \ |
| 3944 | -c "x509_verify_cert() returned" \ |
| 3945 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3946 | -c "! Certificate verification flags"\ |
| 3947 | -C "! mbedtls_ssl_handshake returned" \ |
| 3948 | -C "X509 - Certificate verification failed" \ |
| 3949 | -C "SSL - No CA Chain is set, but required to operate" |
| 3950 | |
| 3951 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3952 | "$P_SRV" \ |
| 3953 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3954 | 1 \ |
| 3955 | -c "x509_verify_cert() returned" \ |
| 3956 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3957 | -c "! Certificate verification flags"\ |
| 3958 | -c "! mbedtls_ssl_handshake returned" \ |
| 3959 | -c "SSL - No CA Chain is set, but required to operate" |
| 3960 | |
| 3961 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3962 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3963 | # the client informs the server about the supported curves - it does, though, in the |
| 3964 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3965 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3966 | # different means to have the server ignoring the client's supported curve list. |
| 3967 | |
| 3968 | requires_config_enabled MBEDTLS_ECP_C |
| 3969 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3970 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3971 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3972 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3973 | 1 \ |
| 3974 | -c "bad certificate (EC key curve)"\ |
| 3975 | -c "! Certificate verification flags"\ |
| 3976 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3977 | |
| 3978 | requires_config_enabled MBEDTLS_ECP_C |
| 3979 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3980 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3981 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3982 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3983 | 1 \ |
| 3984 | -c "bad certificate (EC key curve)"\ |
| 3985 | -c "! Certificate verification flags"\ |
| 3986 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3987 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3988 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3989 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3990 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3991 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3992 | 0 \ |
| 3993 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3994 | -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] | 3995 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3996 | -C "X509 - Certificate verification failed" |
| 3997 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3998 | run_test "Authentication: client SHA256, server required" \ |
| 3999 | "$P_SRV auth_mode=required" \ |
| 4000 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4001 | key_file=data_files/server6.key \ |
| 4002 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4003 | 0 \ |
| 4004 | -c "Supported Signature Algorithm found: 4," \ |
| 4005 | -c "Supported Signature Algorithm found: 5," |
| 4006 | |
| 4007 | run_test "Authentication: client SHA384, server required" \ |
| 4008 | "$P_SRV auth_mode=required" \ |
| 4009 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4010 | key_file=data_files/server6.key \ |
| 4011 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4012 | 0 \ |
| 4013 | -c "Supported Signature Algorithm found: 4," \ |
| 4014 | -c "Supported Signature Algorithm found: 5," |
| 4015 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4016 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4017 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4018 | "$P_CLI debug_level=3 crt_file=none \ |
| 4019 | key_file=data_files/server5.key" \ |
| 4020 | 1 \ |
| 4021 | -S "skip write certificate request" \ |
| 4022 | -C "skip parse certificate request" \ |
| 4023 | -c "got a certificate request" \ |
| 4024 | -c "= write certificate$" \ |
| 4025 | -C "skip write certificate$" \ |
| 4026 | -S "x509_verify_cert() returned" \ |
| 4027 | -s "client has no certificate" \ |
| 4028 | -s "! mbedtls_ssl_handshake returned" \ |
| 4029 | -c "! mbedtls_ssl_handshake returned" \ |
| 4030 | -s "No client certification received from the client, but required by the authentication mode" |
| 4031 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4032 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4033 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4034 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4035 | key_file=data_files/server5.key" \ |
| 4036 | 1 \ |
| 4037 | -S "skip write certificate request" \ |
| 4038 | -C "skip parse certificate request" \ |
| 4039 | -c "got a certificate request" \ |
| 4040 | -C "skip write certificate" \ |
| 4041 | -C "skip write certificate verify" \ |
| 4042 | -S "skip parse certificate verify" \ |
| 4043 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4044 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4045 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4046 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4047 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4048 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4049 | # We don't check that the client receives the alert because it might |
| 4050 | # detect that its write end of the connection is closed and abort |
| 4051 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4052 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4053 | run_test "Authentication: client cert not trusted, server required" \ |
| 4054 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4055 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4056 | key_file=data_files/server5.key" \ |
| 4057 | 1 \ |
| 4058 | -S "skip write certificate request" \ |
| 4059 | -C "skip parse certificate request" \ |
| 4060 | -c "got a certificate request" \ |
| 4061 | -C "skip write certificate" \ |
| 4062 | -C "skip write certificate verify" \ |
| 4063 | -S "skip parse certificate verify" \ |
| 4064 | -s "x509_verify_cert() returned" \ |
| 4065 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4066 | -s "! mbedtls_ssl_handshake returned" \ |
| 4067 | -c "! mbedtls_ssl_handshake returned" \ |
| 4068 | -s "X509 - Certificate verification failed" |
| 4069 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4070 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4071 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4072 | "$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] | 4073 | key_file=data_files/server5.key" \ |
| 4074 | 0 \ |
| 4075 | -S "skip write certificate request" \ |
| 4076 | -C "skip parse certificate request" \ |
| 4077 | -c "got a certificate request" \ |
| 4078 | -C "skip write certificate" \ |
| 4079 | -C "skip write certificate verify" \ |
| 4080 | -S "skip parse certificate verify" \ |
| 4081 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4082 | -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] | 4083 | -S "! mbedtls_ssl_handshake returned" \ |
| 4084 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4085 | -S "X509 - Certificate verification failed" |
| 4086 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4087 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4088 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4089 | "$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] | 4090 | key_file=data_files/server5.key" \ |
| 4091 | 0 \ |
| 4092 | -s "skip write certificate request" \ |
| 4093 | -C "skip parse certificate request" \ |
| 4094 | -c "got no certificate request" \ |
| 4095 | -c "skip write certificate" \ |
| 4096 | -c "skip write certificate verify" \ |
| 4097 | -s "skip parse certificate verify" \ |
| 4098 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4099 | -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] | 4100 | -S "! mbedtls_ssl_handshake returned" \ |
| 4101 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4102 | -S "X509 - Certificate verification failed" |
| 4103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4104 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4105 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4106 | "$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] | 4107 | 0 \ |
| 4108 | -S "skip write certificate request" \ |
| 4109 | -C "skip parse certificate request" \ |
| 4110 | -c "got a certificate request" \ |
| 4111 | -C "skip write certificate$" \ |
| 4112 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4113 | -c "skip write certificate verify" \ |
| 4114 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4115 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4116 | -S "! mbedtls_ssl_handshake returned" \ |
| 4117 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4118 | -S "X509 - Certificate verification failed" |
| 4119 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4120 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4121 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4122 | "$O_CLI" \ |
| 4123 | 0 \ |
| 4124 | -S "skip write certificate request" \ |
| 4125 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4126 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4127 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4128 | -S "X509 - Certificate verification failed" |
| 4129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4130 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4131 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4132 | "$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] | 4133 | 0 \ |
| 4134 | -C "skip parse certificate request" \ |
| 4135 | -c "got a certificate request" \ |
| 4136 | -C "skip write certificate$" \ |
| 4137 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4138 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4139 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4140 | run_test "Authentication: client no cert, openssl server required" \ |
| 4141 | "$O_SRV -Verify 10" \ |
| 4142 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4143 | 1 \ |
| 4144 | -C "skip parse certificate request" \ |
| 4145 | -c "got a certificate request" \ |
| 4146 | -C "skip write certificate$" \ |
| 4147 | -c "skip write certificate verify" \ |
| 4148 | -c "! mbedtls_ssl_handshake returned" |
| 4149 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 4150 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 4151 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4152 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4153 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 4154 | 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] | 4155 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4156 | if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 4157 | cat <<EOF |
| 4158 | ${CONFIG_H} contains a value for the configuration of |
| 4159 | MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script's |
| 4160 | test value of ${MAX_IM_CA}. |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4161 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 4162 | The tests assume this value and if it changes, the tests in this |
| 4163 | script should also be adjusted. |
| 4164 | EOF |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4165 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4166 | fi |
| 4167 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4168 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4169 | run_test "Authentication: server max_int chain, client default" \ |
| 4170 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4171 | key_file=data_files/dir-maxpath/09.key" \ |
| 4172 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4173 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4174 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4175 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4176 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4177 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4178 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4179 | key_file=data_files/dir-maxpath/10.key" \ |
| 4180 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4181 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4182 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4183 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4184 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4185 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4186 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4187 | key_file=data_files/dir-maxpath/10.key" \ |
| 4188 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4189 | auth_mode=optional" \ |
| 4190 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4191 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4192 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4193 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4194 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4195 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4196 | key_file=data_files/dir-maxpath/10.key" \ |
| 4197 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4198 | auth_mode=none" \ |
| 4199 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4200 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4201 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4202 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4203 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4204 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4205 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4206 | key_file=data_files/dir-maxpath/10.key" \ |
| 4207 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4208 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4209 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4210 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4211 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4212 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4213 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4214 | key_file=data_files/dir-maxpath/10.key" \ |
| 4215 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4216 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4217 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4218 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4219 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4220 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4221 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4222 | key_file=data_files/dir-maxpath/10.key" \ |
| 4223 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4224 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4225 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4226 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4227 | run_test "Authentication: client max_int chain, server required" \ |
| 4228 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4229 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4230 | key_file=data_files/dir-maxpath/09.key" \ |
| 4231 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4232 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4233 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4234 | # Tests for CA list in CertificateRequest messages |
| 4235 | |
| 4236 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4237 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4238 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4239 | key_file=data_files/server6.key" \ |
| 4240 | 0 \ |
| 4241 | -s "requested DN" |
| 4242 | |
| 4243 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4244 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4245 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4246 | key_file=data_files/server6.key" \ |
| 4247 | 0 \ |
| 4248 | -S "requested DN" |
| 4249 | |
| 4250 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4251 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4252 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4253 | key_file=data_files/server5.key" \ |
| 4254 | 1 \ |
| 4255 | -S "requested DN" \ |
| 4256 | -s "x509_verify_cert() returned" \ |
| 4257 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4258 | -s "! mbedtls_ssl_handshake returned" \ |
| 4259 | -c "! mbedtls_ssl_handshake returned" \ |
| 4260 | -s "X509 - Certificate verification failed" |
| 4261 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4262 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4263 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4264 | |
| 4265 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4266 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4267 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4268 | key_file=data_files/server5.key" \ |
| 4269 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4270 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4271 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4272 | -c "x509_verify_cert() returned" \ |
| 4273 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4274 | -c "! mbedtls_ssl_handshake returned" \ |
| 4275 | -c "X509 - Certificate verification failed" |
| 4276 | |
| 4277 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4278 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4279 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4280 | key_file=data_files/server5.key" \ |
| 4281 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4282 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4283 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4284 | -c "x509_verify_cert() returned" \ |
| 4285 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4286 | -C "! mbedtls_ssl_handshake returned" \ |
| 4287 | -C "X509 - Certificate verification failed" |
| 4288 | |
| 4289 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4290 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4291 | # the client informs the server about the supported curves - it does, though, in the |
| 4292 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4293 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4294 | # different means to have the server ignoring the client's supported curve list. |
| 4295 | |
| 4296 | requires_config_enabled MBEDTLS_ECP_C |
| 4297 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4298 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4299 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4300 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4301 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4302 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4303 | -c "use CA callback for X.509 CRT verification" \ |
| 4304 | -c "bad certificate (EC key curve)" \ |
| 4305 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4306 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4307 | |
| 4308 | requires_config_enabled MBEDTLS_ECP_C |
| 4309 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4310 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4311 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4312 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4313 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4314 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4315 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4316 | -c "bad certificate (EC key curve)"\ |
| 4317 | -c "! Certificate verification flags"\ |
| 4318 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4319 | |
| 4320 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4321 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4322 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4323 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4324 | key_file=data_files/server6.key \ |
| 4325 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4326 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4327 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4328 | -c "Supported Signature Algorithm found: 4," \ |
| 4329 | -c "Supported Signature Algorithm found: 5," |
| 4330 | |
| 4331 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4332 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4333 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4334 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4335 | key_file=data_files/server6.key \ |
| 4336 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4337 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4338 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4339 | -c "Supported Signature Algorithm found: 4," \ |
| 4340 | -c "Supported Signature Algorithm found: 5," |
| 4341 | |
| 4342 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4343 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4344 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4345 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4346 | key_file=data_files/server5.key" \ |
| 4347 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4348 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4349 | -S "skip write certificate request" \ |
| 4350 | -C "skip parse certificate request" \ |
| 4351 | -c "got a certificate request" \ |
| 4352 | -C "skip write certificate" \ |
| 4353 | -C "skip write certificate verify" \ |
| 4354 | -S "skip parse certificate verify" \ |
| 4355 | -s "x509_verify_cert() returned" \ |
| 4356 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4357 | -s "! mbedtls_ssl_handshake returned" \ |
| 4358 | -s "send alert level=2 message=48" \ |
| 4359 | -c "! mbedtls_ssl_handshake returned" \ |
| 4360 | -s "X509 - Certificate verification failed" |
| 4361 | # We don't check that the client receives the alert because it might |
| 4362 | # detect that its write end of the connection is closed and abort |
| 4363 | # before reading the alert message. |
| 4364 | |
| 4365 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4366 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4367 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4368 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4369 | key_file=data_files/server5.key" \ |
| 4370 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4371 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4372 | -S "skip write certificate request" \ |
| 4373 | -C "skip parse certificate request" \ |
| 4374 | -c "got a certificate request" \ |
| 4375 | -C "skip write certificate" \ |
| 4376 | -C "skip write certificate verify" \ |
| 4377 | -S "skip parse certificate verify" \ |
| 4378 | -s "x509_verify_cert() returned" \ |
| 4379 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4380 | -s "! mbedtls_ssl_handshake returned" \ |
| 4381 | -c "! mbedtls_ssl_handshake returned" \ |
| 4382 | -s "X509 - Certificate verification failed" |
| 4383 | |
| 4384 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4385 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4386 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4387 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4388 | key_file=data_files/server5.key" \ |
| 4389 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4390 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4391 | -S "skip write certificate request" \ |
| 4392 | -C "skip parse certificate request" \ |
| 4393 | -c "got a certificate request" \ |
| 4394 | -C "skip write certificate" \ |
| 4395 | -C "skip write certificate verify" \ |
| 4396 | -S "skip parse certificate verify" \ |
| 4397 | -s "x509_verify_cert() returned" \ |
| 4398 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4399 | -S "! mbedtls_ssl_handshake returned" \ |
| 4400 | -C "! mbedtls_ssl_handshake returned" \ |
| 4401 | -S "X509 - Certificate verification failed" |
| 4402 | |
| 4403 | requires_full_size_output_buffer |
| 4404 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4405 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4406 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4407 | key_file=data_files/dir-maxpath/09.key" \ |
| 4408 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4409 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4410 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4411 | -C "X509 - A fatal error occurred" |
| 4412 | |
| 4413 | requires_full_size_output_buffer |
| 4414 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4415 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4416 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4417 | key_file=data_files/dir-maxpath/10.key" \ |
| 4418 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4419 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4420 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4421 | -c "X509 - A fatal error occurred" |
| 4422 | |
| 4423 | requires_full_size_output_buffer |
| 4424 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4425 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4426 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4427 | key_file=data_files/dir-maxpath/10.key" \ |
| 4428 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4429 | debug_level=3 auth_mode=optional" \ |
| 4430 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4431 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4432 | -c "X509 - A fatal error occurred" |
| 4433 | |
| 4434 | requires_full_size_output_buffer |
| 4435 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4436 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4437 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4438 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4439 | key_file=data_files/dir-maxpath/10.key" \ |
| 4440 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4441 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4442 | -s "X509 - A fatal error occurred" |
| 4443 | |
| 4444 | requires_full_size_output_buffer |
| 4445 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4446 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4447 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4448 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4449 | key_file=data_files/dir-maxpath/10.key" \ |
| 4450 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4451 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4452 | -s "X509 - A fatal error occurred" |
| 4453 | |
| 4454 | requires_full_size_output_buffer |
| 4455 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4456 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4457 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4458 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4459 | key_file=data_files/dir-maxpath/09.key" \ |
| 4460 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4461 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4462 | -S "X509 - A fatal error occurred" |
| 4463 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4464 | # Tests for certificate selection based on SHA verson |
| 4465 | |
| 4466 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4467 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4468 | key_file=data_files/server5.key \ |
| 4469 | crt_file2=data_files/server5-sha1.crt \ |
| 4470 | key_file2=data_files/server5.key" \ |
| 4471 | "$P_CLI force_version=tls1_2" \ |
| 4472 | 0 \ |
| 4473 | -c "signed using.*ECDSA with SHA256" \ |
| 4474 | -C "signed using.*ECDSA with SHA1" |
| 4475 | |
| 4476 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4477 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4478 | key_file=data_files/server5.key \ |
| 4479 | crt_file2=data_files/server5-sha1.crt \ |
| 4480 | key_file2=data_files/server5.key" \ |
| 4481 | "$P_CLI force_version=tls1_1" \ |
| 4482 | 0 \ |
| 4483 | -C "signed using.*ECDSA with SHA256" \ |
| 4484 | -c "signed using.*ECDSA with SHA1" |
| 4485 | |
| 4486 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4487 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4488 | key_file=data_files/server5.key \ |
| 4489 | crt_file2=data_files/server5-sha1.crt \ |
| 4490 | key_file2=data_files/server5.key" \ |
| 4491 | "$P_CLI force_version=tls1" \ |
| 4492 | 0 \ |
| 4493 | -C "signed using.*ECDSA with SHA256" \ |
| 4494 | -c "signed using.*ECDSA with SHA1" |
| 4495 | |
| 4496 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4497 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4498 | key_file=data_files/server5.key \ |
| 4499 | crt_file2=data_files/server6.crt \ |
| 4500 | key_file2=data_files/server6.key" \ |
| 4501 | "$P_CLI force_version=tls1_1" \ |
| 4502 | 0 \ |
| 4503 | -c "serial number.*09" \ |
| 4504 | -c "signed using.*ECDSA with SHA256" \ |
| 4505 | -C "signed using.*ECDSA with SHA1" |
| 4506 | |
| 4507 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4508 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4509 | key_file=data_files/server6.key \ |
| 4510 | crt_file2=data_files/server5.crt \ |
| 4511 | key_file2=data_files/server5.key" \ |
| 4512 | "$P_CLI force_version=tls1_1" \ |
| 4513 | 0 \ |
| 4514 | -c "serial number.*0A" \ |
| 4515 | -c "signed using.*ECDSA with SHA256" \ |
| 4516 | -C "signed using.*ECDSA with SHA1" |
| 4517 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4518 | # tests for SNI |
| 4519 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4520 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4521 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4522 | 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] | 4523 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4524 | 0 \ |
| 4525 | -S "parse ServerName extension" \ |
| 4526 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4527 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4528 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4529 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4530 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4531 | 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] | 4532 | 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] | 4533 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4534 | 0 \ |
| 4535 | -s "parse ServerName extension" \ |
| 4536 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4537 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4538 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4539 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4540 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4541 | 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] | 4542 | 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] | 4543 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4544 | 0 \ |
| 4545 | -s "parse ServerName extension" \ |
| 4546 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4547 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4548 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4549 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4550 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4551 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 4552 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4553 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4554 | 1 \ |
| 4555 | -s "parse ServerName extension" \ |
| 4556 | -s "ssl_sni_wrapper() returned" \ |
| 4557 | -s "mbedtls_ssl_handshake returned" \ |
| 4558 | -c "mbedtls_ssl_handshake returned" \ |
| 4559 | -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] | 4560 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4561 | run_test "SNI: client auth no override: optional" \ |
| 4562 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4563 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4564 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4565 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4566 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4567 | -S "skip write certificate request" \ |
| 4568 | -C "skip parse certificate request" \ |
| 4569 | -c "got a certificate request" \ |
| 4570 | -C "skip write certificate" \ |
| 4571 | -C "skip write certificate verify" \ |
| 4572 | -S "skip parse certificate verify" |
| 4573 | |
| 4574 | run_test "SNI: client auth override: none -> optional" \ |
| 4575 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4576 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4577 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4578 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4579 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4580 | -S "skip write certificate request" \ |
| 4581 | -C "skip parse certificate request" \ |
| 4582 | -c "got a certificate request" \ |
| 4583 | -C "skip write certificate" \ |
| 4584 | -C "skip write certificate verify" \ |
| 4585 | -S "skip parse certificate verify" |
| 4586 | |
| 4587 | run_test "SNI: client auth override: optional -> none" \ |
| 4588 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4589 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4590 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4591 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4592 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4593 | -s "skip write certificate request" \ |
| 4594 | -C "skip parse certificate request" \ |
| 4595 | -c "got no certificate request" \ |
| 4596 | -c "skip write certificate" \ |
| 4597 | -c "skip write certificate verify" \ |
| 4598 | -s "skip parse certificate verify" |
| 4599 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4600 | run_test "SNI: CA no override" \ |
| 4601 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4602 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4603 | ca_file=data_files/test-ca.crt \ |
| 4604 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4605 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4606 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4607 | 1 \ |
| 4608 | -S "skip write certificate request" \ |
| 4609 | -C "skip parse certificate request" \ |
| 4610 | -c "got a certificate request" \ |
| 4611 | -C "skip write certificate" \ |
| 4612 | -C "skip write certificate verify" \ |
| 4613 | -S "skip parse certificate verify" \ |
| 4614 | -s "x509_verify_cert() returned" \ |
| 4615 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4616 | -S "The certificate has been revoked (is on a CRL)" |
| 4617 | |
| 4618 | run_test "SNI: CA override" \ |
| 4619 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4620 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4621 | ca_file=data_files/test-ca.crt \ |
| 4622 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4623 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4624 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4625 | 0 \ |
| 4626 | -S "skip write certificate request" \ |
| 4627 | -C "skip parse certificate request" \ |
| 4628 | -c "got a certificate request" \ |
| 4629 | -C "skip write certificate" \ |
| 4630 | -C "skip write certificate verify" \ |
| 4631 | -S "skip parse certificate verify" \ |
| 4632 | -S "x509_verify_cert() returned" \ |
| 4633 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4634 | -S "The certificate has been revoked (is on a CRL)" |
| 4635 | |
| 4636 | run_test "SNI: CA override with CRL" \ |
| 4637 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4638 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4639 | ca_file=data_files/test-ca.crt \ |
| 4640 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4641 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4642 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4643 | 1 \ |
| 4644 | -S "skip write certificate request" \ |
| 4645 | -C "skip parse certificate request" \ |
| 4646 | -c "got a certificate request" \ |
| 4647 | -C "skip write certificate" \ |
| 4648 | -C "skip write certificate verify" \ |
| 4649 | -S "skip parse certificate verify" \ |
| 4650 | -s "x509_verify_cert() returned" \ |
| 4651 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4652 | -s "The certificate has been revoked (is on a CRL)" |
| 4653 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4654 | # Tests for SNI and DTLS |
| 4655 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4656 | run_test "SNI: DTLS, no SNI callback" \ |
| 4657 | "$P_SRV debug_level=3 dtls=1 \ |
| 4658 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4659 | "$P_CLI server_name=localhost dtls=1" \ |
| 4660 | 0 \ |
| 4661 | -S "parse ServerName extension" \ |
| 4662 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4663 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4664 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4665 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4666 | "$P_SRV debug_level=3 dtls=1 \ |
| 4667 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4668 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4669 | "$P_CLI server_name=localhost dtls=1" \ |
| 4670 | 0 \ |
| 4671 | -s "parse ServerName extension" \ |
| 4672 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4673 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4674 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4675 | run_test "SNI: DTLS, matching cert 2" \ |
| 4676 | "$P_SRV debug_level=3 dtls=1 \ |
| 4677 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4678 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4679 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4680 | 0 \ |
| 4681 | -s "parse ServerName extension" \ |
| 4682 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4683 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4684 | |
| 4685 | run_test "SNI: DTLS, no matching cert" \ |
| 4686 | "$P_SRV debug_level=3 dtls=1 \ |
| 4687 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4688 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4689 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4690 | 1 \ |
| 4691 | -s "parse ServerName extension" \ |
| 4692 | -s "ssl_sni_wrapper() returned" \ |
| 4693 | -s "mbedtls_ssl_handshake returned" \ |
| 4694 | -c "mbedtls_ssl_handshake returned" \ |
| 4695 | -c "SSL - A fatal alert message was received from our peer" |
| 4696 | |
| 4697 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4698 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4699 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4700 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4701 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4702 | 0 \ |
| 4703 | -S "skip write certificate request" \ |
| 4704 | -C "skip parse certificate request" \ |
| 4705 | -c "got a certificate request" \ |
| 4706 | -C "skip write certificate" \ |
| 4707 | -C "skip write certificate verify" \ |
| 4708 | -S "skip parse certificate verify" |
| 4709 | |
| 4710 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4711 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4712 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4713 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4714 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4715 | 0 \ |
| 4716 | -S "skip write certificate request" \ |
| 4717 | -C "skip parse certificate request" \ |
| 4718 | -c "got a certificate request" \ |
| 4719 | -C "skip write certificate" \ |
| 4720 | -C "skip write certificate verify" \ |
| 4721 | -S "skip parse certificate verify" |
| 4722 | |
| 4723 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4724 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4725 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4726 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4727 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4728 | 0 \ |
| 4729 | -s "skip write certificate request" \ |
| 4730 | -C "skip parse certificate request" \ |
| 4731 | -c "got no certificate request" \ |
| 4732 | -c "skip write certificate" \ |
| 4733 | -c "skip write certificate verify" \ |
| 4734 | -s "skip parse certificate verify" |
| 4735 | |
| 4736 | run_test "SNI: DTLS, CA no override" \ |
| 4737 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4738 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4739 | ca_file=data_files/test-ca.crt \ |
| 4740 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4741 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4742 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4743 | 1 \ |
| 4744 | -S "skip write certificate request" \ |
| 4745 | -C "skip parse certificate request" \ |
| 4746 | -c "got a certificate request" \ |
| 4747 | -C "skip write certificate" \ |
| 4748 | -C "skip write certificate verify" \ |
| 4749 | -S "skip parse certificate verify" \ |
| 4750 | -s "x509_verify_cert() returned" \ |
| 4751 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4752 | -S "The certificate has been revoked (is on a CRL)" |
| 4753 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4754 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4755 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4756 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4757 | ca_file=data_files/test-ca.crt \ |
| 4758 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4759 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4760 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4761 | 0 \ |
| 4762 | -S "skip write certificate request" \ |
| 4763 | -C "skip parse certificate request" \ |
| 4764 | -c "got a certificate request" \ |
| 4765 | -C "skip write certificate" \ |
| 4766 | -C "skip write certificate verify" \ |
| 4767 | -S "skip parse certificate verify" \ |
| 4768 | -S "x509_verify_cert() returned" \ |
| 4769 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4770 | -S "The certificate has been revoked (is on a CRL)" |
| 4771 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4772 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4773 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4774 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4775 | ca_file=data_files/test-ca.crt \ |
| 4776 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4777 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4778 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4779 | 1 \ |
| 4780 | -S "skip write certificate request" \ |
| 4781 | -C "skip parse certificate request" \ |
| 4782 | -c "got a certificate request" \ |
| 4783 | -C "skip write certificate" \ |
| 4784 | -C "skip write certificate verify" \ |
| 4785 | -S "skip parse certificate verify" \ |
| 4786 | -s "x509_verify_cert() returned" \ |
| 4787 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4788 | -s "The certificate has been revoked (is on a CRL)" |
| 4789 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4790 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4791 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4792 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4793 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4794 | "$P_CLI nbio=2 tickets=0" \ |
| 4795 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4796 | -S "mbedtls_ssl_handshake returned" \ |
| 4797 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4798 | -c "Read from server: .* bytes read" |
| 4799 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4800 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4801 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4802 | "$P_CLI nbio=2 tickets=0" \ |
| 4803 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4804 | -S "mbedtls_ssl_handshake returned" \ |
| 4805 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4806 | -c "Read from server: .* bytes read" |
| 4807 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4808 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4809 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4810 | "$P_CLI nbio=2 tickets=1" \ |
| 4811 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4812 | -S "mbedtls_ssl_handshake returned" \ |
| 4813 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4814 | -c "Read from server: .* bytes read" |
| 4815 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4816 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4817 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4818 | "$P_CLI nbio=2 tickets=1" \ |
| 4819 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4820 | -S "mbedtls_ssl_handshake returned" \ |
| 4821 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4822 | -c "Read from server: .* bytes read" |
| 4823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4824 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4825 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4826 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4827 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4828 | -S "mbedtls_ssl_handshake returned" \ |
| 4829 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4830 | -c "Read from server: .* bytes read" |
| 4831 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4832 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4833 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4834 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4835 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4836 | -S "mbedtls_ssl_handshake returned" \ |
| 4837 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4838 | -c "Read from server: .* bytes read" |
| 4839 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4840 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4841 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4842 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4843 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4844 | -S "mbedtls_ssl_handshake returned" \ |
| 4845 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4846 | -c "Read from server: .* bytes read" |
| 4847 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4848 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4849 | |
| 4850 | run_test "Event-driven I/O: basic handshake" \ |
| 4851 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4852 | "$P_CLI event=1 tickets=0" \ |
| 4853 | 0 \ |
| 4854 | -S "mbedtls_ssl_handshake returned" \ |
| 4855 | -C "mbedtls_ssl_handshake returned" \ |
| 4856 | -c "Read from server: .* bytes read" |
| 4857 | |
| 4858 | run_test "Event-driven I/O: client auth" \ |
| 4859 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4860 | "$P_CLI event=1 tickets=0" \ |
| 4861 | 0 \ |
| 4862 | -S "mbedtls_ssl_handshake returned" \ |
| 4863 | -C "mbedtls_ssl_handshake returned" \ |
| 4864 | -c "Read from server: .* bytes read" |
| 4865 | |
| 4866 | run_test "Event-driven I/O: ticket" \ |
| 4867 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4868 | "$P_CLI event=1 tickets=1" \ |
| 4869 | 0 \ |
| 4870 | -S "mbedtls_ssl_handshake returned" \ |
| 4871 | -C "mbedtls_ssl_handshake returned" \ |
| 4872 | -c "Read from server: .* bytes read" |
| 4873 | |
| 4874 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4875 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4876 | "$P_CLI event=1 tickets=1" \ |
| 4877 | 0 \ |
| 4878 | -S "mbedtls_ssl_handshake returned" \ |
| 4879 | -C "mbedtls_ssl_handshake returned" \ |
| 4880 | -c "Read from server: .* bytes read" |
| 4881 | |
| 4882 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4883 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4884 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4885 | 0 \ |
| 4886 | -S "mbedtls_ssl_handshake returned" \ |
| 4887 | -C "mbedtls_ssl_handshake returned" \ |
| 4888 | -c "Read from server: .* bytes read" |
| 4889 | |
| 4890 | run_test "Event-driven I/O: ticket + resume" \ |
| 4891 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4892 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4893 | 0 \ |
| 4894 | -S "mbedtls_ssl_handshake returned" \ |
| 4895 | -C "mbedtls_ssl_handshake returned" \ |
| 4896 | -c "Read from server: .* bytes read" |
| 4897 | |
| 4898 | run_test "Event-driven I/O: session-id resume" \ |
| 4899 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4900 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4901 | 0 \ |
| 4902 | -S "mbedtls_ssl_handshake returned" \ |
| 4903 | -C "mbedtls_ssl_handshake returned" \ |
| 4904 | -c "Read from server: .* bytes read" |
| 4905 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4906 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4907 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4908 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4909 | 0 \ |
| 4910 | -c "Read from server: .* bytes read" |
| 4911 | |
| 4912 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4913 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4914 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4915 | 0 \ |
| 4916 | -c "Read from server: .* bytes read" |
| 4917 | |
| 4918 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4919 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4920 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4921 | 0 \ |
| 4922 | -c "Read from server: .* bytes read" |
| 4923 | |
| 4924 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4925 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4926 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4927 | 0 \ |
| 4928 | -c "Read from server: .* bytes read" |
| 4929 | |
| 4930 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4931 | "$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] | 4932 | "$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] | 4933 | 0 \ |
| 4934 | -c "Read from server: .* bytes read" |
| 4935 | |
| 4936 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4937 | "$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] | 4938 | "$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] | 4939 | 0 \ |
| 4940 | -c "Read from server: .* bytes read" |
| 4941 | |
| 4942 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4943 | "$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] | 4944 | "$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] | 4945 | 0 \ |
| 4946 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4947 | |
| 4948 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4949 | # During session resumption, the client will send its ApplicationData record |
| 4950 | # within the same datagram as the Finished messages. In this situation, the |
| 4951 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4952 | # because the ApplicationData request has already been queued internally. |
| 4953 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4954 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4955 | "$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] | 4956 | "$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] | 4957 | 0 \ |
| 4958 | -c "Read from server: .* bytes read" |
| 4959 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4960 | # Tests for version negotiation |
| 4961 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4962 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4963 | "$P_SRV" \ |
| 4964 | "$P_CLI" \ |
| 4965 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4966 | -S "mbedtls_ssl_handshake returned" \ |
| 4967 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4968 | -s "Protocol is TLSv1.2" \ |
| 4969 | -c "Protocol is TLSv1.2" |
| 4970 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4971 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4972 | "$P_SRV" \ |
| 4973 | "$P_CLI max_version=tls1_1" \ |
| 4974 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4975 | -S "mbedtls_ssl_handshake returned" \ |
| 4976 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4977 | -s "Protocol is TLSv1.1" \ |
| 4978 | -c "Protocol is TLSv1.1" |
| 4979 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4980 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4981 | "$P_SRV max_version=tls1_1" \ |
| 4982 | "$P_CLI" \ |
| 4983 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4984 | -S "mbedtls_ssl_handshake returned" \ |
| 4985 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4986 | -s "Protocol is TLSv1.1" \ |
| 4987 | -c "Protocol is TLSv1.1" |
| 4988 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4989 | 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] | 4990 | "$P_SRV max_version=tls1_1" \ |
| 4991 | "$P_CLI max_version=tls1_1" \ |
| 4992 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4993 | -S "mbedtls_ssl_handshake returned" \ |
| 4994 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4995 | -s "Protocol is TLSv1.1" \ |
| 4996 | -c "Protocol is TLSv1.1" |
| 4997 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4998 | 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] | 4999 | "$P_SRV min_version=tls1_1" \ |
| 5000 | "$P_CLI max_version=tls1_1" \ |
| 5001 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5002 | -S "mbedtls_ssl_handshake returned" \ |
| 5003 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5004 | -s "Protocol is TLSv1.1" \ |
| 5005 | -c "Protocol is TLSv1.1" |
| 5006 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5007 | 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] | 5008 | "$P_SRV max_version=tls1_1" \ |
| 5009 | "$P_CLI min_version=tls1_1" \ |
| 5010 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5011 | -S "mbedtls_ssl_handshake returned" \ |
| 5012 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5013 | -s "Protocol is TLSv1.1" \ |
| 5014 | -c "Protocol is TLSv1.1" |
| 5015 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5016 | 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] | 5017 | "$P_SRV max_version=tls1_1" \ |
| 5018 | "$P_CLI min_version=tls1_2" \ |
| 5019 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5020 | -s "mbedtls_ssl_handshake returned" \ |
| 5021 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5022 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5023 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5024 | 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] | 5025 | "$P_SRV min_version=tls1_2" \ |
| 5026 | "$P_CLI max_version=tls1_1" \ |
| 5027 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5028 | -s "mbedtls_ssl_handshake returned" \ |
| 5029 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5030 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5031 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5032 | # Tests for ALPN extension |
| 5033 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5034 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5035 | "$P_SRV debug_level=3" \ |
| 5036 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5037 | 0 \ |
| 5038 | -C "client hello, adding alpn extension" \ |
| 5039 | -S "found alpn extension" \ |
| 5040 | -C "got an alert message, type: \\[2:120]" \ |
| 5041 | -S "server hello, adding alpn extension" \ |
| 5042 | -C "found alpn extension " \ |
| 5043 | -C "Application Layer Protocol is" \ |
| 5044 | -S "Application Layer Protocol is" |
| 5045 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5046 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5047 | "$P_SRV debug_level=3" \ |
| 5048 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5049 | 0 \ |
| 5050 | -c "client hello, adding alpn extension" \ |
| 5051 | -s "found alpn extension" \ |
| 5052 | -C "got an alert message, type: \\[2:120]" \ |
| 5053 | -S "server hello, adding alpn extension" \ |
| 5054 | -C "found alpn extension " \ |
| 5055 | -c "Application Layer Protocol is (none)" \ |
| 5056 | -S "Application Layer Protocol is" |
| 5057 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5058 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5059 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5060 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5061 | 0 \ |
| 5062 | -C "client hello, adding alpn extension" \ |
| 5063 | -S "found alpn extension" \ |
| 5064 | -C "got an alert message, type: \\[2:120]" \ |
| 5065 | -S "server hello, adding alpn extension" \ |
| 5066 | -C "found alpn extension " \ |
| 5067 | -C "Application Layer Protocol is" \ |
| 5068 | -s "Application Layer Protocol is (none)" |
| 5069 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5070 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5071 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5072 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5073 | 0 \ |
| 5074 | -c "client hello, adding alpn extension" \ |
| 5075 | -s "found alpn extension" \ |
| 5076 | -C "got an alert message, type: \\[2:120]" \ |
| 5077 | -s "server hello, adding alpn extension" \ |
| 5078 | -c "found alpn extension" \ |
| 5079 | -c "Application Layer Protocol is abc" \ |
| 5080 | -s "Application Layer Protocol is abc" |
| 5081 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5082 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5083 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5084 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5085 | 0 \ |
| 5086 | -c "client hello, adding alpn extension" \ |
| 5087 | -s "found alpn extension" \ |
| 5088 | -C "got an alert message, type: \\[2:120]" \ |
| 5089 | -s "server hello, adding alpn extension" \ |
| 5090 | -c "found alpn extension" \ |
| 5091 | -c "Application Layer Protocol is abc" \ |
| 5092 | -s "Application Layer Protocol is abc" |
| 5093 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5094 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5095 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5096 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5097 | 0 \ |
| 5098 | -c "client hello, adding alpn extension" \ |
| 5099 | -s "found alpn extension" \ |
| 5100 | -C "got an alert message, type: \\[2:120]" \ |
| 5101 | -s "server hello, adding alpn extension" \ |
| 5102 | -c "found alpn extension" \ |
| 5103 | -c "Application Layer Protocol is 1234" \ |
| 5104 | -s "Application Layer Protocol is 1234" |
| 5105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5106 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5107 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5108 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5109 | 1 \ |
| 5110 | -c "client hello, adding alpn extension" \ |
| 5111 | -s "found alpn extension" \ |
| 5112 | -c "got an alert message, type: \\[2:120]" \ |
| 5113 | -S "server hello, adding alpn extension" \ |
| 5114 | -C "found alpn extension" \ |
| 5115 | -C "Application Layer Protocol is 1234" \ |
| 5116 | -S "Application Layer Protocol is 1234" |
| 5117 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5118 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5119 | # Tests for keyUsage in leaf certificates, part 1: |
| 5120 | # server-side certificate/suite selection |
| 5121 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5122 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5123 | "$P_SRV key_file=data_files/server2.key \ |
| 5124 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5125 | "$P_CLI" \ |
| 5126 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5127 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5128 | |
| 5129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5130 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5131 | "$P_SRV key_file=data_files/server2.key \ |
| 5132 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5133 | "$P_CLI" \ |
| 5134 | 0 \ |
| 5135 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5136 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5137 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5138 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5139 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5140 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5141 | 1 \ |
| 5142 | -C "Ciphersuite is " |
| 5143 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5144 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5145 | "$P_SRV key_file=data_files/server5.key \ |
| 5146 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5147 | "$P_CLI" \ |
| 5148 | 0 \ |
| 5149 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5150 | |
| 5151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5152 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5153 | "$P_SRV key_file=data_files/server5.key \ |
| 5154 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5155 | "$P_CLI" \ |
| 5156 | 0 \ |
| 5157 | -c "Ciphersuite is TLS-ECDH-" |
| 5158 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5159 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5160 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5161 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5162 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5163 | 1 \ |
| 5164 | -C "Ciphersuite is " |
| 5165 | |
| 5166 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5167 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5169 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5170 | "$O_SRV -key data_files/server2.key \ |
| 5171 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5172 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5173 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5174 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5175 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5176 | -C "Processing of the Certificate handshake message failed" \ |
| 5177 | -c "Ciphersuite is TLS-" |
| 5178 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5179 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5180 | "$O_SRV -key data_files/server2.key \ |
| 5181 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5182 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5183 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5184 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5185 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5186 | -C "Processing of the Certificate handshake message failed" \ |
| 5187 | -c "Ciphersuite is TLS-" |
| 5188 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5189 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5190 | "$O_SRV -key data_files/server2.key \ |
| 5191 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5192 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5193 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5194 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5195 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5196 | -C "Processing of the Certificate handshake message failed" \ |
| 5197 | -c "Ciphersuite is TLS-" |
| 5198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5199 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5200 | "$O_SRV -key data_files/server2.key \ |
| 5201 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5202 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5203 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5204 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5205 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5206 | -c "Processing of the Certificate handshake message failed" \ |
| 5207 | -C "Ciphersuite is TLS-" |
| 5208 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5209 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5210 | "$O_SRV -key data_files/server2.key \ |
| 5211 | -cert data_files/server2.ku-ke.crt" \ |
| 5212 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5213 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5214 | 0 \ |
| 5215 | -c "bad certificate (usage extensions)" \ |
| 5216 | -C "Processing of the Certificate handshake message failed" \ |
| 5217 | -c "Ciphersuite is TLS-" \ |
| 5218 | -c "! Usage does not match the keyUsage extension" |
| 5219 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5220 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5221 | "$O_SRV -key data_files/server2.key \ |
| 5222 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5223 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5224 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5225 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5226 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5227 | -C "Processing of the Certificate handshake message failed" \ |
| 5228 | -c "Ciphersuite is TLS-" |
| 5229 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5230 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5231 | "$O_SRV -key data_files/server2.key \ |
| 5232 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5233 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5234 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5235 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5236 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5237 | -c "Processing of the Certificate handshake message failed" \ |
| 5238 | -C "Ciphersuite is TLS-" |
| 5239 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5240 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5241 | "$O_SRV -key data_files/server2.key \ |
| 5242 | -cert data_files/server2.ku-ds.crt" \ |
| 5243 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5244 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5245 | 0 \ |
| 5246 | -c "bad certificate (usage extensions)" \ |
| 5247 | -C "Processing of the Certificate handshake message failed" \ |
| 5248 | -c "Ciphersuite is TLS-" \ |
| 5249 | -c "! Usage does not match the keyUsage extension" |
| 5250 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5251 | # Tests for keyUsage in leaf certificates, part 3: |
| 5252 | # server-side checking of client cert |
| 5253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5254 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5255 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5256 | "$O_CLI -key data_files/server2.key \ |
| 5257 | -cert data_files/server2.ku-ds.crt" \ |
| 5258 | 0 \ |
| 5259 | -S "bad certificate (usage extensions)" \ |
| 5260 | -S "Processing of the Certificate handshake message failed" |
| 5261 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5262 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5263 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5264 | "$O_CLI -key data_files/server2.key \ |
| 5265 | -cert data_files/server2.ku-ke.crt" \ |
| 5266 | 0 \ |
| 5267 | -s "bad certificate (usage extensions)" \ |
| 5268 | -S "Processing of the Certificate handshake message failed" |
| 5269 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5270 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5271 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5272 | "$O_CLI -key data_files/server2.key \ |
| 5273 | -cert data_files/server2.ku-ke.crt" \ |
| 5274 | 1 \ |
| 5275 | -s "bad certificate (usage extensions)" \ |
| 5276 | -s "Processing of the Certificate handshake message failed" |
| 5277 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5278 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5279 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5280 | "$O_CLI -key data_files/server5.key \ |
| 5281 | -cert data_files/server5.ku-ds.crt" \ |
| 5282 | 0 \ |
| 5283 | -S "bad certificate (usage extensions)" \ |
| 5284 | -S "Processing of the Certificate handshake message failed" |
| 5285 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5286 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5287 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5288 | "$O_CLI -key data_files/server5.key \ |
| 5289 | -cert data_files/server5.ku-ka.crt" \ |
| 5290 | 0 \ |
| 5291 | -s "bad certificate (usage extensions)" \ |
| 5292 | -S "Processing of the Certificate handshake message failed" |
| 5293 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5294 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5295 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5296 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5297 | "$P_SRV key_file=data_files/server5.key \ |
| 5298 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5299 | "$P_CLI" \ |
| 5300 | 0 |
| 5301 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5302 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5303 | "$P_SRV key_file=data_files/server5.key \ |
| 5304 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5305 | "$P_CLI" \ |
| 5306 | 0 |
| 5307 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5308 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5309 | "$P_SRV key_file=data_files/server5.key \ |
| 5310 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5311 | "$P_CLI" \ |
| 5312 | 0 |
| 5313 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5314 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5315 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5316 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5317 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5318 | 1 |
| 5319 | |
| 5320 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5321 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5322 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5323 | "$O_SRV -key data_files/server5.key \ |
| 5324 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5325 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5326 | 0 \ |
| 5327 | -C "bad certificate (usage extensions)" \ |
| 5328 | -C "Processing of the Certificate handshake message failed" \ |
| 5329 | -c "Ciphersuite is TLS-" |
| 5330 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5331 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5332 | "$O_SRV -key data_files/server5.key \ |
| 5333 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5334 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5335 | 0 \ |
| 5336 | -C "bad certificate (usage extensions)" \ |
| 5337 | -C "Processing of the Certificate handshake message failed" \ |
| 5338 | -c "Ciphersuite is TLS-" |
| 5339 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5340 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5341 | "$O_SRV -key data_files/server5.key \ |
| 5342 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5343 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5344 | 0 \ |
| 5345 | -C "bad certificate (usage extensions)" \ |
| 5346 | -C "Processing of the Certificate handshake message failed" \ |
| 5347 | -c "Ciphersuite is TLS-" |
| 5348 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5349 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5350 | "$O_SRV -key data_files/server5.key \ |
| 5351 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5352 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5353 | 1 \ |
| 5354 | -c "bad certificate (usage extensions)" \ |
| 5355 | -c "Processing of the Certificate handshake message failed" \ |
| 5356 | -C "Ciphersuite is TLS-" |
| 5357 | |
| 5358 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5359 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5360 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5361 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5362 | "$O_CLI -key data_files/server5.key \ |
| 5363 | -cert data_files/server5.eku-cli.crt" \ |
| 5364 | 0 \ |
| 5365 | -S "bad certificate (usage extensions)" \ |
| 5366 | -S "Processing of the Certificate handshake message failed" |
| 5367 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5368 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5369 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5370 | "$O_CLI -key data_files/server5.key \ |
| 5371 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5372 | 0 \ |
| 5373 | -S "bad certificate (usage extensions)" \ |
| 5374 | -S "Processing of the Certificate handshake message failed" |
| 5375 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5376 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5377 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5378 | "$O_CLI -key data_files/server5.key \ |
| 5379 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5380 | 0 \ |
| 5381 | -S "bad certificate (usage extensions)" \ |
| 5382 | -S "Processing of the Certificate handshake message failed" |
| 5383 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5384 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5385 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5386 | "$O_CLI -key data_files/server5.key \ |
| 5387 | -cert data_files/server5.eku-cs.crt" \ |
| 5388 | 0 \ |
| 5389 | -s "bad certificate (usage extensions)" \ |
| 5390 | -S "Processing of the Certificate handshake message failed" |
| 5391 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5392 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5393 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5394 | "$O_CLI -key data_files/server5.key \ |
| 5395 | -cert data_files/server5.eku-cs.crt" \ |
| 5396 | 1 \ |
| 5397 | -s "bad certificate (usage extensions)" \ |
| 5398 | -s "Processing of the Certificate handshake message failed" |
| 5399 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5400 | # Tests for DHM parameters loading |
| 5401 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5402 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5403 | "$P_SRV" \ |
| 5404 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5405 | debug_level=3" \ |
| 5406 | 0 \ |
| 5407 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5408 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5409 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5410 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5411 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5412 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5413 | debug_level=3" \ |
| 5414 | 0 \ |
| 5415 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5416 | -c "value of 'DHM: G ' (2 bits)" |
| 5417 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5418 | # Tests for DHM client-side size checking |
| 5419 | |
| 5420 | run_test "DHM size: server default, client default, OK" \ |
| 5421 | "$P_SRV" \ |
| 5422 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5423 | debug_level=1" \ |
| 5424 | 0 \ |
| 5425 | -C "DHM prime too short:" |
| 5426 | |
| 5427 | run_test "DHM size: server default, client 2048, OK" \ |
| 5428 | "$P_SRV" \ |
| 5429 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5430 | debug_level=1 dhmlen=2048" \ |
| 5431 | 0 \ |
| 5432 | -C "DHM prime too short:" |
| 5433 | |
| 5434 | run_test "DHM size: server 1024, client default, OK" \ |
| 5435 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5436 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5437 | debug_level=1" \ |
| 5438 | 0 \ |
| 5439 | -C "DHM prime too short:" |
| 5440 | |
| 5441 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5442 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5443 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5444 | debug_level=1" \ |
| 5445 | 1 \ |
| 5446 | -c "DHM prime too short:" |
| 5447 | |
| 5448 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5449 | "$P_SRV" \ |
| 5450 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5451 | debug_level=1 dhmlen=2049" \ |
| 5452 | 1 \ |
| 5453 | -c "DHM prime too short:" |
| 5454 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5455 | # Tests for PSK callback |
| 5456 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5457 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5458 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5459 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5460 | psk_identity=foo psk=abc123" \ |
| 5461 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5462 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5463 | -S "SSL - Unknown identity received" \ |
| 5464 | -S "SSL - Verification of the message MAC failed" |
| 5465 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5466 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5467 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5468 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5469 | "$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] | 5470 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5471 | 0 \ |
| 5472 | -c "skip PMS generation for opaque PSK"\ |
| 5473 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5474 | -C "session hash for extended master secret"\ |
| 5475 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5476 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5477 | -S "SSL - Unknown identity received" \ |
| 5478 | -S "SSL - Verification of the message MAC failed" |
| 5479 | |
| 5480 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5481 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5482 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5483 | "$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] | 5484 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5485 | 0 \ |
| 5486 | -c "skip PMS generation for opaque PSK"\ |
| 5487 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5488 | -C "session hash for extended master secret"\ |
| 5489 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5490 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5491 | -S "SSL - Unknown identity received" \ |
| 5492 | -S "SSL - Verification of the message MAC failed" |
| 5493 | |
| 5494 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5495 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5496 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5497 | "$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] | 5498 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5499 | 0 \ |
| 5500 | -c "skip PMS generation for opaque PSK"\ |
| 5501 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5502 | -c "session hash for extended master secret"\ |
| 5503 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5504 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5505 | -S "SSL - Unknown identity received" \ |
| 5506 | -S "SSL - Verification of the message MAC failed" |
| 5507 | |
| 5508 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5509 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5510 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5511 | "$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] | 5512 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5513 | 0 \ |
| 5514 | -c "skip PMS generation for opaque PSK"\ |
| 5515 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5516 | -c "session hash for extended master secret"\ |
| 5517 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5518 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5519 | -S "SSL - Unknown identity received" \ |
| 5520 | -S "SSL - Verification of the message MAC failed" |
| 5521 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5522 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5523 | 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] | 5524 | "$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] | 5525 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5526 | psk_identity=foo psk=abc123" \ |
| 5527 | 0 \ |
| 5528 | -C "skip PMS generation for opaque PSK"\ |
| 5529 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5530 | -C "session hash for extended master secret"\ |
| 5531 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5532 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5533 | -S "SSL - Unknown identity received" \ |
| 5534 | -S "SSL - Verification of the message MAC failed" |
| 5535 | |
| 5536 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5537 | 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] | 5538 | "$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] | 5539 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5540 | psk_identity=foo psk=abc123" \ |
| 5541 | 0 \ |
| 5542 | -C "skip PMS generation for opaque PSK"\ |
| 5543 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5544 | -C "session hash for extended master secret"\ |
| 5545 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5546 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5547 | -S "SSL - Unknown identity received" \ |
| 5548 | -S "SSL - Verification of the message MAC failed" |
| 5549 | |
| 5550 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5551 | 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] | 5552 | "$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] | 5553 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5554 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5555 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5556 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5557 | -c "session hash for extended master secret"\ |
| 5558 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5559 | -C "skip PMS generation for opaque PSK"\ |
| 5560 | -s "skip PMS generation for opaque PSK"\ |
| 5561 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5562 | -S "SSL - Unknown identity received" \ |
| 5563 | -S "SSL - Verification of the message MAC failed" |
| 5564 | |
| 5565 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5566 | 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] | 5567 | "$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] | 5568 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5569 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5570 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5571 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5572 | -c "session hash for extended master secret"\ |
| 5573 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5574 | -C "skip PMS generation for opaque PSK"\ |
| 5575 | -s "skip PMS generation for opaque PSK"\ |
| 5576 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5577 | -S "SSL - Unknown identity received" \ |
| 5578 | -S "SSL - Verification of the message MAC failed" |
| 5579 | |
| 5580 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5581 | 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] | 5582 | "$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] | 5583 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5584 | psk_identity=def psk=beef" \ |
| 5585 | 0 \ |
| 5586 | -C "skip PMS generation for opaque PSK"\ |
| 5587 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5588 | -C "session hash for extended master secret"\ |
| 5589 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5590 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5591 | -S "SSL - Unknown identity received" \ |
| 5592 | -S "SSL - Verification of the message MAC failed" |
| 5593 | |
| 5594 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5595 | 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] | 5596 | "$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] | 5597 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5598 | psk_identity=def psk=beef" \ |
| 5599 | 0 \ |
| 5600 | -C "skip PMS generation for opaque PSK"\ |
| 5601 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5602 | -C "session hash for extended master secret"\ |
| 5603 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5604 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5605 | -S "SSL - Unknown identity received" \ |
| 5606 | -S "SSL - Verification of the message MAC failed" |
| 5607 | |
| 5608 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5609 | 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] | 5610 | "$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] | 5611 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5612 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5613 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5614 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5615 | -c "session hash for extended master secret"\ |
| 5616 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5617 | -C "skip PMS generation for opaque PSK"\ |
| 5618 | -s "skip PMS generation for opaque PSK"\ |
| 5619 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5620 | -S "SSL - Unknown identity received" \ |
| 5621 | -S "SSL - Verification of the message MAC failed" |
| 5622 | |
| 5623 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5624 | 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] | 5625 | "$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] | 5626 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5627 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5628 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5629 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5630 | -c "session hash for extended master secret"\ |
| 5631 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5632 | -C "skip PMS generation for opaque PSK"\ |
| 5633 | -s "skip PMS generation for opaque PSK"\ |
| 5634 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5635 | -S "SSL - Unknown identity received" \ |
| 5636 | -S "SSL - Verification of the message MAC failed" |
| 5637 | |
| 5638 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5639 | 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] | 5640 | "$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] | 5641 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5642 | psk_identity=def psk=beef" \ |
| 5643 | 0 \ |
| 5644 | -C "skip PMS generation for opaque PSK"\ |
| 5645 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5646 | -C "session hash for extended master secret"\ |
| 5647 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5648 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5649 | -S "SSL - Unknown identity received" \ |
| 5650 | -S "SSL - Verification of the message MAC failed" |
| 5651 | |
| 5652 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5653 | 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] | 5654 | "$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] | 5655 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5656 | psk_identity=def psk=beef" \ |
| 5657 | 0 \ |
| 5658 | -C "skip PMS generation for opaque PSK"\ |
| 5659 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5660 | -C "session hash for extended master secret"\ |
| 5661 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5662 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5663 | -S "SSL - Unknown identity received" \ |
| 5664 | -S "SSL - Verification of the message MAC failed" |
| 5665 | |
| 5666 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5667 | 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] | 5668 | "$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] | 5669 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5670 | psk_identity=def psk=beef" \ |
| 5671 | 0 \ |
| 5672 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5673 | -C "session hash for extended master secret"\ |
| 5674 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5675 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5676 | -S "SSL - Unknown identity received" \ |
| 5677 | -S "SSL - Verification of the message MAC failed" |
| 5678 | |
| 5679 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5680 | 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] | 5681 | "$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] | 5682 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5683 | psk_identity=def psk=beef" \ |
| 5684 | 0 \ |
| 5685 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5686 | -C "session hash for extended master secret"\ |
| 5687 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5688 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5689 | -S "SSL - Unknown identity received" \ |
| 5690 | -S "SSL - Verification of the message MAC failed" |
| 5691 | |
| 5692 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5693 | 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] | 5694 | "$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] | 5695 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5696 | psk_identity=def psk=beef" \ |
| 5697 | 1 \ |
| 5698 | -s "SSL - Verification of the message MAC failed" |
| 5699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5700 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5701 | "$P_SRV" \ |
| 5702 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5703 | psk_identity=foo psk=abc123" \ |
| 5704 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5705 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5706 | -S "SSL - Unknown identity received" \ |
| 5707 | -S "SSL - Verification of the message MAC failed" |
| 5708 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5709 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5710 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5711 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5712 | psk_identity=foo psk=abc123" \ |
| 5713 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5714 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5715 | -s "SSL - Unknown identity received" \ |
| 5716 | -S "SSL - Verification of the message MAC failed" |
| 5717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5718 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5719 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5720 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5721 | psk_identity=abc psk=dead" \ |
| 5722 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5723 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5724 | -S "SSL - Unknown identity received" \ |
| 5725 | -S "SSL - Verification of the message MAC failed" |
| 5726 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5727 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5728 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5729 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5730 | psk_identity=def psk=beef" \ |
| 5731 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5732 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5733 | -S "SSL - Unknown identity received" \ |
| 5734 | -S "SSL - Verification of the message MAC failed" |
| 5735 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5736 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5737 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5738 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5739 | psk_identity=ghi psk=beef" \ |
| 5740 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5741 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5742 | -s "SSL - Unknown identity received" \ |
| 5743 | -S "SSL - Verification of the message MAC failed" |
| 5744 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5745 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5746 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5747 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5748 | psk_identity=abc psk=beef" \ |
| 5749 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5750 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5751 | -S "SSL - Unknown identity received" \ |
| 5752 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5753 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5754 | # Tests for EC J-PAKE |
| 5755 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5756 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5757 | run_test "ECJPAKE: client not configured" \ |
| 5758 | "$P_SRV debug_level=3" \ |
| 5759 | "$P_CLI debug_level=3" \ |
| 5760 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5761 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5762 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5763 | -S "found ecjpake kkpp extension" \ |
| 5764 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5765 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5766 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5767 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5768 | -S "None of the common ciphersuites is usable" |
| 5769 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5770 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5771 | run_test "ECJPAKE: server not configured" \ |
| 5772 | "$P_SRV debug_level=3" \ |
| 5773 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5774 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5775 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5776 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5777 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5778 | -s "found ecjpake kkpp extension" \ |
| 5779 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5780 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5781 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5782 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5783 | -s "None of the common ciphersuites is usable" |
| 5784 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5785 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5786 | run_test "ECJPAKE: working, TLS" \ |
| 5787 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5788 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5789 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5790 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5791 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5792 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5793 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5794 | -s "found ecjpake kkpp extension" \ |
| 5795 | -S "skip ecjpake kkpp extension" \ |
| 5796 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5797 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5798 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5799 | -S "None of the common ciphersuites is usable" \ |
| 5800 | -S "SSL - Verification of the message MAC failed" |
| 5801 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5802 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5803 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5804 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5805 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5806 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5807 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5808 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5809 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5810 | -s "SSL - Verification of the message MAC failed" |
| 5811 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5812 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5813 | run_test "ECJPAKE: working, DTLS" \ |
| 5814 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5815 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5816 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5817 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5818 | -c "re-using cached ecjpake parameters" \ |
| 5819 | -S "SSL - Verification of the message MAC failed" |
| 5820 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5821 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5822 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5823 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5824 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5825 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5826 | 0 \ |
| 5827 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5828 | -S "SSL - Verification of the message MAC failed" |
| 5829 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5830 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5831 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5832 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5833 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5834 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5835 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5836 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5837 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5838 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5839 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5840 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5841 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5842 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5843 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5844 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5845 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5846 | 0 |
| 5847 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5848 | # Tests for ciphersuites per version |
| 5849 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5851 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5852 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5853 | run_test "Per-version suites: TLS 1.0" \ |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 5854 | "$P_SRV version_suites=TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Mateusz Starzyk | 5224e29 | 2021-02-22 14:36:29 +0100 | [diff] [blame] | 5855 | "$P_CLI force_version=tls1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5856 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5857 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5858 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5860 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5861 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5862 | run_test "Per-version suites: TLS 1.1" \ |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 5863 | "$P_SRV version_suites=TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5864 | "$P_CLI force_version=tls1_1" \ |
| 5865 | 0 \ |
| 5866 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5867 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5868 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5869 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5870 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5871 | run_test "Per-version suites: TLS 1.2" \ |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 5872 | "$P_SRV version_suites=TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5873 | "$P_CLI force_version=tls1_2" \ |
| 5874 | 0 \ |
| 5875 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5876 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5877 | # Test for ClientHello without extensions |
| 5878 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5879 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5880 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5881 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5882 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5883 | 0 \ |
| 5884 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5885 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5886 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5887 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5888 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5889 | "$P_SRV" \ |
| 5890 | "$P_CLI request_size=100" \ |
| 5891 | 0 \ |
| 5892 | -s "Read from client: 100 bytes read$" |
| 5893 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5894 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5895 | "$P_SRV" \ |
| 5896 | "$P_CLI request_size=500" \ |
| 5897 | 0 \ |
| 5898 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5899 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5900 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5901 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5902 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5903 | "$P_SRV" \ |
| 5904 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5905 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5906 | 0 \ |
| 5907 | -s "Read from client: 1 bytes read" |
| 5908 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5909 | 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] | 5910 | "$P_SRV" \ |
| 5911 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5912 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5913 | 0 \ |
| 5914 | -s "Read from client: 1 bytes read" |
| 5915 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5916 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5917 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5918 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5919 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5920 | 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] | 5921 | 0 \ |
| 5922 | -s "Read from client: 1 bytes read" |
| 5923 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5924 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5925 | 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] | 5926 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5927 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5928 | 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] | 5929 | 0 \ |
| 5930 | -s "Read from client: 1 bytes read" |
| 5931 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5932 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5933 | "$P_SRV" \ |
| 5934 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5935 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5936 | 0 \ |
| 5937 | -s "Read from client: 1 bytes read" |
| 5938 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5939 | 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] | 5940 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5941 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5942 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5943 | 0 \ |
| 5944 | -s "Read from client: 1 bytes read" |
| 5945 | |
| 5946 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5947 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5948 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5949 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5950 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5951 | 0 \ |
| 5952 | -s "Read from client: 1 bytes read" |
| 5953 | |
| 5954 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5955 | 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] | 5956 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5957 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5958 | 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] | 5959 | 0 \ |
| 5960 | -s "Read from client: 1 bytes read" |
| 5961 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5962 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5963 | "$P_SRV" \ |
| 5964 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5965 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5966 | 0 \ |
| 5967 | -s "Read from client: 1 bytes read" |
| 5968 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5969 | 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] | 5970 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5971 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5972 | 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] | 5973 | 0 \ |
| 5974 | -s "Read from client: 1 bytes read" |
| 5975 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5976 | 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] | 5977 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5978 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5979 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5980 | 0 \ |
| 5981 | -s "Read from client: 1 bytes read" |
| 5982 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5983 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5984 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5985 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5986 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5987 | 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] | 5988 | 0 \ |
| 5989 | -s "Read from client: 1 bytes read" |
| 5990 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5991 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5992 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5993 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5994 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5995 | 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] | 5996 | 0 \ |
| 5997 | -s "Read from client: 1 bytes read" |
| 5998 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5999 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6000 | "$P_SRV" \ |
| 6001 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6002 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6003 | 0 \ |
| 6004 | -s "Read from client: 1 bytes read" |
| 6005 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6006 | 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] | 6007 | "$P_SRV" \ |
| 6008 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6009 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6010 | 0 \ |
| 6011 | -s "Read from client: 1 bytes read" |
| 6012 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6013 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6014 | |
| 6015 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6016 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6017 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6018 | "$P_CLI dtls=1 request_size=1 \ |
| 6019 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6020 | 0 \ |
| 6021 | -s "Read from client: 1 bytes read" |
| 6022 | |
| 6023 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6024 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6025 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6026 | "$P_CLI dtls=1 request_size=1 \ |
| 6027 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6028 | 0 \ |
| 6029 | -s "Read from client: 1 bytes read" |
| 6030 | |
| 6031 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6032 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6033 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6034 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6035 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6036 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6037 | 0 \ |
| 6038 | -s "Read from client: 1 bytes read" |
| 6039 | |
| 6040 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6041 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6042 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6043 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6044 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6045 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6046 | 0 \ |
| 6047 | -s "Read from client: 1 bytes read" |
| 6048 | |
| 6049 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6050 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6051 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 6052 | "$P_CLI dtls=1 request_size=1 \ |
| 6053 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6054 | 0 \ |
| 6055 | -s "Read from client: 1 bytes read" |
| 6056 | |
| 6057 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6058 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6059 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6060 | "$P_CLI dtls=1 request_size=1 \ |
| 6061 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6062 | 0 \ |
| 6063 | -s "Read from client: 1 bytes read" |
| 6064 | |
| 6065 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6066 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6067 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6068 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6069 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6070 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6071 | 0 \ |
| 6072 | -s "Read from client: 1 bytes read" |
| 6073 | |
| 6074 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6075 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6076 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6077 | "$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] | 6078 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6079 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6080 | 0 \ |
| 6081 | -s "Read from client: 1 bytes read" |
| 6082 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6083 | # Tests for small server packets |
| 6084 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6085 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6086 | "$P_SRV response_size=1" \ |
| 6087 | "$P_CLI force_version=tls1 \ |
| 6088 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6089 | 0 \ |
| 6090 | -c "Read from server: 1 bytes read" |
| 6091 | |
| 6092 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6093 | "$P_SRV response_size=1" \ |
| 6094 | "$P_CLI force_version=tls1 etm=0 \ |
| 6095 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6096 | 0 \ |
| 6097 | -c "Read from server: 1 bytes read" |
| 6098 | |
| 6099 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6100 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6101 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6102 | "$P_CLI force_version=tls1 \ |
| 6103 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6104 | 0 \ |
| 6105 | -c "Read from server: 1 bytes read" |
| 6106 | |
| 6107 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6108 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6109 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6110 | "$P_CLI force_version=tls1 \ |
| 6111 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6112 | 0 \ |
| 6113 | -c "Read from server: 1 bytes read" |
| 6114 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6115 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6116 | "$P_SRV response_size=1" \ |
| 6117 | "$P_CLI force_version=tls1_1 \ |
| 6118 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6119 | 0 \ |
| 6120 | -c "Read from server: 1 bytes read" |
| 6121 | |
| 6122 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6123 | "$P_SRV response_size=1" \ |
| 6124 | "$P_CLI force_version=tls1_1 \ |
| 6125 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6126 | 0 \ |
| 6127 | -c "Read from server: 1 bytes read" |
| 6128 | |
| 6129 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6130 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6131 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6132 | "$P_CLI force_version=tls1_1 \ |
| 6133 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6134 | 0 \ |
| 6135 | -c "Read from server: 1 bytes read" |
| 6136 | |
| 6137 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6138 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6139 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6140 | "$P_CLI force_version=tls1_1 \ |
| 6141 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6142 | 0 \ |
| 6143 | -c "Read from server: 1 bytes read" |
| 6144 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6145 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6146 | "$P_SRV response_size=1" \ |
| 6147 | "$P_CLI force_version=tls1_2 \ |
| 6148 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6149 | 0 \ |
| 6150 | -c "Read from server: 1 bytes read" |
| 6151 | |
| 6152 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6153 | "$P_SRV response_size=1" \ |
| 6154 | "$P_CLI force_version=tls1_2 \ |
| 6155 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6156 | 0 \ |
| 6157 | -c "Read from server: 1 bytes read" |
| 6158 | |
| 6159 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6160 | "$P_SRV response_size=1" \ |
| 6161 | "$P_CLI force_version=tls1_2 \ |
| 6162 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6163 | 0 \ |
| 6164 | -c "Read from server: 1 bytes read" |
| 6165 | |
| 6166 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6167 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6168 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6169 | "$P_CLI force_version=tls1_2 \ |
| 6170 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6171 | 0 \ |
| 6172 | -c "Read from server: 1 bytes read" |
| 6173 | |
| 6174 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6175 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6176 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6177 | "$P_CLI force_version=tls1_2 \ |
| 6178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6179 | 0 \ |
| 6180 | -c "Read from server: 1 bytes read" |
| 6181 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6182 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6183 | "$P_SRV response_size=1" \ |
| 6184 | "$P_CLI force_version=tls1_2 \ |
| 6185 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6186 | 0 \ |
| 6187 | -c "Read from server: 1 bytes read" |
| 6188 | |
| 6189 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6190 | "$P_SRV response_size=1" \ |
| 6191 | "$P_CLI force_version=tls1_2 \ |
| 6192 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6193 | 0 \ |
| 6194 | -c "Read from server: 1 bytes read" |
| 6195 | |
| 6196 | # Tests for small server packets in DTLS |
| 6197 | |
| 6198 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6199 | run_test "Small server packet DTLS 1.0" \ |
| 6200 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6201 | "$P_CLI dtls=1 \ |
| 6202 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6203 | 0 \ |
| 6204 | -c "Read from server: 1 bytes read" |
| 6205 | |
| 6206 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6207 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6208 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6209 | "$P_CLI dtls=1 \ |
| 6210 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6211 | 0 \ |
| 6212 | -c "Read from server: 1 bytes read" |
| 6213 | |
| 6214 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6215 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6216 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6217 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6218 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6219 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6220 | 0 \ |
| 6221 | -c "Read from server: 1 bytes read" |
| 6222 | |
| 6223 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6224 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6225 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6226 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6227 | "$P_CLI dtls=1 \ |
| 6228 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6229 | 0 \ |
| 6230 | -c "Read from server: 1 bytes read" |
| 6231 | |
| 6232 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6233 | run_test "Small server packet DTLS 1.2" \ |
| 6234 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6235 | "$P_CLI dtls=1 \ |
| 6236 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6237 | 0 \ |
| 6238 | -c "Read from server: 1 bytes read" |
| 6239 | |
| 6240 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6241 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6242 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6243 | "$P_CLI dtls=1 \ |
| 6244 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6245 | 0 \ |
| 6246 | -c "Read from server: 1 bytes read" |
| 6247 | |
| 6248 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6249 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6250 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6251 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6252 | "$P_CLI dtls=1 \ |
| 6253 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6254 | 0 \ |
| 6255 | -c "Read from server: 1 bytes read" |
| 6256 | |
| 6257 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6258 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6259 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6260 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6261 | "$P_CLI dtls=1 \ |
| 6262 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6263 | 0 \ |
| 6264 | -c "Read from server: 1 bytes read" |
| 6265 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6266 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6267 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6268 | # How many fragments do we expect to write $1 bytes? |
| 6269 | fragments_for_write() { |
| 6270 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6271 | } |
| 6272 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6273 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6274 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6275 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6276 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6277 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6278 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6279 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6280 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6281 | 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] | 6282 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6283 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6284 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6285 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6286 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6287 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6288 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6289 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6290 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6291 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6292 | 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] | 6293 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6294 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6295 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6296 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6297 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6298 | 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] | 6299 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6300 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6301 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6302 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6303 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6304 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6305 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6306 | "$P_SRV" \ |
| 6307 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6308 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6309 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6310 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6311 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6312 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6313 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6314 | "$P_SRV" \ |
| 6315 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6316 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6317 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6318 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6319 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6320 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6321 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6322 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6323 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6324 | 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] | 6325 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6326 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6327 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6328 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6329 | 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] | 6330 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6331 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6332 | 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] | 6333 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6334 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6335 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6336 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6337 | "$P_SRV" \ |
| 6338 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6339 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6340 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6341 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6342 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6343 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6344 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6345 | "$P_SRV" \ |
| 6346 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6347 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6348 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6349 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6350 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6351 | 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] | 6352 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6353 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6354 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6355 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6356 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6357 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6358 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6359 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6360 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6361 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6362 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6363 | 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] | 6364 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6365 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6366 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6367 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6368 | 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] | 6369 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6370 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6371 | 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] | 6372 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6373 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6374 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6375 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6376 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6377 | "$P_SRV" \ |
| 6378 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6379 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6380 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6381 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6382 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6383 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6384 | 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] | 6385 | "$P_SRV" \ |
| 6386 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6387 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6388 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6389 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6390 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6391 | |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 6392 | # Checking next 3 tests logs for 1n-1 split against BEAST too |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6393 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6394 | "$P_SRV response_size=16384" \ |
| 6395 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6396 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6397 | 0 \ |
| 6398 | -c "Read from server: 1 bytes read"\ |
| 6399 | -c "16383 bytes read"\ |
| 6400 | -C "Read from server: 16384 bytes read" |
| 6401 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6402 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6403 | "$P_SRV response_size=16384" \ |
| 6404 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6405 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6406 | 0 \ |
| 6407 | -c "Read from server: 1 bytes read"\ |
| 6408 | -c "16383 bytes read"\ |
| 6409 | -C "Read from server: 16384 bytes read" |
| 6410 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6411 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6412 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6413 | "$P_SRV response_size=16384" \ |
| 6414 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6415 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6416 | trunc_hmac=1" \ |
| 6417 | 0 \ |
| 6418 | -c "Read from server: 1 bytes read"\ |
| 6419 | -c "16383 bytes read"\ |
| 6420 | -C "Read from server: 16384 bytes read" |
| 6421 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6422 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6423 | "$P_SRV response_size=16384" \ |
| 6424 | "$P_CLI force_version=tls1_1 \ |
| 6425 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6426 | 0 \ |
| 6427 | -c "Read from server: 16384 bytes read" |
| 6428 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6429 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6430 | "$P_SRV response_size=16384" \ |
| 6431 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6432 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6433 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6434 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6435 | -c "Read from server: 16384 bytes read" |
| 6436 | |
| 6437 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6438 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6439 | "$P_SRV response_size=16384" \ |
| 6440 | "$P_CLI force_version=tls1_1 \ |
| 6441 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6442 | trunc_hmac=1" \ |
| 6443 | 0 \ |
| 6444 | -c "Read from server: 16384 bytes read" |
| 6445 | |
| 6446 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6447 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6448 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6449 | "$P_CLI force_version=tls1_1 \ |
| 6450 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6451 | 0 \ |
| 6452 | -s "16384 bytes written in 1 fragments" \ |
| 6453 | -c "Read from server: 16384 bytes read" |
| 6454 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6455 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6456 | "$P_SRV response_size=16384" \ |
| 6457 | "$P_CLI force_version=tls1_2 \ |
| 6458 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6459 | 0 \ |
| 6460 | -c "Read from server: 16384 bytes read" |
| 6461 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6462 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6463 | "$P_SRV response_size=16384" \ |
| 6464 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6465 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6466 | 0 \ |
| 6467 | -s "16384 bytes written in 1 fragments" \ |
| 6468 | -c "Read from server: 16384 bytes read" |
| 6469 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6470 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6471 | "$P_SRV response_size=16384" \ |
| 6472 | "$P_CLI force_version=tls1_2 \ |
| 6473 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6474 | 0 \ |
| 6475 | -c "Read from server: 16384 bytes read" |
| 6476 | |
| 6477 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6478 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6479 | "$P_SRV response_size=16384" \ |
| 6480 | "$P_CLI force_version=tls1_2 \ |
| 6481 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6482 | trunc_hmac=1" \ |
| 6483 | 0 \ |
| 6484 | -c "Read from server: 16384 bytes read" |
| 6485 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6486 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6487 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6488 | "$P_CLI force_version=tls1_2 \ |
| 6489 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6490 | 0 \ |
| 6491 | -s "16384 bytes written in 1 fragments" \ |
| 6492 | -c "Read from server: 16384 bytes read" |
| 6493 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6494 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6495 | "$P_SRV response_size=16384" \ |
| 6496 | "$P_CLI force_version=tls1_2 \ |
| 6497 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6498 | 0 \ |
| 6499 | -c "Read from server: 16384 bytes read" |
| 6500 | |
| 6501 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6502 | "$P_SRV response_size=16384" \ |
| 6503 | "$P_CLI force_version=tls1_2 \ |
| 6504 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6505 | 0 \ |
| 6506 | -c "Read from server: 16384 bytes read" |
| 6507 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6508 | # Tests for restartable ECC |
| 6509 | |
| 6510 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6511 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6512 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6513 | "$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] | 6514 | 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] | 6515 | debug_level=1" \ |
| 6516 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6517 | -C "x509_verify_cert.*4b00" \ |
| 6518 | -C "mbedtls_pk_verify.*4b00" \ |
| 6519 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6520 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6521 | |
| 6522 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6523 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6524 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6525 | "$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] | 6526 | 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] | 6527 | debug_level=1 ec_max_ops=0" \ |
| 6528 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6529 | -C "x509_verify_cert.*4b00" \ |
| 6530 | -C "mbedtls_pk_verify.*4b00" \ |
| 6531 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6532 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6533 | |
| 6534 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6535 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6536 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6537 | "$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] | 6538 | 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] | 6539 | debug_level=1 ec_max_ops=65535" \ |
| 6540 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6541 | -C "x509_verify_cert.*4b00" \ |
| 6542 | -C "mbedtls_pk_verify.*4b00" \ |
| 6543 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6544 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6545 | |
| 6546 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6547 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6548 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6549 | "$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] | 6550 | 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] | 6551 | debug_level=1 ec_max_ops=1000" \ |
| 6552 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6553 | -c "x509_verify_cert.*4b00" \ |
| 6554 | -c "mbedtls_pk_verify.*4b00" \ |
| 6555 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6556 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6557 | |
| 6558 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6559 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 6560 | "$P_SRV auth_mode=required \ |
| 6561 | crt_file=data_files/server5-badsign.crt \ |
| 6562 | key_file=data_files/server5.key" \ |
| 6563 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6564 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6565 | debug_level=1 ec_max_ops=1000" \ |
| 6566 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6567 | -c "x509_verify_cert.*4b00" \ |
| 6568 | -C "mbedtls_pk_verify.*4b00" \ |
| 6569 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6570 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6571 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6572 | -c "! mbedtls_ssl_handshake returned" \ |
| 6573 | -c "X509 - Certificate verification failed" |
| 6574 | |
| 6575 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6576 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 6577 | "$P_SRV auth_mode=required \ |
| 6578 | crt_file=data_files/server5-badsign.crt \ |
| 6579 | key_file=data_files/server5.key" \ |
| 6580 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6581 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6582 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6583 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6584 | -c "x509_verify_cert.*4b00" \ |
| 6585 | -c "mbedtls_pk_verify.*4b00" \ |
| 6586 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6587 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6588 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6589 | -C "! mbedtls_ssl_handshake returned" \ |
| 6590 | -C "X509 - Certificate verification failed" |
| 6591 | |
| 6592 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6593 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6594 | "$P_SRV auth_mode=required \ |
| 6595 | crt_file=data_files/server5-badsign.crt \ |
| 6596 | key_file=data_files/server5.key" \ |
| 6597 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6598 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6599 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6600 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6601 | -C "x509_verify_cert.*4b00" \ |
| 6602 | -c "mbedtls_pk_verify.*4b00" \ |
| 6603 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6604 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6605 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6606 | -C "! mbedtls_ssl_handshake returned" \ |
| 6607 | -C "X509 - Certificate verification failed" |
| 6608 | |
| 6609 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6610 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6611 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6612 | "$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] | 6613 | 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] | 6614 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6615 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6616 | -c "x509_verify_cert.*4b00" \ |
| 6617 | -c "mbedtls_pk_verify.*4b00" \ |
| 6618 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6619 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6620 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6621 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6622 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6623 | "$P_SRV" \ |
| 6624 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6625 | debug_level=1 ec_max_ops=1000" \ |
| 6626 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6627 | -c "x509_verify_cert.*4b00" \ |
| 6628 | -c "mbedtls_pk_verify.*4b00" \ |
| 6629 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6630 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6631 | |
| 6632 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6633 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6634 | "$P_SRV psk=abc123" \ |
| 6635 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6636 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6637 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6638 | -C "x509_verify_cert.*4b00" \ |
| 6639 | -C "mbedtls_pk_verify.*4b00" \ |
| 6640 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6641 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6642 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6643 | # Tests of asynchronous private key support in SSL |
| 6644 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6645 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6646 | run_test "SSL async private: sign, delay=0" \ |
| 6647 | "$P_SRV \ |
| 6648 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6649 | "$P_CLI" \ |
| 6650 | 0 \ |
| 6651 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6652 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6653 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6654 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6655 | run_test "SSL async private: sign, delay=1" \ |
| 6656 | "$P_SRV \ |
| 6657 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6658 | "$P_CLI" \ |
| 6659 | 0 \ |
| 6660 | -s "Async sign callback: using key slot " \ |
| 6661 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6662 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6663 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6664 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6665 | run_test "SSL async private: sign, delay=2" \ |
| 6666 | "$P_SRV \ |
| 6667 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6668 | "$P_CLI" \ |
| 6669 | 0 \ |
| 6670 | -s "Async sign callback: using key slot " \ |
| 6671 | -U "Async sign callback: using key slot " \ |
| 6672 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6673 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6674 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6675 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6676 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6677 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6678 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6680 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6681 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6682 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6683 | "$P_CLI force_version=tls1_1" \ |
| 6684 | 0 \ |
| 6685 | -s "Async sign callback: using key slot " \ |
| 6686 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6687 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6688 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6689 | run_test "SSL async private: sign, SNI" \ |
| 6690 | "$P_SRV debug_level=3 \ |
| 6691 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6692 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6693 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6694 | "$P_CLI server_name=polarssl.example" \ |
| 6695 | 0 \ |
| 6696 | -s "Async sign callback: using key slot " \ |
| 6697 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6698 | -s "parse ServerName extension" \ |
| 6699 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6700 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6701 | |
| 6702 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6703 | run_test "SSL async private: decrypt, delay=0" \ |
| 6704 | "$P_SRV \ |
| 6705 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6706 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6707 | 0 \ |
| 6708 | -s "Async decrypt callback: using key slot " \ |
| 6709 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6710 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6711 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6712 | run_test "SSL async private: decrypt, delay=1" \ |
| 6713 | "$P_SRV \ |
| 6714 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6715 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6716 | 0 \ |
| 6717 | -s "Async decrypt callback: using key slot " \ |
| 6718 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6719 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6720 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6721 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6722 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6723 | "$P_SRV psk=abc123 \ |
| 6724 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6725 | "$P_CLI psk=abc123 \ |
| 6726 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6727 | 0 \ |
| 6728 | -s "Async decrypt callback: using key slot " \ |
| 6729 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6730 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6731 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6732 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6733 | "$P_SRV psk=abc123 \ |
| 6734 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6735 | "$P_CLI psk=abc123 \ |
| 6736 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6737 | 0 \ |
| 6738 | -s "Async decrypt callback: using key slot " \ |
| 6739 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6740 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6741 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6742 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6743 | run_test "SSL async private: sign callback not present" \ |
| 6744 | "$P_SRV \ |
| 6745 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6746 | "$P_CLI; [ \$? -eq 1 ] && |
| 6747 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6748 | 0 \ |
| 6749 | -S "Async sign callback" \ |
| 6750 | -s "! mbedtls_ssl_handshake returned" \ |
| 6751 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6752 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6753 | -s "Successful connection" |
| 6754 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6755 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6756 | run_test "SSL async private: decrypt callback not present" \ |
| 6757 | "$P_SRV debug_level=1 \ |
| 6758 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6759 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6760 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6761 | 0 \ |
| 6762 | -S "Async decrypt callback" \ |
| 6763 | -s "! mbedtls_ssl_handshake returned" \ |
| 6764 | -s "got no RSA private key" \ |
| 6765 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6766 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6767 | |
| 6768 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6769 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6770 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6771 | "$P_SRV \ |
| 6772 | async_operations=s async_private_delay1=1 \ |
| 6773 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6774 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6775 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6776 | 0 \ |
| 6777 | -s "Async sign callback: using key slot 0," \ |
| 6778 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6779 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6780 | |
| 6781 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6782 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6783 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6784 | "$P_SRV \ |
| 6785 | async_operations=s async_private_delay2=1 \ |
| 6786 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6787 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6788 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6789 | 0 \ |
| 6790 | -s "Async sign callback: using key slot 0," \ |
| 6791 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6792 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6793 | |
| 6794 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6795 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6796 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6797 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6798 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6799 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6800 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6801 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6802 | 0 \ |
| 6803 | -s "Async sign callback: using key slot 1," \ |
| 6804 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6805 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6806 | |
| 6807 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6808 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6809 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6810 | "$P_SRV \ |
| 6811 | async_operations=s async_private_delay1=1 \ |
| 6812 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6813 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6814 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6815 | 0 \ |
| 6816 | -s "Async sign callback: no key matches this certificate." |
| 6817 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6818 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6819 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6820 | "$P_SRV \ |
| 6821 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6822 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6823 | "$P_CLI" \ |
| 6824 | 1 \ |
| 6825 | -s "Async sign callback: injected error" \ |
| 6826 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6827 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6828 | -s "! mbedtls_ssl_handshake returned" |
| 6829 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6830 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6831 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6832 | "$P_SRV \ |
| 6833 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6834 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6835 | "$P_CLI" \ |
| 6836 | 1 \ |
| 6837 | -s "Async sign callback: using key slot " \ |
| 6838 | -S "Async resume" \ |
| 6839 | -s "Async cancel" |
| 6840 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6841 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6842 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6843 | "$P_SRV \ |
| 6844 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6845 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6846 | "$P_CLI" \ |
| 6847 | 1 \ |
| 6848 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6849 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6850 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6851 | -s "! mbedtls_ssl_handshake returned" |
| 6852 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6853 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6854 | run_test "SSL async private: decrypt, error in start" \ |
| 6855 | "$P_SRV \ |
| 6856 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6857 | async_private_error=1" \ |
| 6858 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6859 | 1 \ |
| 6860 | -s "Async decrypt callback: injected error" \ |
| 6861 | -S "Async resume" \ |
| 6862 | -S "Async cancel" \ |
| 6863 | -s "! mbedtls_ssl_handshake returned" |
| 6864 | |
| 6865 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6866 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6867 | "$P_SRV \ |
| 6868 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6869 | async_private_error=2" \ |
| 6870 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6871 | 1 \ |
| 6872 | -s "Async decrypt callback: using key slot " \ |
| 6873 | -S "Async resume" \ |
| 6874 | -s "Async cancel" |
| 6875 | |
| 6876 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6877 | run_test "SSL async private: decrypt, error in resume" \ |
| 6878 | "$P_SRV \ |
| 6879 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6880 | async_private_error=3" \ |
| 6881 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6882 | 1 \ |
| 6883 | -s "Async decrypt callback: using key slot " \ |
| 6884 | -s "Async resume callback: decrypt done but injected error" \ |
| 6885 | -S "Async cancel" \ |
| 6886 | -s "! mbedtls_ssl_handshake returned" |
| 6887 | |
| 6888 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6889 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6890 | "$P_SRV \ |
| 6891 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6892 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6893 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6894 | 0 \ |
| 6895 | -s "Async cancel" \ |
| 6896 | -s "! mbedtls_ssl_handshake returned" \ |
| 6897 | -s "Async resume" \ |
| 6898 | -s "Successful connection" |
| 6899 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6900 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6901 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6902 | "$P_SRV \ |
| 6903 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6904 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6905 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6906 | 0 \ |
| 6907 | -s "! mbedtls_ssl_handshake returned" \ |
| 6908 | -s "Async resume" \ |
| 6909 | -s "Successful connection" |
| 6910 | |
| 6911 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6912 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6913 | 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] | 6914 | "$P_SRV \ |
| 6915 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6916 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6917 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6918 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6919 | [ \$? -eq 1 ] && |
| 6920 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6921 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6922 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6923 | -S "Async resume" \ |
| 6924 | -s "Async cancel" \ |
| 6925 | -s "! mbedtls_ssl_handshake returned" \ |
| 6926 | -s "Async sign callback: no key matches this certificate." \ |
| 6927 | -s "Successful connection" |
| 6928 | |
| 6929 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6930 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6931 | 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] | 6932 | "$P_SRV \ |
| 6933 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6934 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6935 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6936 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6937 | [ \$? -eq 1 ] && |
| 6938 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6939 | 0 \ |
| 6940 | -s "Async resume" \ |
| 6941 | -s "! mbedtls_ssl_handshake returned" \ |
| 6942 | -s "Async sign callback: no key matches this certificate." \ |
| 6943 | -s "Successful connection" |
| 6944 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6945 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6946 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6947 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6948 | "$P_SRV \ |
| 6949 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6950 | exchanges=2 renegotiation=1" \ |
| 6951 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6952 | 0 \ |
| 6953 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6954 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6955 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6956 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6957 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6958 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6959 | "$P_SRV \ |
| 6960 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6961 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6962 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6963 | 0 \ |
| 6964 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6965 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6966 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6967 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6968 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6969 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6970 | "$P_SRV \ |
| 6971 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6972 | exchanges=2 renegotiation=1" \ |
| 6973 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6974 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6975 | 0 \ |
| 6976 | -s "Async decrypt callback: using key slot " \ |
| 6977 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6978 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6979 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6980 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6981 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6982 | "$P_SRV \ |
| 6983 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6984 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6985 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6986 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6987 | 0 \ |
| 6988 | -s "Async decrypt callback: using key slot " \ |
| 6989 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6990 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6991 | # Tests for ECC extensions (rfc 4492) |
| 6992 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6993 | requires_config_enabled MBEDTLS_AES_C |
| 6994 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6995 | requires_config_enabled MBEDTLS_SHA256_C |
| 6996 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6997 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6998 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6999 | "$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] | 7000 | 0 \ |
| 7001 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7002 | -C "client hello, adding supported_point_formats extension" \ |
| 7003 | -S "found supported elliptic curves extension" \ |
| 7004 | -S "found supported point formats extension" |
| 7005 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7006 | requires_config_enabled MBEDTLS_AES_C |
| 7007 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7008 | requires_config_enabled MBEDTLS_SHA256_C |
| 7009 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7010 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7011 | "$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] | 7012 | "$P_CLI debug_level=3" \ |
| 7013 | 0 \ |
| 7014 | -C "found supported_point_formats extension" \ |
| 7015 | -S "server hello, supported_point_formats extension" |
| 7016 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7017 | requires_config_enabled MBEDTLS_AES_C |
| 7018 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7019 | requires_config_enabled MBEDTLS_SHA256_C |
| 7020 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7021 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7022 | "$P_SRV debug_level=3" \ |
| 7023 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7024 | 0 \ |
| 7025 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7026 | -c "client hello, adding supported_point_formats extension" \ |
| 7027 | -s "found supported elliptic curves extension" \ |
| 7028 | -s "found supported point formats extension" |
| 7029 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7030 | requires_config_enabled MBEDTLS_AES_C |
| 7031 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7032 | requires_config_enabled MBEDTLS_SHA256_C |
| 7033 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7034 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7035 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7036 | "$P_CLI debug_level=3" \ |
| 7037 | 0 \ |
| 7038 | -c "found supported_point_formats extension" \ |
| 7039 | -s "server hello, supported_point_formats extension" |
| 7040 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7041 | # Tests for DTLS HelloVerifyRequest |
| 7042 | |
| 7043 | run_test "DTLS cookie: enabled" \ |
| 7044 | "$P_SRV dtls=1 debug_level=2" \ |
| 7045 | "$P_CLI dtls=1 debug_level=2" \ |
| 7046 | 0 \ |
| 7047 | -s "cookie verification failed" \ |
| 7048 | -s "cookie verification passed" \ |
| 7049 | -S "cookie verification skipped" \ |
| 7050 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7051 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7052 | -S "SSL - The requested feature is not available" |
| 7053 | |
| 7054 | run_test "DTLS cookie: disabled" \ |
| 7055 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7056 | "$P_CLI dtls=1 debug_level=2" \ |
| 7057 | 0 \ |
| 7058 | -S "cookie verification failed" \ |
| 7059 | -S "cookie verification passed" \ |
| 7060 | -s "cookie verification skipped" \ |
| 7061 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7062 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7063 | -S "SSL - The requested feature is not available" |
| 7064 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7065 | run_test "DTLS cookie: default (failing)" \ |
| 7066 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7067 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7068 | 1 \ |
| 7069 | -s "cookie verification failed" \ |
| 7070 | -S "cookie verification passed" \ |
| 7071 | -S "cookie verification skipped" \ |
| 7072 | -C "received hello verify request" \ |
| 7073 | -S "hello verification requested" \ |
| 7074 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7075 | |
| 7076 | requires_ipv6 |
| 7077 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7078 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7079 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7080 | 0 \ |
| 7081 | -s "cookie verification failed" \ |
| 7082 | -s "cookie verification passed" \ |
| 7083 | -S "cookie verification skipped" \ |
| 7084 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7085 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7086 | -S "SSL - The requested feature is not available" |
| 7087 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7088 | run_test "DTLS cookie: enabled, nbio" \ |
| 7089 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7090 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7091 | 0 \ |
| 7092 | -s "cookie verification failed" \ |
| 7093 | -s "cookie verification passed" \ |
| 7094 | -S "cookie verification skipped" \ |
| 7095 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7096 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7097 | -S "SSL - The requested feature is not available" |
| 7098 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7099 | # Tests for client reconnecting from the same port with DTLS |
| 7100 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7101 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7102 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7103 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7104 | "$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] | 7105 | 0 \ |
| 7106 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7107 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7108 | -S "Client initiated reconnection from same port" |
| 7109 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7110 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7111 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7112 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7113 | "$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] | 7114 | 0 \ |
| 7115 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7116 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7117 | -s "Client initiated reconnection from same port" |
| 7118 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7119 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7120 | 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] | 7121 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7122 | "$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] | 7123 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7124 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7125 | -s "Client initiated reconnection from same port" |
| 7126 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7127 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7128 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7129 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7130 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7131 | 0 \ |
| 7132 | -S "The operation timed out" \ |
| 7133 | -s "Client initiated reconnection from same port" |
| 7134 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7135 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7136 | "$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] | 7137 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7138 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7139 | -s "The operation timed out" \ |
| 7140 | -S "Client initiated reconnection from same port" |
| 7141 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7142 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7143 | -p "$P_PXY inject_clihlo=1" \ |
| 7144 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7145 | "$P_CLI dtls=1 exchanges=2" \ |
| 7146 | 0 \ |
| 7147 | -s "possible client reconnect from the same port" \ |
| 7148 | -S "Client initiated reconnection from same port" |
| 7149 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7150 | # Tests for various cases of client authentication with DTLS |
| 7151 | # (focused on handshake flows and message parsing) |
| 7152 | |
| 7153 | run_test "DTLS client auth: required" \ |
| 7154 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7155 | "$P_CLI dtls=1" \ |
| 7156 | 0 \ |
| 7157 | -s "Verifying peer X.509 certificate... ok" |
| 7158 | |
| 7159 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7160 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7161 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7162 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7163 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7164 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7165 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7166 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7167 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7168 | 0 \ |
| 7169 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7170 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7171 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7172 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7173 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7174 | "$P_CLI dtls=1 psk=abc124" \ |
| 7175 | 1 \ |
| 7176 | -s "SSL - Verification of the message MAC failed" \ |
| 7177 | -c "SSL - A fatal alert message was received from our peer" |
| 7178 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7179 | # Tests for receiving fragmented handshake messages with DTLS |
| 7180 | |
| 7181 | requires_gnutls |
| 7182 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7183 | "$G_SRV -u --mtu 2048 -a" \ |
| 7184 | "$P_CLI dtls=1 debug_level=2" \ |
| 7185 | 0 \ |
| 7186 | -C "found fragmented DTLS handshake message" \ |
| 7187 | -C "error" |
| 7188 | |
| 7189 | requires_gnutls |
| 7190 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7191 | "$G_SRV -u --mtu 512" \ |
| 7192 | "$P_CLI dtls=1 debug_level=2" \ |
| 7193 | 0 \ |
| 7194 | -c "found fragmented DTLS handshake message" \ |
| 7195 | -C "error" |
| 7196 | |
| 7197 | requires_gnutls |
| 7198 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7199 | "$G_SRV -u --mtu 128" \ |
| 7200 | "$P_CLI dtls=1 debug_level=2" \ |
| 7201 | 0 \ |
| 7202 | -c "found fragmented DTLS handshake message" \ |
| 7203 | -C "error" |
| 7204 | |
| 7205 | requires_gnutls |
| 7206 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7207 | "$G_SRV -u --mtu 128" \ |
| 7208 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7209 | 0 \ |
| 7210 | -c "found fragmented DTLS handshake message" \ |
| 7211 | -C "error" |
| 7212 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7213 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7214 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7215 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7216 | "$G_SRV -u --mtu 256" \ |
| 7217 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7218 | 0 \ |
| 7219 | -c "found fragmented DTLS handshake message" \ |
| 7220 | -c "client hello, adding renegotiation extension" \ |
| 7221 | -c "found renegotiation extension" \ |
| 7222 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7223 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7224 | -C "error" \ |
| 7225 | -s "Extra-header:" |
| 7226 | |
| 7227 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7228 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7229 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7230 | "$G_SRV -u --mtu 256" \ |
| 7231 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7232 | 0 \ |
| 7233 | -c "found fragmented DTLS handshake message" \ |
| 7234 | -c "client hello, adding renegotiation extension" \ |
| 7235 | -c "found renegotiation extension" \ |
| 7236 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7237 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7238 | -C "error" \ |
| 7239 | -s "Extra-header:" |
| 7240 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7241 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7242 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7243 | "$P_CLI dtls=1 debug_level=2" \ |
| 7244 | 0 \ |
| 7245 | -C "found fragmented DTLS handshake message" \ |
| 7246 | -C "error" |
| 7247 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7248 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7249 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7250 | "$P_CLI dtls=1 debug_level=2" \ |
| 7251 | 0 \ |
| 7252 | -c "found fragmented DTLS handshake message" \ |
| 7253 | -C "error" |
| 7254 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7255 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7256 | "$O_SRV -dtls1 -mtu 256" \ |
| 7257 | "$P_CLI dtls=1 debug_level=2" \ |
| 7258 | 0 \ |
| 7259 | -c "found fragmented DTLS handshake message" \ |
| 7260 | -C "error" |
| 7261 | |
| 7262 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7263 | "$O_SRV -dtls1 -mtu 256" \ |
| 7264 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7265 | 0 \ |
| 7266 | -c "found fragmented DTLS handshake message" \ |
| 7267 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7268 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7269 | # Tests for sending fragmented handshake messages with DTLS |
| 7270 | # |
| 7271 | # Use client auth when we need the client to send large messages, |
| 7272 | # and use large cert chains on both sides too (the long chains we have all use |
| 7273 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7274 | # Sizes reached (UDP payload): |
| 7275 | # - 2037B for server certificate |
| 7276 | # - 1542B for client certificate |
| 7277 | # - 1013B for newsessionticket |
| 7278 | # - all others below 512B |
| 7279 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7280 | |
| 7281 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7282 | requires_config_enabled MBEDTLS_RSA_C |
| 7283 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7284 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7285 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7286 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7287 | crt_file=data_files/server7_int-ca.crt \ |
| 7288 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7289 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7290 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7291 | "$P_CLI dtls=1 debug_level=2 \ |
| 7292 | crt_file=data_files/server8_int-ca2.crt \ |
| 7293 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7294 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7295 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7296 | 0 \ |
| 7297 | -S "found fragmented DTLS handshake message" \ |
| 7298 | -C "found fragmented DTLS handshake message" \ |
| 7299 | -C "error" |
| 7300 | |
| 7301 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7302 | requires_config_enabled MBEDTLS_RSA_C |
| 7303 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7304 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7305 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7306 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7307 | crt_file=data_files/server7_int-ca.crt \ |
| 7308 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7309 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7310 | max_frag_len=1024" \ |
| 7311 | "$P_CLI dtls=1 debug_level=2 \ |
| 7312 | crt_file=data_files/server8_int-ca2.crt \ |
| 7313 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7314 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7315 | max_frag_len=2048" \ |
| 7316 | 0 \ |
| 7317 | -S "found fragmented DTLS handshake message" \ |
| 7318 | -c "found fragmented DTLS handshake message" \ |
| 7319 | -C "error" |
| 7320 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7321 | # With the MFL extension, the server has no way of forcing |
| 7322 | # the client to not exceed a certain MTU; hence, the following |
| 7323 | # test can't be replicated with an MTU proxy such as the one |
| 7324 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7325 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7326 | requires_config_enabled MBEDTLS_RSA_C |
| 7327 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7328 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7329 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7330 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7331 | crt_file=data_files/server7_int-ca.crt \ |
| 7332 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7333 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7334 | max_frag_len=512" \ |
| 7335 | "$P_CLI dtls=1 debug_level=2 \ |
| 7336 | crt_file=data_files/server8_int-ca2.crt \ |
| 7337 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7338 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7339 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7340 | 0 \ |
| 7341 | -S "found fragmented DTLS handshake message" \ |
| 7342 | -c "found fragmented DTLS handshake message" \ |
| 7343 | -C "error" |
| 7344 | |
| 7345 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7346 | requires_config_enabled MBEDTLS_RSA_C |
| 7347 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7348 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7349 | 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] | 7350 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7351 | crt_file=data_files/server7_int-ca.crt \ |
| 7352 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7353 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7354 | max_frag_len=2048" \ |
| 7355 | "$P_CLI dtls=1 debug_level=2 \ |
| 7356 | crt_file=data_files/server8_int-ca2.crt \ |
| 7357 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7358 | hs_timeout=2500-60000 \ |
| 7359 | max_frag_len=1024" \ |
| 7360 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7361 | -S "found fragmented DTLS handshake message" \ |
| 7362 | -c "found fragmented DTLS handshake message" \ |
| 7363 | -C "error" |
| 7364 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7365 | # While not required by the standard defining the MFL extension |
| 7366 | # (according to which it only applies to records, not to datagrams), |
| 7367 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7368 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7369 | # to the peer. |
| 7370 | # The next test checks that no datagrams significantly larger than the |
| 7371 | # negotiated MFL are sent. |
| 7372 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7373 | requires_config_enabled MBEDTLS_RSA_C |
| 7374 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7375 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7376 | 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] | 7377 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7378 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7379 | crt_file=data_files/server7_int-ca.crt \ |
| 7380 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7381 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7382 | max_frag_len=2048" \ |
| 7383 | "$P_CLI dtls=1 debug_level=2 \ |
| 7384 | crt_file=data_files/server8_int-ca2.crt \ |
| 7385 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7386 | hs_timeout=2500-60000 \ |
| 7387 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7388 | 0 \ |
| 7389 | -S "found fragmented DTLS handshake message" \ |
| 7390 | -c "found fragmented DTLS handshake message" \ |
| 7391 | -C "error" |
| 7392 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7393 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7394 | requires_config_enabled MBEDTLS_RSA_C |
| 7395 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7396 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7397 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7398 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7399 | crt_file=data_files/server7_int-ca.crt \ |
| 7400 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7401 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7402 | max_frag_len=2048" \ |
| 7403 | "$P_CLI dtls=1 debug_level=2 \ |
| 7404 | crt_file=data_files/server8_int-ca2.crt \ |
| 7405 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7406 | hs_timeout=2500-60000 \ |
| 7407 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7408 | 0 \ |
| 7409 | -s "found fragmented DTLS handshake message" \ |
| 7410 | -c "found fragmented DTLS handshake message" \ |
| 7411 | -C "error" |
| 7412 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7413 | # While not required by the standard defining the MFL extension |
| 7414 | # (according to which it only applies to records, not to datagrams), |
| 7415 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7416 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7417 | # to the peer. |
| 7418 | # The next test checks that no datagrams significantly larger than the |
| 7419 | # negotiated MFL are sent. |
| 7420 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7421 | requires_config_enabled MBEDTLS_RSA_C |
| 7422 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7423 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7424 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7425 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7426 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7427 | crt_file=data_files/server7_int-ca.crt \ |
| 7428 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7429 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7430 | max_frag_len=2048" \ |
| 7431 | "$P_CLI dtls=1 debug_level=2 \ |
| 7432 | crt_file=data_files/server8_int-ca2.crt \ |
| 7433 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7434 | hs_timeout=2500-60000 \ |
| 7435 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7436 | 0 \ |
| 7437 | -s "found fragmented DTLS handshake message" \ |
| 7438 | -c "found fragmented DTLS handshake message" \ |
| 7439 | -C "error" |
| 7440 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7441 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7442 | requires_config_enabled MBEDTLS_RSA_C |
| 7443 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7444 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7445 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7446 | crt_file=data_files/server7_int-ca.crt \ |
| 7447 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7448 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7449 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7450 | "$P_CLI dtls=1 debug_level=2 \ |
| 7451 | crt_file=data_files/server8_int-ca2.crt \ |
| 7452 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7453 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7454 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7455 | 0 \ |
| 7456 | -S "found fragmented DTLS handshake message" \ |
| 7457 | -C "found fragmented DTLS handshake message" \ |
| 7458 | -C "error" |
| 7459 | |
| 7460 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7461 | requires_config_enabled MBEDTLS_RSA_C |
| 7462 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7463 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7464 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7465 | crt_file=data_files/server7_int-ca.crt \ |
| 7466 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7467 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7468 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7469 | "$P_CLI dtls=1 debug_level=2 \ |
| 7470 | crt_file=data_files/server8_int-ca2.crt \ |
| 7471 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7472 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7473 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7474 | 0 \ |
| 7475 | -s "found fragmented DTLS handshake message" \ |
| 7476 | -C "found fragmented DTLS handshake message" \ |
| 7477 | -C "error" |
| 7478 | |
| 7479 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7480 | requires_config_enabled MBEDTLS_RSA_C |
| 7481 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7482 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7483 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7484 | crt_file=data_files/server7_int-ca.crt \ |
| 7485 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7486 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7487 | mtu=512" \ |
| 7488 | "$P_CLI dtls=1 debug_level=2 \ |
| 7489 | crt_file=data_files/server8_int-ca2.crt \ |
| 7490 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7491 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7492 | mtu=2048" \ |
| 7493 | 0 \ |
| 7494 | -S "found fragmented DTLS handshake message" \ |
| 7495 | -c "found fragmented DTLS handshake message" \ |
| 7496 | -C "error" |
| 7497 | |
| 7498 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7499 | requires_config_enabled MBEDTLS_RSA_C |
| 7500 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7501 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7502 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7503 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7504 | crt_file=data_files/server7_int-ca.crt \ |
| 7505 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7506 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7507 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7508 | "$P_CLI dtls=1 debug_level=2 \ |
| 7509 | crt_file=data_files/server8_int-ca2.crt \ |
| 7510 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7511 | hs_timeout=2500-60000 \ |
| 7512 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7513 | 0 \ |
| 7514 | -s "found fragmented DTLS handshake message" \ |
| 7515 | -c "found fragmented DTLS handshake message" \ |
| 7516 | -C "error" |
| 7517 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7518 | # 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] | 7519 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7520 | requires_config_enabled MBEDTLS_RSA_C |
| 7521 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7522 | requires_config_enabled MBEDTLS_SHA256_C |
| 7523 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7524 | requires_config_enabled MBEDTLS_AES_C |
| 7525 | requires_config_enabled MBEDTLS_GCM_C |
| 7526 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7527 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7528 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7529 | crt_file=data_files/server7_int-ca.crt \ |
| 7530 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7531 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7532 | mtu=512" \ |
| 7533 | "$P_CLI dtls=1 debug_level=2 \ |
| 7534 | crt_file=data_files/server8_int-ca2.crt \ |
| 7535 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7536 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7537 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7538 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7539 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7540 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7541 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7542 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7543 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7544 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7545 | # 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] | 7546 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7547 | # retransmissions, but in some cases (like both the server and client using |
| 7548 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7549 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7550 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7551 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7552 | requires_config_enabled MBEDTLS_RSA_C |
| 7553 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7554 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7555 | requires_config_enabled MBEDTLS_AES_C |
| 7556 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7557 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7558 | -p "$P_PXY mtu=508" \ |
| 7559 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7560 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7561 | key_file=data_files/server7.key \ |
| 7562 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7563 | "$P_CLI dtls=1 debug_level=2 \ |
| 7564 | crt_file=data_files/server8_int-ca2.crt \ |
| 7565 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7566 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7567 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7568 | 0 \ |
| 7569 | -s "found fragmented DTLS handshake message" \ |
| 7570 | -c "found fragmented DTLS handshake message" \ |
| 7571 | -C "error" |
| 7572 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7573 | # 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] | 7574 | only_with_valgrind |
| 7575 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7576 | requires_config_enabled MBEDTLS_RSA_C |
| 7577 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7578 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7579 | requires_config_enabled MBEDTLS_AES_C |
| 7580 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7581 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7582 | -p "$P_PXY mtu=508" \ |
| 7583 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7584 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7585 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7586 | hs_timeout=250-10000" \ |
| 7587 | "$P_CLI dtls=1 debug_level=2 \ |
| 7588 | crt_file=data_files/server8_int-ca2.crt \ |
| 7589 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7590 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7591 | hs_timeout=250-10000" \ |
| 7592 | 0 \ |
| 7593 | -s "found fragmented DTLS handshake message" \ |
| 7594 | -c "found fragmented DTLS handshake message" \ |
| 7595 | -C "error" |
| 7596 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7597 | # 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] | 7598 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7599 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7600 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7601 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7602 | requires_config_enabled MBEDTLS_RSA_C |
| 7603 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7604 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7605 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7606 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7607 | crt_file=data_files/server7_int-ca.crt \ |
| 7608 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7609 | hs_timeout=10000-60000 \ |
| 7610 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7611 | "$P_CLI dtls=1 debug_level=2 \ |
| 7612 | crt_file=data_files/server8_int-ca2.crt \ |
| 7613 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7614 | hs_timeout=10000-60000 \ |
| 7615 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7616 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7617 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7618 | -s "found fragmented DTLS handshake message" \ |
| 7619 | -c "found fragmented DTLS handshake message" \ |
| 7620 | -C "error" |
| 7621 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7622 | # 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] | 7623 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7624 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7625 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7626 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7627 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7628 | requires_config_enabled MBEDTLS_RSA_C |
| 7629 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7630 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7631 | requires_config_enabled MBEDTLS_AES_C |
| 7632 | requires_config_enabled MBEDTLS_GCM_C |
| 7633 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7634 | -p "$P_PXY mtu=512" \ |
| 7635 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7636 | crt_file=data_files/server7_int-ca.crt \ |
| 7637 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7638 | hs_timeout=10000-60000 \ |
| 7639 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7640 | "$P_CLI dtls=1 debug_level=2 \ |
| 7641 | crt_file=data_files/server8_int-ca2.crt \ |
| 7642 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7643 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7644 | hs_timeout=10000-60000 \ |
| 7645 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7646 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7647 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7648 | -s "found fragmented DTLS handshake message" \ |
| 7649 | -c "found fragmented DTLS handshake message" \ |
| 7650 | -C "error" |
| 7651 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7652 | not_with_valgrind # spurious autoreduction due to timeout |
| 7653 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7654 | requires_config_enabled MBEDTLS_RSA_C |
| 7655 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7656 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7657 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7658 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7659 | crt_file=data_files/server7_int-ca.crt \ |
| 7660 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7661 | hs_timeout=10000-60000 \ |
| 7662 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7663 | "$P_CLI dtls=1 debug_level=2 \ |
| 7664 | crt_file=data_files/server8_int-ca2.crt \ |
| 7665 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7666 | hs_timeout=10000-60000 \ |
| 7667 | mtu=1024 nbio=2" \ |
| 7668 | 0 \ |
| 7669 | -S "autoreduction" \ |
| 7670 | -s "found fragmented DTLS handshake message" \ |
| 7671 | -c "found fragmented DTLS handshake message" \ |
| 7672 | -C "error" |
| 7673 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7674 | # 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] | 7675 | not_with_valgrind # spurious autoreduction due to timeout |
| 7676 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7677 | requires_config_enabled MBEDTLS_RSA_C |
| 7678 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7679 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7680 | requires_config_enabled MBEDTLS_AES_C |
| 7681 | requires_config_enabled MBEDTLS_GCM_C |
| 7682 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7683 | -p "$P_PXY mtu=512" \ |
| 7684 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7685 | crt_file=data_files/server7_int-ca.crt \ |
| 7686 | key_file=data_files/server7.key \ |
| 7687 | hs_timeout=10000-60000 \ |
| 7688 | mtu=512 nbio=2" \ |
| 7689 | "$P_CLI dtls=1 debug_level=2 \ |
| 7690 | crt_file=data_files/server8_int-ca2.crt \ |
| 7691 | key_file=data_files/server8.key \ |
| 7692 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7693 | hs_timeout=10000-60000 \ |
| 7694 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7695 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7696 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7697 | -s "found fragmented DTLS handshake message" \ |
| 7698 | -c "found fragmented DTLS handshake message" \ |
| 7699 | -C "error" |
| 7700 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7701 | # 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] | 7702 | # This ensures things still work after session_reset(). |
| 7703 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7704 | # Since we don't support reading fragmented ClientHello yet, |
| 7705 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7706 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7707 | # An autoreduction on the client-side might happen if the server is |
| 7708 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7709 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7710 | # resumed listening, which would result in a spurious autoreduction. |
| 7711 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7712 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7713 | requires_config_enabled MBEDTLS_RSA_C |
| 7714 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7715 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7716 | requires_config_enabled MBEDTLS_AES_C |
| 7717 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7718 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7719 | -p "$P_PXY mtu=1450" \ |
| 7720 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7721 | crt_file=data_files/server7_int-ca.crt \ |
| 7722 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7723 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7724 | mtu=1450" \ |
| 7725 | "$P_CLI dtls=1 debug_level=2 \ |
| 7726 | crt_file=data_files/server8_int-ca2.crt \ |
| 7727 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7728 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7729 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7730 | 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] | 7731 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7732 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7733 | -s "found fragmented DTLS handshake message" \ |
| 7734 | -c "found fragmented DTLS handshake message" \ |
| 7735 | -C "error" |
| 7736 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7737 | # An autoreduction on the client-side might happen if the server is |
| 7738 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7739 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7740 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7741 | requires_config_enabled MBEDTLS_RSA_C |
| 7742 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7743 | requires_config_enabled MBEDTLS_SHA256_C |
| 7744 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7745 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7746 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7747 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7748 | -p "$P_PXY mtu=512" \ |
| 7749 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7750 | crt_file=data_files/server7_int-ca.crt \ |
| 7751 | key_file=data_files/server7.key \ |
| 7752 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7753 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7754 | mtu=512" \ |
| 7755 | "$P_CLI dtls=1 debug_level=2 \ |
| 7756 | crt_file=data_files/server8_int-ca2.crt \ |
| 7757 | key_file=data_files/server8.key \ |
| 7758 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7759 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7760 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7761 | mtu=512" \ |
| 7762 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7763 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7764 | -s "found fragmented DTLS handshake message" \ |
| 7765 | -c "found fragmented DTLS handshake message" \ |
| 7766 | -C "error" |
| 7767 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7768 | # An autoreduction on the client-side might happen if the server is |
| 7769 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7770 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7771 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7772 | requires_config_enabled MBEDTLS_RSA_C |
| 7773 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7774 | requires_config_enabled MBEDTLS_SHA256_C |
| 7775 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7776 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7777 | requires_config_enabled MBEDTLS_AES_C |
| 7778 | requires_config_enabled MBEDTLS_GCM_C |
| 7779 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7780 | -p "$P_PXY mtu=512" \ |
| 7781 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7782 | crt_file=data_files/server7_int-ca.crt \ |
| 7783 | key_file=data_files/server7.key \ |
| 7784 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7785 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7786 | mtu=512" \ |
| 7787 | "$P_CLI dtls=1 debug_level=2 \ |
| 7788 | crt_file=data_files/server8_int-ca2.crt \ |
| 7789 | key_file=data_files/server8.key \ |
| 7790 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7791 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7792 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7793 | mtu=512" \ |
| 7794 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7795 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7796 | -s "found fragmented DTLS handshake message" \ |
| 7797 | -c "found fragmented DTLS handshake message" \ |
| 7798 | -C "error" |
| 7799 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7800 | # An autoreduction on the client-side might happen if the server is |
| 7801 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7802 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7803 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7804 | requires_config_enabled MBEDTLS_RSA_C |
| 7805 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7806 | requires_config_enabled MBEDTLS_SHA256_C |
| 7807 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7808 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7809 | requires_config_enabled MBEDTLS_AES_C |
| 7810 | requires_config_enabled MBEDTLS_CCM_C |
| 7811 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7812 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7813 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7814 | crt_file=data_files/server7_int-ca.crt \ |
| 7815 | key_file=data_files/server7.key \ |
| 7816 | exchanges=2 renegotiation=1 \ |
| 7817 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7818 | hs_timeout=10000-60000 \ |
| 7819 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7820 | "$P_CLI dtls=1 debug_level=2 \ |
| 7821 | crt_file=data_files/server8_int-ca2.crt \ |
| 7822 | key_file=data_files/server8.key \ |
| 7823 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7824 | hs_timeout=10000-60000 \ |
| 7825 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7826 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7827 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7828 | -s "found fragmented DTLS handshake message" \ |
| 7829 | -c "found fragmented DTLS handshake message" \ |
| 7830 | -C "error" |
| 7831 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7832 | # An autoreduction on the client-side might happen if the server is |
| 7833 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7834 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7835 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7836 | requires_config_enabled MBEDTLS_RSA_C |
| 7837 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7838 | requires_config_enabled MBEDTLS_SHA256_C |
| 7839 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7840 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7841 | requires_config_enabled MBEDTLS_AES_C |
| 7842 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7843 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7844 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7845 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7846 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7847 | crt_file=data_files/server7_int-ca.crt \ |
| 7848 | key_file=data_files/server7.key \ |
| 7849 | exchanges=2 renegotiation=1 \ |
| 7850 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7851 | hs_timeout=10000-60000 \ |
| 7852 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7853 | "$P_CLI dtls=1 debug_level=2 \ |
| 7854 | crt_file=data_files/server8_int-ca2.crt \ |
| 7855 | key_file=data_files/server8.key \ |
| 7856 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7857 | hs_timeout=10000-60000 \ |
| 7858 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7859 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7860 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7861 | -s "found fragmented DTLS handshake message" \ |
| 7862 | -c "found fragmented DTLS handshake message" \ |
| 7863 | -C "error" |
| 7864 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7865 | # An autoreduction on the client-side might happen if the server is |
| 7866 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7867 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7868 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7869 | requires_config_enabled MBEDTLS_RSA_C |
| 7870 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7871 | requires_config_enabled MBEDTLS_SHA256_C |
| 7872 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7873 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7874 | requires_config_enabled MBEDTLS_AES_C |
| 7875 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7876 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7877 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7878 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7879 | crt_file=data_files/server7_int-ca.crt \ |
| 7880 | key_file=data_files/server7.key \ |
| 7881 | exchanges=2 renegotiation=1 \ |
| 7882 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7883 | hs_timeout=10000-60000 \ |
| 7884 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7885 | "$P_CLI dtls=1 debug_level=2 \ |
| 7886 | crt_file=data_files/server8_int-ca2.crt \ |
| 7887 | key_file=data_files/server8.key \ |
| 7888 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7889 | hs_timeout=10000-60000 \ |
| 7890 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7891 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7892 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7893 | -s "found fragmented DTLS handshake message" \ |
| 7894 | -c "found fragmented DTLS handshake message" \ |
| 7895 | -C "error" |
| 7896 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7897 | # 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] | 7898 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7899 | requires_config_enabled MBEDTLS_RSA_C |
| 7900 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7901 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7902 | requires_config_enabled MBEDTLS_AES_C |
| 7903 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7904 | client_needs_more_time 2 |
| 7905 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7906 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7907 | "$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] | 7908 | crt_file=data_files/server7_int-ca.crt \ |
| 7909 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7910 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7911 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7912 | crt_file=data_files/server8_int-ca2.crt \ |
| 7913 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7914 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7915 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7916 | 0 \ |
| 7917 | -s "found fragmented DTLS handshake message" \ |
| 7918 | -c "found fragmented DTLS handshake message" \ |
| 7919 | -C "error" |
| 7920 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7921 | # 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] | 7922 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7923 | requires_config_enabled MBEDTLS_RSA_C |
| 7924 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7925 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7926 | requires_config_enabled MBEDTLS_AES_C |
| 7927 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7928 | client_needs_more_time 2 |
| 7929 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7930 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7931 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7932 | crt_file=data_files/server7_int-ca.crt \ |
| 7933 | key_file=data_files/server7.key \ |
| 7934 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7935 | "$P_CLI dtls=1 debug_level=2 \ |
| 7936 | crt_file=data_files/server8_int-ca2.crt \ |
| 7937 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7938 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7939 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7940 | 0 \ |
| 7941 | -s "found fragmented DTLS handshake message" \ |
| 7942 | -c "found fragmented DTLS handshake message" \ |
| 7943 | -C "error" |
| 7944 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7945 | # interop tests for DTLS fragmentating with reliable connection |
| 7946 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7947 | # here and below we just want to test that the we fragment in a way that |
| 7948 | # pleases other implementations, so we don't need the peer to fragment |
| 7949 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7950 | requires_config_enabled MBEDTLS_RSA_C |
| 7951 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7952 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7953 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7954 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7955 | "$G_SRV -u" \ |
| 7956 | "$P_CLI dtls=1 debug_level=2 \ |
| 7957 | crt_file=data_files/server8_int-ca2.crt \ |
| 7958 | key_file=data_files/server8.key \ |
| 7959 | mtu=512 force_version=dtls1_2" \ |
| 7960 | 0 \ |
| 7961 | -c "fragmenting handshake message" \ |
| 7962 | -C "error" |
| 7963 | |
| 7964 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7965 | requires_config_enabled MBEDTLS_RSA_C |
| 7966 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7968 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7969 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 7970 | "$G_SRV -u" \ |
| 7971 | "$P_CLI dtls=1 debug_level=2 \ |
| 7972 | crt_file=data_files/server8_int-ca2.crt \ |
| 7973 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7974 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7975 | 0 \ |
| 7976 | -c "fragmenting handshake message" \ |
| 7977 | -C "error" |
| 7978 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7979 | # We use --insecure for the GnuTLS client because it expects |
| 7980 | # the hostname / IP it connects to to be the name used in the |
| 7981 | # certificate obtained from the server. Here, however, it |
| 7982 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7983 | # as the server name in the certificate. This will make the |
| 7984 | # certifiate validation fail, but passing --insecure makes |
| 7985 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7986 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7987 | requires_config_enabled MBEDTLS_RSA_C |
| 7988 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7989 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7990 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7991 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7992 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7993 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7994 | crt_file=data_files/server7_int-ca.crt \ |
| 7995 | key_file=data_files/server7.key \ |
| 7996 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7997 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7998 | 0 \ |
| 7999 | -s "fragmenting handshake message" |
| 8000 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8001 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8002 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8003 | requires_config_enabled MBEDTLS_RSA_C |
| 8004 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8006 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8007 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8008 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8009 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8010 | crt_file=data_files/server7_int-ca.crt \ |
| 8011 | key_file=data_files/server7.key \ |
| 8012 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8013 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8014 | 0 \ |
| 8015 | -s "fragmenting handshake message" |
| 8016 | |
| 8017 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8018 | requires_config_enabled MBEDTLS_RSA_C |
| 8019 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8021 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8022 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8023 | "$P_CLI dtls=1 debug_level=2 \ |
| 8024 | crt_file=data_files/server8_int-ca2.crt \ |
| 8025 | key_file=data_files/server8.key \ |
| 8026 | mtu=512 force_version=dtls1_2" \ |
| 8027 | 0 \ |
| 8028 | -c "fragmenting handshake message" \ |
| 8029 | -C "error" |
| 8030 | |
| 8031 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8032 | requires_config_enabled MBEDTLS_RSA_C |
| 8033 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8035 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8036 | "$O_SRV -dtls1 -verify 10" \ |
| 8037 | "$P_CLI dtls=1 debug_level=2 \ |
| 8038 | crt_file=data_files/server8_int-ca2.crt \ |
| 8039 | key_file=data_files/server8.key \ |
| 8040 | mtu=512 force_version=dtls1" \ |
| 8041 | 0 \ |
| 8042 | -c "fragmenting handshake message" \ |
| 8043 | -C "error" |
| 8044 | |
| 8045 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8046 | requires_config_enabled MBEDTLS_RSA_C |
| 8047 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8049 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8050 | "$P_SRV dtls=1 debug_level=2 \ |
| 8051 | crt_file=data_files/server7_int-ca.crt \ |
| 8052 | key_file=data_files/server7.key \ |
| 8053 | mtu=512 force_version=dtls1_2" \ |
| 8054 | "$O_CLI -dtls1_2" \ |
| 8055 | 0 \ |
| 8056 | -s "fragmenting handshake message" |
| 8057 | |
| 8058 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8059 | requires_config_enabled MBEDTLS_RSA_C |
| 8060 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8062 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8063 | "$P_SRV dtls=1 debug_level=2 \ |
| 8064 | crt_file=data_files/server7_int-ca.crt \ |
| 8065 | key_file=data_files/server7.key \ |
| 8066 | mtu=512 force_version=dtls1" \ |
| 8067 | "$O_CLI -dtls1" \ |
| 8068 | 0 \ |
| 8069 | -s "fragmenting handshake message" |
| 8070 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8071 | # interop tests for DTLS fragmentating with unreliable connection |
| 8072 | # |
| 8073 | # again we just want to test that the we fragment in a way that |
| 8074 | # pleases other implementations, so we don't need the peer to fragment |
| 8075 | requires_gnutls_next |
| 8076 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8077 | requires_config_enabled MBEDTLS_RSA_C |
| 8078 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8079 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8080 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8081 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8082 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8083 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8084 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8085 | crt_file=data_files/server8_int-ca2.crt \ |
| 8086 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8087 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8088 | 0 \ |
| 8089 | -c "fragmenting handshake message" \ |
| 8090 | -C "error" |
| 8091 | |
| 8092 | requires_gnutls_next |
| 8093 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8094 | requires_config_enabled MBEDTLS_RSA_C |
| 8095 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8096 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8097 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8098 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8099 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8100 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8101 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8102 | crt_file=data_files/server8_int-ca2.crt \ |
| 8103 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8104 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8105 | 0 \ |
| 8106 | -c "fragmenting handshake message" \ |
| 8107 | -C "error" |
| 8108 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8109 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8110 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8111 | requires_config_enabled MBEDTLS_RSA_C |
| 8112 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8113 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8114 | client_needs_more_time 4 |
| 8115 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8116 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8117 | "$P_SRV dtls=1 debug_level=2 \ |
| 8118 | crt_file=data_files/server7_int-ca.crt \ |
| 8119 | key_file=data_files/server7.key \ |
| 8120 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8121 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8122 | 0 \ |
| 8123 | -s "fragmenting handshake message" |
| 8124 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8125 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8126 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8127 | requires_config_enabled MBEDTLS_RSA_C |
| 8128 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8130 | client_needs_more_time 4 |
| 8131 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8132 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8133 | "$P_SRV dtls=1 debug_level=2 \ |
| 8134 | crt_file=data_files/server7_int-ca.crt \ |
| 8135 | key_file=data_files/server7.key \ |
| 8136 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8137 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8138 | 0 \ |
| 8139 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8140 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8141 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8142 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8143 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8144 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8145 | ## (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] | 8146 | skip_next_test |
| 8147 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8148 | requires_config_enabled MBEDTLS_RSA_C |
| 8149 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8150 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8151 | client_needs_more_time 4 |
| 8152 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8153 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8154 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8155 | "$P_CLI dtls=1 debug_level=2 \ |
| 8156 | crt_file=data_files/server8_int-ca2.crt \ |
| 8157 | key_file=data_files/server8.key \ |
| 8158 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8159 | 0 \ |
| 8160 | -c "fragmenting handshake message" \ |
| 8161 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8162 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8163 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8164 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8165 | requires_config_enabled MBEDTLS_RSA_C |
| 8166 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8168 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8169 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8170 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8171 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8172 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8173 | crt_file=data_files/server8_int-ca2.crt \ |
| 8174 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8175 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8176 | 0 \ |
| 8177 | -c "fragmenting handshake message" \ |
| 8178 | -C "error" |
| 8179 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8180 | skip_next_test |
| 8181 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8182 | requires_config_enabled MBEDTLS_RSA_C |
| 8183 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8184 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8185 | client_needs_more_time 4 |
| 8186 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8187 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8188 | "$P_SRV dtls=1 debug_level=2 \ |
| 8189 | crt_file=data_files/server7_int-ca.crt \ |
| 8190 | key_file=data_files/server7.key \ |
| 8191 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8192 | "$O_CLI -dtls1_2" \ |
| 8193 | 0 \ |
| 8194 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8195 | |
| 8196 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8197 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8198 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8199 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8200 | requires_config_enabled MBEDTLS_RSA_C |
| 8201 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8202 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8203 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8204 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8205 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8206 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8207 | crt_file=data_files/server7_int-ca.crt \ |
| 8208 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8209 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8210 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8211 | 0 \ |
| 8212 | -s "fragmenting handshake message" |
| 8213 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8214 | # Tests for DTLS-SRTP (RFC 5764) |
| 8215 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8216 | run_test "DTLS-SRTP all profiles supported" \ |
| 8217 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8218 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8219 | 0 \ |
| 8220 | -s "found use_srtp extension" \ |
| 8221 | -s "found srtp profile" \ |
| 8222 | -s "selected srtp profile" \ |
| 8223 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8224 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8225 | -c "client hello, adding use_srtp extension" \ |
| 8226 | -c "found use_srtp extension" \ |
| 8227 | -c "found srtp profile" \ |
| 8228 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8229 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8230 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8231 | -C "error" |
| 8232 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8233 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8234 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8235 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 8236 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8237 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=5 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8238 | 0 \ |
| 8239 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8240 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 8241 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8242 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8243 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8244 | -c "client hello, adding use_srtp extension" \ |
| 8245 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8246 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8247 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8248 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8249 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8250 | -C "error" |
| 8251 | |
| 8252 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8253 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8254 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8255 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8256 | 0 \ |
| 8257 | -s "found use_srtp extension" \ |
| 8258 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8259 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8260 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8261 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8262 | -c "client hello, adding use_srtp extension" \ |
| 8263 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8264 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8265 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8266 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8267 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8268 | -C "error" |
| 8269 | |
| 8270 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8271 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8272 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8273 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8274 | 0 \ |
| 8275 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8276 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8277 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8278 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8279 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8280 | -c "client hello, adding use_srtp extension" \ |
| 8281 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8282 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8283 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8284 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8285 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8286 | -C "error" |
| 8287 | |
| 8288 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8289 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8290 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8291 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8292 | 0 \ |
| 8293 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8294 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8295 | -S "selected srtp profile" \ |
| 8296 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8297 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8298 | -c "client hello, adding use_srtp extension" \ |
| 8299 | -C "found use_srtp extension" \ |
| 8300 | -C "found srtp profile" \ |
| 8301 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8302 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8303 | -C "error" |
| 8304 | |
| 8305 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8306 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8307 | "$P_SRV dtls=1 debug_level=3" \ |
| 8308 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8309 | 0 \ |
| 8310 | -s "found use_srtp extension" \ |
| 8311 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8312 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8313 | -c "client hello, adding use_srtp extension" \ |
| 8314 | -C "found use_srtp extension" \ |
| 8315 | -C "found srtp profile" \ |
| 8316 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8317 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8318 | -C "error" |
| 8319 | |
| 8320 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8321 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8322 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8323 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8324 | 0 \ |
| 8325 | -s "found use_srtp extension" \ |
| 8326 | -s "found srtp profile" \ |
| 8327 | -s "selected srtp profile" \ |
| 8328 | -s "server hello, adding use_srtp extension" \ |
| 8329 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8330 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8331 | -c "client hello, adding use_srtp extension" \ |
| 8332 | -c "found use_srtp extension" \ |
| 8333 | -c "found srtp profile" \ |
| 8334 | -c "selected srtp profile" \ |
| 8335 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8336 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8337 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8338 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8339 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8340 | -C "error" |
| 8341 | |
| 8342 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8343 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8344 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8345 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8346 | 0 \ |
| 8347 | -s "found use_srtp extension" \ |
| 8348 | -s "found srtp profile" \ |
| 8349 | -s "selected srtp profile" \ |
| 8350 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8351 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8352 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8353 | -S "dumping 'using mki' (8 bytes)" \ |
| 8354 | -c "client hello, adding use_srtp extension" \ |
| 8355 | -c "found use_srtp extension" \ |
| 8356 | -c "found srtp profile" \ |
| 8357 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8358 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8359 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8360 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8361 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8362 | -C "dumping 'received mki' (8 bytes)" \ |
| 8363 | -C "error" |
| 8364 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8365 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8366 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8367 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8368 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8369 | 0 \ |
| 8370 | -s "found use_srtp extension" \ |
| 8371 | -s "found srtp profile" \ |
| 8372 | -s "selected srtp profile" \ |
| 8373 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8374 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8375 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8376 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8377 | |
| 8378 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8379 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8380 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8381 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8382 | 0 \ |
| 8383 | -s "found use_srtp extension" \ |
| 8384 | -s "found srtp profile" \ |
| 8385 | -s "selected srtp profile" \ |
| 8386 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8387 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8388 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8389 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8390 | |
| 8391 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8392 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8393 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8394 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8395 | 0 \ |
| 8396 | -s "found use_srtp extension" \ |
| 8397 | -s "found srtp profile" \ |
| 8398 | -s "selected srtp profile" \ |
| 8399 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8400 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8401 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8402 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8403 | |
| 8404 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8405 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8406 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8407 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8408 | 0 \ |
| 8409 | -s "found use_srtp extension" \ |
| 8410 | -s "found srtp profile" \ |
| 8411 | -s "selected srtp profile" \ |
| 8412 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8413 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8414 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8415 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8416 | |
| 8417 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8418 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8419 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8420 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8421 | 0 \ |
| 8422 | -s "found use_srtp extension" \ |
| 8423 | -s "found srtp profile" \ |
| 8424 | -s "selected srtp profile" \ |
| 8425 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8426 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8427 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8428 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8429 | |
| 8430 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8431 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8432 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8433 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8434 | 0 \ |
| 8435 | -s "found use_srtp extension" \ |
| 8436 | -s "found srtp profile" \ |
| 8437 | -S "selected srtp profile" \ |
| 8438 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8439 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8440 | -C "SRTP Extension negotiated, profile" |
| 8441 | |
| 8442 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8443 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8444 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8445 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8446 | 0 \ |
| 8447 | -s "found use_srtp extension" \ |
| 8448 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8449 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8450 | -C "SRTP Extension negotiated, profile" |
| 8451 | |
| 8452 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8453 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8454 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8455 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8456 | 0 \ |
| 8457 | -c "client hello, adding use_srtp extension" \ |
| 8458 | -c "found use_srtp extension" \ |
| 8459 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8460 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8461 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8462 | -C "error" |
| 8463 | |
| 8464 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8465 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8466 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8467 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8468 | 0 \ |
| 8469 | -c "client hello, adding use_srtp extension" \ |
| 8470 | -c "found use_srtp extension" \ |
| 8471 | -c "found srtp profile" \ |
| 8472 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8473 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8474 | -C "error" |
| 8475 | |
| 8476 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8477 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8478 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8479 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8480 | 0 \ |
| 8481 | -c "client hello, adding use_srtp extension" \ |
| 8482 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8483 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8484 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8485 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8486 | -C "error" |
| 8487 | |
| 8488 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8489 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8490 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8491 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8492 | 0 \ |
| 8493 | -c "client hello, adding use_srtp extension" \ |
| 8494 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8495 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8496 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8497 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8498 | -C "error" |
| 8499 | |
| 8500 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8501 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8502 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8503 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8504 | 0 \ |
| 8505 | -c "client hello, adding use_srtp extension" \ |
| 8506 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8507 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8508 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8509 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8510 | -C "error" |
| 8511 | |
| 8512 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8513 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8514 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8515 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8516 | 0 \ |
| 8517 | -c "client hello, adding use_srtp extension" \ |
| 8518 | -C "found use_srtp extension" \ |
| 8519 | -C "found srtp profile" \ |
| 8520 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8521 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8522 | -C "error" |
| 8523 | |
| 8524 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8525 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8526 | "$O_SRV -dtls1" \ |
| 8527 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8528 | 0 \ |
| 8529 | -c "client hello, adding use_srtp extension" \ |
| 8530 | -C "found use_srtp extension" \ |
| 8531 | -C "found srtp profile" \ |
| 8532 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8533 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8534 | -C "error" |
| 8535 | |
| 8536 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8537 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8538 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8539 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8540 | 0 \ |
| 8541 | -c "client hello, adding use_srtp extension" \ |
| 8542 | -c "found use_srtp extension" \ |
| 8543 | -c "found srtp profile" \ |
| 8544 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8545 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8546 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8547 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8548 | -C "dumping 'received mki' (8 bytes)" \ |
| 8549 | -C "error" |
| 8550 | |
| 8551 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8552 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8553 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8554 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8555 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8556 | 0 \ |
| 8557 | -s "found use_srtp extension" \ |
| 8558 | -s "found srtp profile" \ |
| 8559 | -s "selected srtp profile" \ |
| 8560 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8561 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8562 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8563 | |
| 8564 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8565 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8566 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8567 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8568 | "$G_CLI -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8569 | 0 \ |
| 8570 | -s "found use_srtp extension" \ |
| 8571 | -s "found srtp profile" \ |
| 8572 | -s "selected srtp profile" \ |
| 8573 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8574 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8575 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8576 | |
| 8577 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8578 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8579 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8580 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8581 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8582 | 0 \ |
| 8583 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8584 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8585 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8586 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8587 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8588 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8589 | |
| 8590 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8591 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8592 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls client." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8593 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8594 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8595 | 0 \ |
| 8596 | -s "found use_srtp extension" \ |
| 8597 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8598 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8599 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8600 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8601 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8602 | |
| 8603 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8604 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8605 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8606 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8607 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8608 | 0 \ |
| 8609 | -s "found use_srtp extension" \ |
| 8610 | -s "found srtp profile" \ |
| 8611 | -s "selected srtp profile" \ |
| 8612 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8613 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8614 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8615 | |
| 8616 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8617 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8618 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8619 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8620 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8621 | 0 \ |
| 8622 | -s "found use_srtp extension" \ |
| 8623 | -s "found srtp profile" \ |
| 8624 | -S "selected srtp profile" \ |
| 8625 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8626 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8627 | -C "SRTP profile:" |
| 8628 | |
| 8629 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8630 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8631 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls client" \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8632 | "$P_SRV dtls=1 debug_level=3" \ |
| 8633 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8634 | 0 \ |
| 8635 | -s "found use_srtp extension" \ |
| 8636 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8637 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8638 | -C "SRTP profile:" |
| 8639 | |
| 8640 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8641 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8642 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8643 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 8644 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8645 | 0 \ |
| 8646 | -c "client hello, adding use_srtp extension" \ |
| 8647 | -c "found use_srtp extension" \ |
| 8648 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8649 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8650 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8651 | -C "error" |
| 8652 | |
| 8653 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8654 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8655 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8656 | "$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 8657 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8658 | 0 \ |
| 8659 | -c "client hello, adding use_srtp extension" \ |
| 8660 | -c "found use_srtp extension" \ |
| 8661 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8662 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8663 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8664 | -C "error" |
| 8665 | |
| 8666 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8667 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8668 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8669 | "$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 8670 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8671 | 0 \ |
| 8672 | -c "client hello, adding use_srtp extension" \ |
| 8673 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8674 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8675 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8676 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8677 | -C "error" |
| 8678 | |
| 8679 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8680 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8681 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8682 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8683 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8684 | 0 \ |
| 8685 | -c "client hello, adding use_srtp extension" \ |
| 8686 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8687 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8688 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8689 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8690 | -C "error" |
| 8691 | |
| 8692 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8693 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8694 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8695 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8696 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8697 | 0 \ |
| 8698 | -c "client hello, adding use_srtp extension" \ |
| 8699 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8700 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8701 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8702 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8703 | -C "error" |
| 8704 | |
| 8705 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8706 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8707 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8708 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8709 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8710 | 0 \ |
| 8711 | -c "client hello, adding use_srtp extension" \ |
| 8712 | -C "found use_srtp extension" \ |
| 8713 | -C "found srtp profile" \ |
| 8714 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8715 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8716 | -C "error" |
| 8717 | |
| 8718 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8719 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8720 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8721 | "$G_SRV -u" \ |
| 8722 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8723 | 0 \ |
| 8724 | -c "client hello, adding use_srtp extension" \ |
| 8725 | -C "found use_srtp extension" \ |
| 8726 | -C "found srtp profile" \ |
| 8727 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8728 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8729 | -C "error" |
| 8730 | |
| 8731 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8732 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8733 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8734 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 8735 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8736 | 0 \ |
| 8737 | -c "client hello, adding use_srtp extension" \ |
| 8738 | -c "found use_srtp extension" \ |
| 8739 | -c "found srtp profile" \ |
| 8740 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8741 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8742 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8743 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8744 | -c "dumping 'received mki' (8 bytes)" \ |
| 8745 | -C "error" |
| 8746 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8747 | # Tests for specific things with "unreliable" UDP connection |
| 8748 | |
| 8749 | not_with_valgrind # spurious resend due to timeout |
| 8750 | run_test "DTLS proxy: reference" \ |
| 8751 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8752 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8753 | "$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] | 8754 | 0 \ |
| 8755 | -C "replayed record" \ |
| 8756 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8757 | -C "Buffer record from epoch" \ |
| 8758 | -S "Buffer record from epoch" \ |
| 8759 | -C "ssl_buffer_message" \ |
| 8760 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8761 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8762 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8763 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8764 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8765 | -c "HTTP/1.0 200 OK" |
| 8766 | |
| 8767 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8768 | run_test "DTLS proxy: duplicate every packet" \ |
| 8769 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8770 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8771 | "$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] | 8772 | 0 \ |
| 8773 | -c "replayed record" \ |
| 8774 | -s "replayed record" \ |
| 8775 | -c "record from another epoch" \ |
| 8776 | -s "record from another epoch" \ |
| 8777 | -S "resend" \ |
| 8778 | -s "Extra-header:" \ |
| 8779 | -c "HTTP/1.0 200 OK" |
| 8780 | |
| 8781 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8782 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8783 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8784 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8785 | 0 \ |
| 8786 | -c "replayed record" \ |
| 8787 | -S "replayed record" \ |
| 8788 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8789 | -s "record from another epoch" \ |
| 8790 | -c "resend" \ |
| 8791 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8792 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8793 | -c "HTTP/1.0 200 OK" |
| 8794 | |
| 8795 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8796 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8797 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8798 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8799 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8800 | -c "next record in same datagram" \ |
| 8801 | -s "next record in same datagram" |
| 8802 | |
| 8803 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8804 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8805 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8806 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8807 | 0 \ |
| 8808 | -c "next record in same datagram" \ |
| 8809 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8810 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8811 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 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" \ |
| 8814 | "$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] | 8815 | 0 \ |
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 | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8818 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 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 1" \ |
| 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=1" \ |
| 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 | 1 \ |
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" \ |
| 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" \ |
| 8838 | "$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] | 8839 | 0 \ |
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" |
| 8846 | |
| 8847 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8848 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8849 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8850 | "$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] | 8851 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8852 | -c "discarding invalid record (mac)" \ |
| 8853 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8854 | -s "Extra-header:" \ |
| 8855 | -c "HTTP/1.0 200 OK" \ |
| 8856 | -s "too many records with bad MAC" \ |
| 8857 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8858 | |
| 8859 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8860 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8861 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8862 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8863 | 0 \ |
| 8864 | -c "record from another epoch" \ |
| 8865 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8866 | -s "Extra-header:" \ |
| 8867 | -c "HTTP/1.0 200 OK" |
| 8868 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8869 | # Tests for reordering support with DTLS |
| 8870 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8871 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8872 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8873 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8874 | hs_timeout=2500-60000" \ |
| 8875 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8876 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8877 | 0 \ |
| 8878 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8879 | -c "Next handshake message has been buffered - load"\ |
| 8880 | -S "Buffering HS message" \ |
| 8881 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8882 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8883 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8884 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8885 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8886 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8887 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8888 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8889 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8890 | hs_timeout=2500-60000" \ |
| 8891 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8892 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8893 | 0 \ |
| 8894 | -c "Buffering HS message" \ |
| 8895 | -c "found fragmented DTLS handshake message"\ |
| 8896 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8897 | -c "Next handshake message has been buffered - load"\ |
| 8898 | -S "Buffering HS message" \ |
| 8899 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8900 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8901 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8902 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8903 | -S "Remember CCS message" |
| 8904 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8905 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8906 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8907 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8908 | # while keeping the ServerKeyExchange. |
| 8909 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8910 | 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] | 8911 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8912 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8913 | hs_timeout=2500-60000" \ |
| 8914 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8915 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8916 | 0 \ |
| 8917 | -c "Buffering HS message" \ |
| 8918 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8919 | -C "attempt to make space by freeing buffered messages" \ |
| 8920 | -S "Buffering HS message" \ |
| 8921 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8922 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8923 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8924 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8925 | -S "Remember CCS message" |
| 8926 | |
| 8927 | # The size constraints ensure that the delayed certificate message can't |
| 8928 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8929 | # when dropping it first. |
| 8930 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8931 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8932 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8933 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8934 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8935 | hs_timeout=2500-60000" \ |
| 8936 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8937 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8938 | 0 \ |
| 8939 | -c "Buffering HS message" \ |
| 8940 | -c "attempt to make space by freeing buffered future messages" \ |
| 8941 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8942 | -S "Buffering HS message" \ |
| 8943 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8944 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8945 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8946 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8947 | -S "Remember CCS message" |
| 8948 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8949 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8950 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8951 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8952 | hs_timeout=2500-60000" \ |
| 8953 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8954 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8955 | 0 \ |
| 8956 | -C "Buffering HS message" \ |
| 8957 | -C "Next handshake message has been buffered - load"\ |
| 8958 | -s "Buffering HS message" \ |
| 8959 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8960 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8961 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8962 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8963 | -S "Remember CCS message" |
| 8964 | |
| 8965 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8966 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8967 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8968 | hs_timeout=2500-60000" \ |
| 8969 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8970 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8971 | 0 \ |
| 8972 | -C "Buffering HS message" \ |
| 8973 | -C "Next handshake message has been buffered - load"\ |
| 8974 | -S "Buffering HS message" \ |
| 8975 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8976 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8977 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8978 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8979 | -S "Remember CCS message" |
| 8980 | |
| 8981 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8982 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8983 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8984 | hs_timeout=2500-60000" \ |
| 8985 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8986 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8987 | 0 \ |
| 8988 | -C "Buffering HS message" \ |
| 8989 | -C "Next handshake message has been buffered - load"\ |
| 8990 | -S "Buffering HS message" \ |
| 8991 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8992 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8993 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8994 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8995 | -s "Remember CCS message" |
| 8996 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8997 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8998 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8999 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9000 | hs_timeout=2500-60000" \ |
| 9001 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9002 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9003 | 0 \ |
| 9004 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9005 | -s "Found buffered record from current epoch - load" \ |
| 9006 | -c "Buffer record from epoch 1" \ |
| 9007 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9008 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9009 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9010 | # from the server are delayed, so that the encrypted Finished message |
| 9011 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9012 | # in afterwards, the encrypted Finished message must be freed in order |
| 9013 | # to make space for the NewSessionTicket to be reassembled. |
| 9014 | # This works only in very particular circumstances: |
| 9015 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9016 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9017 | # the encrypted Finished message. |
| 9018 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9019 | # needs to be fragmented. |
| 9020 | # - All messages sent by the server must be small enough to be either sent |
| 9021 | # without fragmentation or be reassembled within the bounds of |
| 9022 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9023 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9024 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9025 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9026 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9027 | -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] | 9028 | "$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] | 9029 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9030 | 0 \ |
| 9031 | -s "Buffer record from epoch 1" \ |
| 9032 | -s "Found buffered record from current epoch - load" \ |
| 9033 | -c "Buffer record from epoch 1" \ |
| 9034 | -C "Found buffered record from current epoch - load" \ |
| 9035 | -c "Enough space available after freeing future epoch record" |
| 9036 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9037 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9038 | |
| 9039 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9040 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9041 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9042 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9043 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9044 | "$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] | 9045 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9046 | 0 \ |
| 9047 | -s "Extra-header:" \ |
| 9048 | -c "HTTP/1.0 200 OK" |
| 9049 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9050 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9051 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9052 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9053 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9054 | "$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] | 9055 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9056 | 0 \ |
| 9057 | -s "Extra-header:" \ |
| 9058 | -c "HTTP/1.0 200 OK" |
| 9059 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9060 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9061 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9062 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9063 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9064 | "$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] | 9065 | 0 \ |
| 9066 | -s "Extra-header:" \ |
| 9067 | -c "HTTP/1.0 200 OK" |
| 9068 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9069 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9070 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9071 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9072 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9073 | "$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] | 9074 | 0 \ |
| 9075 | -s "Extra-header:" \ |
| 9076 | -c "HTTP/1.0 200 OK" |
| 9077 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9078 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9079 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9080 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9081 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9082 | "$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] | 9083 | 0 \ |
| 9084 | -s "Extra-header:" \ |
| 9085 | -c "HTTP/1.0 200 OK" |
| 9086 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9087 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9088 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9089 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9090 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9091 | "$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] | 9092 | 0 \ |
| 9093 | -s "Extra-header:" \ |
| 9094 | -c "HTTP/1.0 200 OK" |
| 9095 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9096 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9097 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9098 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9099 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 9100 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9101 | "$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] | 9102 | 0 \ |
| 9103 | -s "Extra-header:" \ |
| 9104 | -c "HTTP/1.0 200 OK" |
| 9105 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9106 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9107 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9108 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9109 | "$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] | 9110 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9111 | "$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] | 9112 | 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] | 9113 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9114 | 0 \ |
| 9115 | -s "a session has been resumed" \ |
| 9116 | -c "a session has been resumed" \ |
| 9117 | -s "Extra-header:" \ |
| 9118 | -c "HTTP/1.0 200 OK" |
| 9119 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9120 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9121 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9122 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9123 | "$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] | 9124 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9125 | "$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] | 9126 | 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] | 9127 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9128 | 0 \ |
| 9129 | -s "a session has been resumed" \ |
| 9130 | -c "a session has been resumed" \ |
| 9131 | -s "Extra-header:" \ |
| 9132 | -c "HTTP/1.0 200 OK" |
| 9133 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9134 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9135 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9136 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9137 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9138 | "$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] | 9139 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9140 | "$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] | 9141 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9142 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9143 | 0 \ |
| 9144 | -c "=> renegotiate" \ |
| 9145 | -s "=> renegotiate" \ |
| 9146 | -s "Extra-header:" \ |
| 9147 | -c "HTTP/1.0 200 OK" |
| 9148 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9149 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9150 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9151 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9152 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9153 | "$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] | 9154 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9155 | "$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] | 9156 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9157 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9158 | 0 \ |
| 9159 | -c "=> renegotiate" \ |
| 9160 | -s "=> renegotiate" \ |
| 9161 | -s "Extra-header:" \ |
| 9162 | -c "HTTP/1.0 200 OK" |
| 9163 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9164 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9165 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9166 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9167 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9168 | "$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] | 9169 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9170 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9171 | "$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] | 9172 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9173 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9174 | 0 \ |
| 9175 | -c "=> renegotiate" \ |
| 9176 | -s "=> renegotiate" \ |
| 9177 | -s "Extra-header:" \ |
| 9178 | -c "HTTP/1.0 200 OK" |
| 9179 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9180 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9181 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9182 | 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] | 9183 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9184 | "$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] | 9185 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9186 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9187 | "$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] | 9188 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9189 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9190 | 0 \ |
| 9191 | -c "=> renegotiate" \ |
| 9192 | -s "=> renegotiate" \ |
| 9193 | -s "Extra-header:" \ |
| 9194 | -c "HTTP/1.0 200 OK" |
| 9195 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9196 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9197 | ## all versions installed on the CI machines), reported here: |
| 9198 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9199 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9200 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9201 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9202 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9203 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9204 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9205 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9206 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9207 | "$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] | 9208 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9209 | -c "HTTP/1.0 200 OK" |
| 9210 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9211 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9212 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9213 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9214 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9215 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9216 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9217 | "$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] | 9218 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9219 | -c "HTTP/1.0 200 OK" |
| 9220 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9221 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9222 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9223 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9224 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9225 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9226 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9227 | "$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] | 9228 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9229 | -c "HTTP/1.0 200 OK" |
| 9230 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9231 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9232 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9233 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9234 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9235 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9236 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9237 | "$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] | 9238 | 0 \ |
| 9239 | -s "Extra-header:" \ |
| 9240 | -c "Extra-header:" |
| 9241 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9242 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9243 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9244 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9245 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9246 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9247 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9248 | "$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] | 9249 | 0 \ |
| 9250 | -s "Extra-header:" \ |
| 9251 | -c "Extra-header:" |
| 9252 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9253 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9254 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9255 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9256 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9257 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9258 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9259 | "$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] | 9260 | 0 \ |
| 9261 | -s "Extra-header:" \ |
| 9262 | -c "Extra-header:" |
| 9263 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9264 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 9265 | run_test "export keys functionality" \ |
| 9266 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9267 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9268 | 0 \ |
| 9269 | -s "exported maclen is " \ |
| 9270 | -s "exported keylen is " \ |
| 9271 | -s "exported ivlen is " \ |
| 9272 | -c "exported maclen is " \ |
| 9273 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9274 | -c "exported ivlen is " \ |
| 9275 | -c "EAP-TLS key material is:"\ |
| 9276 | -s "EAP-TLS key material is:"\ |
| 9277 | -c "EAP-TLS IV is:" \ |
| 9278 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9279 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9280 | # Test heap memory usage after handshake |
| 9281 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9282 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9283 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 9284 | run_tests_memory_after_hanshake |
| 9285 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9286 | # Final report |
| 9287 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9288 | echo "------------------------------------------------------------------------" |
| 9289 | |
| 9290 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9291 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9292 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9293 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9294 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9295 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9296 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9297 | |
| 9298 | exit $FAILS |