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 |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame^] | 377 | MAX_CONTENT_LEN=16384 |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 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 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1422 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1423 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1424 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1425 | 1 \ |
| 1426 | -c "The certificate is signed with an unacceptable hash" |
| 1427 | |
| 1428 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1429 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1430 | "$P_CLI allow_sha1=1" \ |
| 1431 | 0 |
| 1432 | |
| 1433 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1434 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1435 | "$P_CLI allow_sha1=0" \ |
| 1436 | 0 |
| 1437 | |
| 1438 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1439 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1440 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1441 | 1 \ |
| 1442 | -s "The certificate is signed with an unacceptable hash" |
| 1443 | |
| 1444 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1445 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1446 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1447 | 0 |
| 1448 | |
| 1449 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1450 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1451 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1452 | 0 |
| 1453 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1454 | # Tests for datagram packing |
| 1455 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1456 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1457 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1458 | 0 \ |
| 1459 | -c "next record in same datagram" \ |
| 1460 | -s "next record in same datagram" |
| 1461 | |
| 1462 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1463 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1464 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1465 | 0 \ |
| 1466 | -s "next record in same datagram" \ |
| 1467 | -C "next record in same datagram" |
| 1468 | |
| 1469 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1470 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1471 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1472 | 0 \ |
| 1473 | -S "next record in same datagram" \ |
| 1474 | -c "next record in same datagram" |
| 1475 | |
| 1476 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1477 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1478 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1479 | 0 \ |
| 1480 | -S "next record in same datagram" \ |
| 1481 | -C "next record in same datagram" |
| 1482 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1483 | # Tests for Truncated HMAC extension |
| 1484 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1485 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1486 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1487 | "$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] | 1488 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1489 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1490 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1491 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1492 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1493 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1494 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1495 | "$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] | 1496 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1497 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1498 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1499 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1500 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1501 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1502 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1503 | "$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] | 1504 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1505 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1506 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1507 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1508 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1509 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1510 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1511 | "$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] | 1512 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1513 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1514 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1515 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1516 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1517 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1518 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1519 | "$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] | 1520 | 0 \ |
| 1521 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1522 | -S "dumping 'expected mac' (10 bytes)" |
| 1523 | |
| 1524 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1525 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1526 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1527 | "$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] | 1528 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1529 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1530 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1531 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1532 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1533 | "$P_SRV dtls=1 debug_level=4" \ |
| 1534 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 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 |
| 1540 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1541 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1542 | "$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] | 1543 | 0 \ |
| 1544 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1545 | -S "dumping 'expected mac' (10 bytes)" |
| 1546 | |
| 1547 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1548 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1549 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1550 | "$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] | 1551 | 0 \ |
| 1552 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1553 | -S "dumping 'expected mac' (10 bytes)" |
| 1554 | |
| 1555 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1556 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1557 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1558 | "$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] | 1559 | 0 \ |
| 1560 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1561 | -S "dumping 'expected mac' (10 bytes)" |
| 1562 | |
| 1563 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1564 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1565 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1566 | "$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] | 1567 | 0 \ |
| 1568 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1569 | -S "dumping 'expected mac' (10 bytes)" |
| 1570 | |
| 1571 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1572 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1573 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1574 | "$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] | 1575 | 0 \ |
| 1576 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1577 | -s "dumping 'expected mac' (10 bytes)" |
| 1578 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1579 | # Tests for Context serialization |
| 1580 | |
| 1581 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1582 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1583 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1584 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1585 | 0 \ |
| 1586 | -c "Deserializing connection..." \ |
| 1587 | -S "Deserializing connection..." |
| 1588 | |
| 1589 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1590 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1591 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1592 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1593 | 0 \ |
| 1594 | -c "Deserializing connection..." \ |
| 1595 | -S "Deserializing connection..." |
| 1596 | |
| 1597 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1598 | run_test "Context serialization, client serializes, GCM" \ |
| 1599 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1600 | "$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] | 1601 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1602 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1603 | -S "Deserializing connection..." |
| 1604 | |
| 1605 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1606 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1607 | run_test "Context serialization, client serializes, with CID" \ |
| 1608 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1609 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1610 | 0 \ |
| 1611 | -c "Deserializing connection..." \ |
| 1612 | -S "Deserializing connection..." |
| 1613 | |
| 1614 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1615 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1616 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1617 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1618 | 0 \ |
| 1619 | -C "Deserializing connection..." \ |
| 1620 | -s "Deserializing connection..." |
| 1621 | |
| 1622 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1623 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1624 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1625 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1626 | 0 \ |
| 1627 | -C "Deserializing connection..." \ |
| 1628 | -s "Deserializing connection..." |
| 1629 | |
| 1630 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1631 | run_test "Context serialization, server serializes, GCM" \ |
| 1632 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1633 | "$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] | 1634 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1635 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1636 | -s "Deserializing connection..." |
| 1637 | |
| 1638 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1639 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1640 | run_test "Context serialization, server serializes, with CID" \ |
| 1641 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1642 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1643 | 0 \ |
| 1644 | -C "Deserializing connection..." \ |
| 1645 | -s "Deserializing connection..." |
| 1646 | |
| 1647 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1648 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1649 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1650 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1651 | 0 \ |
| 1652 | -c "Deserializing connection..." \ |
| 1653 | -s "Deserializing connection..." |
| 1654 | |
| 1655 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1656 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1657 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1658 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1659 | 0 \ |
| 1660 | -c "Deserializing connection..." \ |
| 1661 | -s "Deserializing connection..." |
| 1662 | |
| 1663 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1664 | run_test "Context serialization, both serialize, GCM" \ |
| 1665 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1666 | "$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] | 1667 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1668 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1669 | -s "Deserializing connection..." |
| 1670 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1671 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1672 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1673 | run_test "Context serialization, both serialize, with CID" \ |
| 1674 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1675 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1676 | 0 \ |
| 1677 | -c "Deserializing connection..." \ |
| 1678 | -s "Deserializing connection..." |
| 1679 | |
| 1680 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1681 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1682 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1683 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1684 | 0 \ |
| 1685 | -c "Deserializing connection..." \ |
| 1686 | -S "Deserializing connection..." |
| 1687 | |
| 1688 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1689 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1690 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1691 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1692 | 0 \ |
| 1693 | -c "Deserializing connection..." \ |
| 1694 | -S "Deserializing connection..." |
| 1695 | |
| 1696 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1697 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1698 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1699 | "$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] | 1700 | 0 \ |
| 1701 | -c "Deserializing connection..." \ |
| 1702 | -S "Deserializing connection..." |
| 1703 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1704 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1705 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1706 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1707 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1708 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1709 | 0 \ |
| 1710 | -c "Deserializing connection..." \ |
| 1711 | -S "Deserializing connection..." |
| 1712 | |
| 1713 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1714 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1715 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1716 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1717 | 0 \ |
| 1718 | -C "Deserializing connection..." \ |
| 1719 | -s "Deserializing connection..." |
| 1720 | |
| 1721 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1722 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1723 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1724 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1725 | 0 \ |
| 1726 | -C "Deserializing connection..." \ |
| 1727 | -s "Deserializing connection..." |
| 1728 | |
| 1729 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1730 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1731 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1732 | "$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] | 1733 | 0 \ |
| 1734 | -C "Deserializing connection..." \ |
| 1735 | -s "Deserializing connection..." |
| 1736 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1737 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1738 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1739 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1740 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1741 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1742 | 0 \ |
| 1743 | -C "Deserializing connection..." \ |
| 1744 | -s "Deserializing connection..." |
| 1745 | |
| 1746 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1747 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1748 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1749 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1750 | 0 \ |
| 1751 | -c "Deserializing connection..." \ |
| 1752 | -s "Deserializing connection..." |
| 1753 | |
| 1754 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1755 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1756 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1757 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1758 | 0 \ |
| 1759 | -c "Deserializing connection..." \ |
| 1760 | -s "Deserializing connection..." |
| 1761 | |
| 1762 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1763 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1764 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1765 | "$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] | 1766 | 0 \ |
| 1767 | -c "Deserializing connection..." \ |
| 1768 | -s "Deserializing connection..." |
| 1769 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1770 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1771 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1772 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1773 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1774 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1775 | 0 \ |
| 1776 | -c "Deserializing connection..." \ |
| 1777 | -s "Deserializing connection..." |
| 1778 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1779 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1780 | run_test "Saving the serialized context to a file" \ |
| 1781 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1782 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1783 | 0 \ |
| 1784 | -s "Save serialized context to a file... ok" \ |
| 1785 | -c "Save serialized context to a file... ok" |
| 1786 | rm -f context_srv.txt |
| 1787 | rm -f context_cli.txt |
| 1788 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1789 | # Tests for DTLS Connection ID extension |
| 1790 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1791 | # So far, the CID API isn't implemented, so we can't |
| 1792 | # grep for output witnessing its use. This needs to be |
| 1793 | # changed once the CID extension is implemented. |
| 1794 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1795 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1796 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1797 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1798 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1799 | 0 \ |
| 1800 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1801 | -s "found CID extension" \ |
| 1802 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1803 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1804 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1805 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1806 | -C "found CID extension" \ |
| 1807 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1808 | -C "Copy CIDs into SSL transform" \ |
| 1809 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1810 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1811 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1812 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1813 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1814 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1815 | 0 \ |
| 1816 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1817 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1818 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1819 | -s "Enable use of 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" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1824 | -s "Use of Connection ID was not offered by client" |
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+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1828 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1829 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1830 | 0 \ |
| 1831 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1832 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1833 | -c "client hello, adding CID extension" \ |
| 1834 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1835 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1836 | -s "server hello, adding CID extension" \ |
| 1837 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1838 | -c "Use of CID extension negotiated" \ |
| 1839 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1840 | -c "Copy CIDs into SSL transform" \ |
| 1841 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1842 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1843 | -s "Use of Connection ID has been negotiated" \ |
| 1844 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1845 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1846 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1847 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1848 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1849 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1850 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1851 | 0 \ |
| 1852 | -c "Enable use of CID extension." \ |
| 1853 | -s "Enable use of CID extension." \ |
| 1854 | -c "client hello, adding CID extension" \ |
| 1855 | -s "found CID extension" \ |
| 1856 | -s "Use of CID extension negotiated" \ |
| 1857 | -s "server hello, adding CID extension" \ |
| 1858 | -c "found CID extension" \ |
| 1859 | -c "Use of CID extension negotiated" \ |
| 1860 | -s "Copy CIDs into SSL transform" \ |
| 1861 | -c "Copy CIDs into SSL transform" \ |
| 1862 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1863 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1864 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1865 | -c "Use of Connection ID has been negotiated" \ |
| 1866 | -c "ignoring unexpected CID" \ |
| 1867 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1868 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1869 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1870 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1871 | -p "$P_PXY mtu=800" \ |
| 1872 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1873 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1874 | 0 \ |
| 1875 | -c "Enable use of CID extension." \ |
| 1876 | -s "Enable use of CID extension." \ |
| 1877 | -c "client hello, adding CID extension" \ |
| 1878 | -s "found CID extension" \ |
| 1879 | -s "Use of CID extension negotiated" \ |
| 1880 | -s "server hello, adding CID extension" \ |
| 1881 | -c "found CID extension" \ |
| 1882 | -c "Use of CID extension negotiated" \ |
| 1883 | -s "Copy CIDs into SSL transform" \ |
| 1884 | -c "Copy CIDs into SSL transform" \ |
| 1885 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1886 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1887 | -s "Use of Connection ID has been negotiated" \ |
| 1888 | -c "Use of Connection ID has been negotiated" |
| 1889 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1890 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1891 | 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] | 1892 | -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] | 1893 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1894 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1895 | 0 \ |
| 1896 | -c "Enable use of CID extension." \ |
| 1897 | -s "Enable use of CID extension." \ |
| 1898 | -c "client hello, adding CID extension" \ |
| 1899 | -s "found CID extension" \ |
| 1900 | -s "Use of CID extension negotiated" \ |
| 1901 | -s "server hello, adding CID extension" \ |
| 1902 | -c "found CID extension" \ |
| 1903 | -c "Use of CID extension negotiated" \ |
| 1904 | -s "Copy CIDs into SSL transform" \ |
| 1905 | -c "Copy CIDs into SSL transform" \ |
| 1906 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1907 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1908 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1909 | -c "Use of Connection ID has been negotiated" \ |
| 1910 | -c "ignoring unexpected CID" \ |
| 1911 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1912 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1913 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1914 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1915 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1916 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1917 | 0 \ |
| 1918 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1919 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1920 | -c "client hello, adding CID extension" \ |
| 1921 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1922 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1923 | -s "server hello, adding CID extension" \ |
| 1924 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1925 | -c "Use of CID extension negotiated" \ |
| 1926 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1927 | -c "Copy CIDs into SSL transform" \ |
| 1928 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1929 | -s "Peer CID (length 0 Bytes):" \ |
| 1930 | -s "Use of Connection ID has been negotiated" \ |
| 1931 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1932 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1933 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1934 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1935 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1936 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1937 | 0 \ |
| 1938 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1939 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1940 | -c "client hello, adding CID extension" \ |
| 1941 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1942 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1943 | -s "server hello, adding CID extension" \ |
| 1944 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1945 | -c "Use of CID extension negotiated" \ |
| 1946 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1947 | -c "Copy CIDs into SSL transform" \ |
| 1948 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1949 | -c "Peer CID (length 0 Bytes):" \ |
| 1950 | -s "Use of Connection ID has been negotiated" \ |
| 1951 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1952 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1953 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1954 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1955 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1956 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1957 | 0 \ |
| 1958 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1959 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1960 | -c "client hello, adding CID extension" \ |
| 1961 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1962 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1963 | -s "server hello, adding CID extension" \ |
| 1964 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1965 | -c "Use of CID extension negotiated" \ |
| 1966 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1967 | -c "Copy CIDs into SSL transform" \ |
| 1968 | -S "Use of Connection ID has been negotiated" \ |
| 1969 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1970 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1971 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1972 | 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] | 1973 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1974 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1975 | 0 \ |
| 1976 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1977 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1978 | -c "client hello, adding CID extension" \ |
| 1979 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1980 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1981 | -s "server hello, adding CID extension" \ |
| 1982 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1983 | -c "Use of CID extension negotiated" \ |
| 1984 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1985 | -c "Copy CIDs into SSL transform" \ |
| 1986 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1987 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1988 | -s "Use of Connection ID has been negotiated" \ |
| 1989 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1990 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1991 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1992 | 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] | 1993 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1994 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1995 | 0 \ |
| 1996 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1997 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1998 | -c "client hello, adding CID extension" \ |
| 1999 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2000 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2001 | -s "server hello, adding CID extension" \ |
| 2002 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2003 | -c "Use of CID extension negotiated" \ |
| 2004 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2005 | -c "Copy CIDs into SSL transform" \ |
| 2006 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2007 | -s "Peer CID (length 0 Bytes):" \ |
| 2008 | -s "Use of Connection ID has been negotiated" \ |
| 2009 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2010 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2011 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2012 | 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] | 2013 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2014 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2015 | 0 \ |
| 2016 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2017 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2018 | -c "client hello, adding CID extension" \ |
| 2019 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2020 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2021 | -s "server hello, adding CID extension" \ |
| 2022 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2023 | -c "Use of CID extension negotiated" \ |
| 2024 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2025 | -c "Copy CIDs into SSL transform" \ |
| 2026 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2027 | -c "Peer CID (length 0 Bytes):" \ |
| 2028 | -s "Use of Connection ID has been negotiated" \ |
| 2029 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2030 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2031 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2032 | 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] | 2033 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2034 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2035 | 0 \ |
| 2036 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2037 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2038 | -c "client hello, adding CID extension" \ |
| 2039 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2040 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2041 | -s "server hello, adding CID extension" \ |
| 2042 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2043 | -c "Use of CID extension negotiated" \ |
| 2044 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2045 | -c "Copy CIDs into SSL transform" \ |
| 2046 | -S "Use of Connection ID has been negotiated" \ |
| 2047 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2048 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2049 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2050 | 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] | 2051 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2052 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2053 | 0 \ |
| 2054 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2055 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2056 | -c "client hello, adding CID extension" \ |
| 2057 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2058 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2059 | -s "server hello, adding CID extension" \ |
| 2060 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2061 | -c "Use of CID extension negotiated" \ |
| 2062 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2063 | -c "Copy CIDs into SSL transform" \ |
| 2064 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2065 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2066 | -s "Use of Connection ID has been negotiated" \ |
| 2067 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2068 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2069 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2070 | 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] | 2071 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2072 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2073 | 0 \ |
| 2074 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2075 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2076 | -c "client hello, adding CID extension" \ |
| 2077 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2078 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2079 | -s "server hello, adding CID extension" \ |
| 2080 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2081 | -c "Use of CID extension negotiated" \ |
| 2082 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2083 | -c "Copy CIDs into SSL transform" \ |
| 2084 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2085 | -s "Peer CID (length 0 Bytes):" \ |
| 2086 | -s "Use of Connection ID has been negotiated" \ |
| 2087 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2088 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2089 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2090 | 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] | 2091 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2092 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2093 | 0 \ |
| 2094 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2095 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2096 | -c "client hello, adding CID extension" \ |
| 2097 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2098 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2099 | -s "server hello, adding CID extension" \ |
| 2100 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2101 | -c "Use of CID extension negotiated" \ |
| 2102 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2103 | -c "Copy CIDs into SSL transform" \ |
| 2104 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2105 | -c "Peer CID (length 0 Bytes):" \ |
| 2106 | -s "Use of Connection ID has been negotiated" \ |
| 2107 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2108 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2109 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2110 | 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] | 2111 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2112 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2113 | 0 \ |
| 2114 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2115 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2116 | -c "client hello, adding CID extension" \ |
| 2117 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2118 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2119 | -s "server hello, adding CID extension" \ |
| 2120 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2121 | -c "Use of CID extension negotiated" \ |
| 2122 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2123 | -c "Copy CIDs into SSL transform" \ |
| 2124 | -S "Use of Connection ID has been negotiated" \ |
| 2125 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2126 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2127 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2128 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2129 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2130 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2131 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2132 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2133 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2134 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2135 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2136 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2137 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2138 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2139 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2140 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2141 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2142 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +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 with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2145 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2146 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2147 | 0 \ |
| 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): be ef" \ |
| 2153 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2159 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2160 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2161 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2173 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2174 | 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] | 2175 | -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] | 2176 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2177 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2178 | 0 \ |
| 2179 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2180 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2181 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2182 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2183 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2184 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2185 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2186 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2187 | -c "ignoring unexpected CID" \ |
| 2188 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2189 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2190 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2191 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2192 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2193 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2194 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2195 | 0 \ |
| 2196 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2197 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2198 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2199 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2200 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2201 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2202 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2203 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2204 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2205 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2206 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2207 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2208 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2209 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2221 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2222 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2223 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2224 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2225 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2226 | 0 \ |
| 2227 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2228 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2229 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2230 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2231 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2232 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2233 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2234 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2235 | -c "ignoring unexpected CID" \ |
| 2236 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2237 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2238 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2240 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2241 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2242 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2243 | 0 \ |
| 2244 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2245 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2246 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2247 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2248 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2249 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2250 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2251 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2253 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2254 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2255 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2256 | 0 \ |
| 2257 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2258 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2259 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2260 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2261 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2262 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2263 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2264 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2265 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2266 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2267 | -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] | 2268 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2269 | "$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" \ |
| 2270 | 0 \ |
| 2271 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2272 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2273 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2274 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2275 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2276 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2277 | -c "ignoring unexpected CID" \ |
| 2278 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2279 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2280 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2281 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2282 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2283 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2284 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2285 | 0 \ |
| 2286 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2287 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2288 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2289 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2290 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2291 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2292 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2293 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2294 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2295 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2297 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2298 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2299 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2300 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2301 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2302 | 0 \ |
| 2303 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2304 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2305 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2306 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2307 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2308 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2309 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2310 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2311 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2312 | -c "ignoring unexpected CID" \ |
| 2313 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2314 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2315 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2316 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2317 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2318 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2319 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2320 | 0 \ |
| 2321 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2322 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2323 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2324 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2325 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2326 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2327 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2328 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2329 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2330 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2331 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2332 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2333 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2334 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2335 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2336 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2337 | 0 \ |
| 2338 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2339 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2340 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2341 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2342 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2343 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2344 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2345 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2346 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2347 | -c "ignoring unexpected CID" \ |
| 2348 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2349 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2350 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2351 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2352 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2353 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2354 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2355 | 0 \ |
| 2356 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2357 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2358 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2359 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2360 | -s "Reallocating in_buf" \ |
| 2361 | -s "Reallocating out_buf" |
| 2362 | |
| 2363 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2364 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2365 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2366 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2367 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2368 | 0 \ |
| 2369 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2370 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2371 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2372 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2373 | -s "Reallocating in_buf" \ |
| 2374 | -s "Reallocating out_buf" |
| 2375 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2376 | # Tests for Encrypt-then-MAC extension |
| 2377 | |
| 2378 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2379 | "$P_SRV debug_level=3 \ |
| 2380 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2381 | "$P_CLI debug_level=3" \ |
| 2382 | 0 \ |
| 2383 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2384 | -s "found encrypt then mac extension" \ |
| 2385 | -s "server hello, adding encrypt then mac extension" \ |
| 2386 | -c "found encrypt_then_mac extension" \ |
| 2387 | -c "using encrypt then mac" \ |
| 2388 | -s "using encrypt then mac" |
| 2389 | |
| 2390 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2391 | "$P_SRV debug_level=3 etm=0 \ |
| 2392 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2393 | "$P_CLI debug_level=3 etm=1" \ |
| 2394 | 0 \ |
| 2395 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2396 | -s "found encrypt then mac extension" \ |
| 2397 | -S "server hello, adding encrypt then mac extension" \ |
| 2398 | -C "found encrypt_then_mac extension" \ |
| 2399 | -C "using encrypt then mac" \ |
| 2400 | -S "using encrypt then mac" |
| 2401 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2402 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2403 | "$P_SRV debug_level=3 etm=1 \ |
| 2404 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2405 | "$P_CLI debug_level=3 etm=1" \ |
| 2406 | 0 \ |
| 2407 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2408 | -s "found encrypt then mac extension" \ |
| 2409 | -S "server hello, adding encrypt then mac extension" \ |
| 2410 | -C "found encrypt_then_mac extension" \ |
| 2411 | -C "using encrypt then mac" \ |
| 2412 | -S "using encrypt then mac" |
| 2413 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2414 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2415 | "$P_SRV debug_level=3 etm=1 \ |
| 2416 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2417 | "$P_CLI debug_level=3 etm=0" \ |
| 2418 | 0 \ |
| 2419 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2420 | -S "found encrypt then mac extension" \ |
| 2421 | -S "server hello, adding encrypt then mac extension" \ |
| 2422 | -C "found encrypt_then_mac extension" \ |
| 2423 | -C "using encrypt then mac" \ |
| 2424 | -S "using encrypt then mac" |
| 2425 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2426 | # Tests for Extended Master Secret extension |
| 2427 | |
| 2428 | run_test "Extended Master Secret: default" \ |
| 2429 | "$P_SRV debug_level=3" \ |
| 2430 | "$P_CLI debug_level=3" \ |
| 2431 | 0 \ |
| 2432 | -c "client hello, adding extended_master_secret extension" \ |
| 2433 | -s "found extended master secret extension" \ |
| 2434 | -s "server hello, adding extended master secret extension" \ |
| 2435 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2436 | -c "session hash for extended master secret" \ |
| 2437 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2438 | |
| 2439 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2440 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2441 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2442 | 0 \ |
| 2443 | -c "client hello, adding extended_master_secret extension" \ |
| 2444 | -s "found extended master secret extension" \ |
| 2445 | -S "server hello, adding extended master secret extension" \ |
| 2446 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2447 | -C "session hash for extended master secret" \ |
| 2448 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2449 | |
| 2450 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2451 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2452 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2453 | 0 \ |
| 2454 | -C "client hello, adding extended_master_secret extension" \ |
| 2455 | -S "found extended master secret extension" \ |
| 2456 | -S "server hello, adding extended master secret extension" \ |
| 2457 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2458 | -C "session hash for extended master secret" \ |
| 2459 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2460 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2461 | # Tests for FALLBACK_SCSV |
| 2462 | |
| 2463 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2464 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2465 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2466 | 0 \ |
| 2467 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2468 | -S "received FALLBACK_SCSV" \ |
| 2469 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2470 | -C "is a fatal alert message (msg 86)" |
| 2471 | |
| 2472 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2473 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2474 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2475 | 0 \ |
| 2476 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2477 | -S "received FALLBACK_SCSV" \ |
| 2478 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2479 | -C "is a fatal alert message (msg 86)" |
| 2480 | |
| 2481 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2482 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2483 | "$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] | 2484 | 1 \ |
| 2485 | -c "adding FALLBACK_SCSV" \ |
| 2486 | -s "received FALLBACK_SCSV" \ |
| 2487 | -s "inapropriate fallback" \ |
| 2488 | -c "is a fatal alert message (msg 86)" |
| 2489 | |
| 2490 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2491 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2492 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2493 | 0 \ |
| 2494 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2495 | -s "received FALLBACK_SCSV" \ |
| 2496 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2497 | -C "is a fatal alert message (msg 86)" |
| 2498 | |
| 2499 | requires_openssl_with_fallback_scsv |
| 2500 | run_test "Fallback SCSV: default, openssl server" \ |
| 2501 | "$O_SRV" \ |
| 2502 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2503 | 0 \ |
| 2504 | -C "adding FALLBACK_SCSV" \ |
| 2505 | -C "is a fatal alert message (msg 86)" |
| 2506 | |
| 2507 | requires_openssl_with_fallback_scsv |
| 2508 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2509 | "$O_SRV" \ |
| 2510 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2511 | 1 \ |
| 2512 | -c "adding FALLBACK_SCSV" \ |
| 2513 | -c "is a fatal alert message (msg 86)" |
| 2514 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2515 | requires_openssl_with_fallback_scsv |
| 2516 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2517 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2518 | "$O_CLI -tls1_1" \ |
| 2519 | 0 \ |
| 2520 | -S "received FALLBACK_SCSV" \ |
| 2521 | -S "inapropriate fallback" |
| 2522 | |
| 2523 | requires_openssl_with_fallback_scsv |
| 2524 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2525 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2526 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2527 | 1 \ |
| 2528 | -s "received FALLBACK_SCSV" \ |
| 2529 | -s "inapropriate fallback" |
| 2530 | |
| 2531 | requires_openssl_with_fallback_scsv |
| 2532 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2533 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2534 | "$O_CLI -fallback_scsv" \ |
| 2535 | 0 \ |
| 2536 | -s "received FALLBACK_SCSV" \ |
| 2537 | -S "inapropriate fallback" |
| 2538 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2539 | # Test sending and receiving empty application data records |
| 2540 | |
| 2541 | run_test "Encrypt then MAC: empty application data record" \ |
| 2542 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2543 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2544 | 0 \ |
| 2545 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2546 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2547 | -c "0 bytes written in 1 fragments" |
| 2548 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2549 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2550 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2551 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2552 | 0 \ |
| 2553 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2554 | -c "0 bytes written in 1 fragments" |
| 2555 | |
| 2556 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2557 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2558 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 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, DTLS: 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 dtls=1" \ |
| 2566 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2567 | 0 \ |
| 2568 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2569 | -c "0 bytes written in 1 fragments" |
| 2570 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2571 | ## ClientHello generated with |
| 2572 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2573 | ## then manually twiddling the ciphersuite list. |
| 2574 | ## The ClientHello content is spelled out below as a hex string as |
| 2575 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2576 | ## The expected response is an inappropriate_fallback alert. |
| 2577 | requires_openssl_with_fallback_scsv |
| 2578 | run_test "Fallback SCSV: beginning of list" \ |
| 2579 | "$P_SRV debug_level=2" \ |
| 2580 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2581 | 0 \ |
| 2582 | -s "received FALLBACK_SCSV" \ |
| 2583 | -s "inapropriate fallback" |
| 2584 | |
| 2585 | requires_openssl_with_fallback_scsv |
| 2586 | run_test "Fallback SCSV: end of list" \ |
| 2587 | "$P_SRV debug_level=2" \ |
| 2588 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2589 | 0 \ |
| 2590 | -s "received FALLBACK_SCSV" \ |
| 2591 | -s "inapropriate fallback" |
| 2592 | |
| 2593 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2594 | requires_openssl_with_fallback_scsv |
| 2595 | run_test "Fallback SCSV: not in list" \ |
| 2596 | "$P_SRV debug_level=2" \ |
| 2597 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2598 | 0 \ |
| 2599 | -S "received FALLBACK_SCSV" \ |
| 2600 | -S "inapropriate fallback" |
| 2601 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2602 | # Tests for CBC 1/n-1 record splitting |
| 2603 | |
| 2604 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2605 | "$P_SRV" \ |
| 2606 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2607 | request_size=123 force_version=tls1_2" \ |
| 2608 | 0 \ |
| 2609 | -s "Read from client: 123 bytes read" \ |
| 2610 | -S "Read from client: 1 bytes read" \ |
| 2611 | -S "122 bytes read" |
| 2612 | |
| 2613 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2614 | "$P_SRV" \ |
| 2615 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2616 | request_size=123 force_version=tls1_1" \ |
| 2617 | 0 \ |
| 2618 | -s "Read from client: 123 bytes read" \ |
| 2619 | -S "Read from client: 1 bytes read" \ |
| 2620 | -S "122 bytes read" |
| 2621 | |
| 2622 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2623 | "$P_SRV" \ |
| 2624 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2625 | request_size=123 force_version=tls1" \ |
| 2626 | 0 \ |
| 2627 | -S "Read from client: 123 bytes read" \ |
| 2628 | -s "Read from client: 1 bytes read" \ |
| 2629 | -s "122 bytes read" |
| 2630 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2631 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2632 | "$P_SRV" \ |
| 2633 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2634 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2635 | 0 \ |
| 2636 | -s "Read from client: 123 bytes read" \ |
| 2637 | -S "Read from client: 1 bytes read" \ |
| 2638 | -S "122 bytes read" |
| 2639 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2640 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2641 | "$P_SRV nbio=2" \ |
| 2642 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2643 | request_size=123 force_version=tls1" \ |
| 2644 | 0 \ |
| 2645 | -S "Read from client: 123 bytes read" \ |
| 2646 | -s "Read from client: 1 bytes read" \ |
| 2647 | -s "122 bytes read" |
| 2648 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2649 | # Tests for Session Tickets |
| 2650 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2651 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2652 | "$P_SRV debug_level=3 tickets=1" \ |
| 2653 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2654 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2655 | -c "client hello, adding session ticket extension" \ |
| 2656 | -s "found session ticket extension" \ |
| 2657 | -s "server hello, adding session ticket extension" \ |
| 2658 | -c "found session_ticket extension" \ |
| 2659 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2660 | -S "session successfully restored from cache" \ |
| 2661 | -s "session successfully restored from ticket" \ |
| 2662 | -s "a session has been resumed" \ |
| 2663 | -c "a session has been resumed" |
| 2664 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2665 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2666 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2667 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2668 | 0 \ |
| 2669 | -c "client hello, adding session ticket extension" \ |
| 2670 | -s "found session ticket extension" \ |
| 2671 | -s "server hello, adding session ticket extension" \ |
| 2672 | -c "found session_ticket extension" \ |
| 2673 | -c "parse new session ticket" \ |
| 2674 | -S "session successfully restored from cache" \ |
| 2675 | -s "session successfully restored from ticket" \ |
| 2676 | -s "a session has been resumed" \ |
| 2677 | -c "a session has been resumed" |
| 2678 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2679 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2680 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2681 | "$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] | 2682 | 0 \ |
| 2683 | -c "client hello, adding session ticket extension" \ |
| 2684 | -s "found session ticket extension" \ |
| 2685 | -s "server hello, adding session ticket extension" \ |
| 2686 | -c "found session_ticket extension" \ |
| 2687 | -c "parse new session ticket" \ |
| 2688 | -S "session successfully restored from cache" \ |
| 2689 | -S "session successfully restored from ticket" \ |
| 2690 | -S "a session has been resumed" \ |
| 2691 | -C "a session has been resumed" |
| 2692 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2693 | run_test "Session resume using tickets: session copy" \ |
| 2694 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2695 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2696 | 0 \ |
| 2697 | -c "client hello, adding session ticket extension" \ |
| 2698 | -s "found session ticket extension" \ |
| 2699 | -s "server hello, adding session ticket extension" \ |
| 2700 | -c "found session_ticket extension" \ |
| 2701 | -c "parse new session ticket" \ |
| 2702 | -S "session successfully restored from cache" \ |
| 2703 | -s "session successfully restored from ticket" \ |
| 2704 | -s "a session has been resumed" \ |
| 2705 | -c "a session has been resumed" |
| 2706 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2707 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2708 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2709 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2710 | 0 \ |
| 2711 | -c "client hello, adding session ticket extension" \ |
| 2712 | -c "found session_ticket extension" \ |
| 2713 | -c "parse new session ticket" \ |
| 2714 | -c "a session has been resumed" |
| 2715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2716 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2717 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2718 | "( $O_CLI -sess_out $SESSION; \ |
| 2719 | $O_CLI -sess_in $SESSION; \ |
| 2720 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2721 | 0 \ |
| 2722 | -s "found session ticket extension" \ |
| 2723 | -s "server hello, adding session ticket extension" \ |
| 2724 | -S "session successfully restored from cache" \ |
| 2725 | -s "session successfully restored from ticket" \ |
| 2726 | -s "a session has been resumed" |
| 2727 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2728 | # Tests for Session Tickets with DTLS |
| 2729 | |
| 2730 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2731 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2732 | "$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] | 2733 | 0 \ |
| 2734 | -c "client hello, adding session ticket extension" \ |
| 2735 | -s "found session ticket extension" \ |
| 2736 | -s "server hello, adding session ticket extension" \ |
| 2737 | -c "found session_ticket extension" \ |
| 2738 | -c "parse new session ticket" \ |
| 2739 | -S "session successfully restored from cache" \ |
| 2740 | -s "session successfully restored from ticket" \ |
| 2741 | -s "a session has been resumed" \ |
| 2742 | -c "a session has been resumed" |
| 2743 | |
| 2744 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2745 | "$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] | 2746 | "$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] | 2747 | 0 \ |
| 2748 | -c "client hello, adding session ticket extension" \ |
| 2749 | -s "found session ticket extension" \ |
| 2750 | -s "server hello, adding session ticket extension" \ |
| 2751 | -c "found session_ticket extension" \ |
| 2752 | -c "parse new session ticket" \ |
| 2753 | -S "session successfully restored from cache" \ |
| 2754 | -s "session successfully restored from ticket" \ |
| 2755 | -s "a session has been resumed" \ |
| 2756 | -c "a session has been resumed" |
| 2757 | |
| 2758 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2759 | "$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] | 2760 | "$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] | 2761 | 0 \ |
| 2762 | -c "client hello, adding session ticket extension" \ |
| 2763 | -s "found session ticket extension" \ |
| 2764 | -s "server hello, adding session ticket extension" \ |
| 2765 | -c "found session_ticket extension" \ |
| 2766 | -c "parse new session ticket" \ |
| 2767 | -S "session successfully restored from cache" \ |
| 2768 | -S "session successfully restored from ticket" \ |
| 2769 | -S "a session has been resumed" \ |
| 2770 | -C "a session has been resumed" |
| 2771 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2772 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2773 | "$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] | 2774 | "$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] | 2775 | 0 \ |
| 2776 | -c "client hello, adding session ticket extension" \ |
| 2777 | -s "found session ticket extension" \ |
| 2778 | -s "server hello, adding session ticket extension" \ |
| 2779 | -c "found session_ticket extension" \ |
| 2780 | -c "parse new session ticket" \ |
| 2781 | -S "session successfully restored from cache" \ |
| 2782 | -s "session successfully restored from ticket" \ |
| 2783 | -s "a session has been resumed" \ |
| 2784 | -c "a session has been resumed" |
| 2785 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2786 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2787 | "$O_SRV -dtls1" \ |
| 2788 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2789 | 0 \ |
| 2790 | -c "client hello, adding session ticket extension" \ |
| 2791 | -c "found session_ticket extension" \ |
| 2792 | -c "parse new session ticket" \ |
| 2793 | -c "a session has been resumed" |
| 2794 | |
| 2795 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2796 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2797 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2798 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2799 | rm -f $SESSION )" \ |
| 2800 | 0 \ |
| 2801 | -s "found session ticket extension" \ |
| 2802 | -s "server hello, adding session ticket extension" \ |
| 2803 | -S "session successfully restored from cache" \ |
| 2804 | -s "session successfully restored from ticket" \ |
| 2805 | -s "a session has been resumed" |
| 2806 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2807 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2808 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2809 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2810 | "$P_SRV debug_level=3 tickets=0" \ |
| 2811 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2812 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2813 | -c "client hello, adding session ticket extension" \ |
| 2814 | -s "found session ticket extension" \ |
| 2815 | -S "server hello, adding session ticket extension" \ |
| 2816 | -C "found session_ticket extension" \ |
| 2817 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2818 | -s "session successfully restored from cache" \ |
| 2819 | -S "session successfully restored from ticket" \ |
| 2820 | -s "a session has been resumed" \ |
| 2821 | -c "a session has been resumed" |
| 2822 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2823 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2824 | "$P_SRV debug_level=3 tickets=1" \ |
| 2825 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2826 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2827 | -C "client hello, adding session ticket extension" \ |
| 2828 | -S "found session ticket extension" \ |
| 2829 | -S "server hello, adding session ticket extension" \ |
| 2830 | -C "found session_ticket extension" \ |
| 2831 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2832 | -s "session successfully restored from cache" \ |
| 2833 | -S "session successfully restored from ticket" \ |
| 2834 | -s "a session has been resumed" \ |
| 2835 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2836 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2837 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2838 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2839 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2840 | 0 \ |
| 2841 | -S "session successfully restored from cache" \ |
| 2842 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2843 | -S "a session has been resumed" \ |
| 2844 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2845 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2846 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2847 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2848 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2849 | 0 \ |
| 2850 | -s "session successfully restored from cache" \ |
| 2851 | -S "session successfully restored from ticket" \ |
| 2852 | -s "a session has been resumed" \ |
| 2853 | -c "a session has been resumed" |
| 2854 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2855 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2856 | "$P_SRV debug_level=3 tickets=0" \ |
| 2857 | "$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] | 2858 | 0 \ |
| 2859 | -s "session successfully restored from cache" \ |
| 2860 | -S "session successfully restored from ticket" \ |
| 2861 | -s "a session has been resumed" \ |
| 2862 | -c "a session has been resumed" |
| 2863 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2864 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2865 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2866 | "$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] | 2867 | 0 \ |
| 2868 | -S "session successfully restored from cache" \ |
| 2869 | -S "session successfully restored from ticket" \ |
| 2870 | -S "a session has been resumed" \ |
| 2871 | -C "a session has been resumed" |
| 2872 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2873 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2874 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2875 | "$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] | 2876 | 0 \ |
| 2877 | -s "session successfully restored from cache" \ |
| 2878 | -S "session successfully restored from ticket" \ |
| 2879 | -s "a session has been resumed" \ |
| 2880 | -c "a session has been resumed" |
| 2881 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2882 | run_test "Session resume using cache: session copy" \ |
| 2883 | "$P_SRV debug_level=3 tickets=0" \ |
| 2884 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2885 | 0 \ |
| 2886 | -s "session successfully restored from cache" \ |
| 2887 | -S "session successfully restored from ticket" \ |
| 2888 | -s "a session has been resumed" \ |
| 2889 | -c "a session has been resumed" |
| 2890 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2891 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2892 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2893 | "( $O_CLI -sess_out $SESSION; \ |
| 2894 | $O_CLI -sess_in $SESSION; \ |
| 2895 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2896 | 0 \ |
| 2897 | -s "found session ticket extension" \ |
| 2898 | -S "server hello, adding session ticket extension" \ |
| 2899 | -s "session successfully restored from cache" \ |
| 2900 | -S "session successfully restored from ticket" \ |
| 2901 | -s "a session has been resumed" |
| 2902 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2903 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2904 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2905 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2906 | 0 \ |
| 2907 | -C "found session_ticket extension" \ |
| 2908 | -C "parse new session ticket" \ |
| 2909 | -c "a session has been resumed" |
| 2910 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2911 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2912 | |
| 2913 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2914 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2915 | "$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] | 2916 | 0 \ |
| 2917 | -c "client hello, adding session ticket extension" \ |
| 2918 | -s "found session ticket extension" \ |
| 2919 | -S "server hello, adding session ticket extension" \ |
| 2920 | -C "found session_ticket extension" \ |
| 2921 | -C "parse new session ticket" \ |
| 2922 | -s "session successfully restored from cache" \ |
| 2923 | -S "session successfully restored from ticket" \ |
| 2924 | -s "a session has been resumed" \ |
| 2925 | -c "a session has been resumed" |
| 2926 | |
| 2927 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2928 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2929 | "$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] | 2930 | 0 \ |
| 2931 | -C "client hello, adding session ticket extension" \ |
| 2932 | -S "found session ticket extension" \ |
| 2933 | -S "server hello, adding session ticket extension" \ |
| 2934 | -C "found session_ticket extension" \ |
| 2935 | -C "parse new session ticket" \ |
| 2936 | -s "session successfully restored from cache" \ |
| 2937 | -S "session successfully restored from ticket" \ |
| 2938 | -s "a session has been resumed" \ |
| 2939 | -c "a session has been resumed" |
| 2940 | |
| 2941 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2942 | "$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] | 2943 | "$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] | 2944 | 0 \ |
| 2945 | -S "session successfully restored from cache" \ |
| 2946 | -S "session successfully restored from ticket" \ |
| 2947 | -S "a session has been resumed" \ |
| 2948 | -C "a session has been resumed" |
| 2949 | |
| 2950 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2951 | "$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] | 2952 | "$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] | 2953 | 0 \ |
| 2954 | -s "session successfully restored from cache" \ |
| 2955 | -S "session successfully restored from ticket" \ |
| 2956 | -s "a session has been resumed" \ |
| 2957 | -c "a session has been resumed" |
| 2958 | |
| 2959 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2960 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2961 | "$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] | 2962 | 0 \ |
| 2963 | -s "session successfully restored from cache" \ |
| 2964 | -S "session successfully restored from ticket" \ |
| 2965 | -s "a session has been resumed" \ |
| 2966 | -c "a session has been resumed" |
| 2967 | |
| 2968 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2969 | "$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] | 2970 | "$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] | 2971 | 0 \ |
| 2972 | -S "session successfully restored from cache" \ |
| 2973 | -S "session successfully restored from ticket" \ |
| 2974 | -S "a session has been resumed" \ |
| 2975 | -C "a session has been resumed" |
| 2976 | |
| 2977 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2978 | "$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] | 2979 | "$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] | 2980 | 0 \ |
| 2981 | -s "session successfully restored from cache" \ |
| 2982 | -S "session successfully restored from ticket" \ |
| 2983 | -s "a session has been resumed" \ |
| 2984 | -c "a session has been resumed" |
| 2985 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2986 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2987 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2988 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2989 | 0 \ |
| 2990 | -s "session successfully restored from cache" \ |
| 2991 | -S "session successfully restored from ticket" \ |
| 2992 | -s "a session has been resumed" \ |
| 2993 | -c "a session has been resumed" |
| 2994 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2995 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2996 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2997 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2998 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2999 | rm -f $SESSION )" \ |
| 3000 | 0 \ |
| 3001 | -s "found session ticket extension" \ |
| 3002 | -S "server hello, adding session ticket extension" \ |
| 3003 | -s "session successfully restored from cache" \ |
| 3004 | -S "session successfully restored from ticket" \ |
| 3005 | -s "a session has been resumed" |
| 3006 | |
| 3007 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3008 | "$O_SRV -dtls1" \ |
| 3009 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3010 | 0 \ |
| 3011 | -C "found session_ticket extension" \ |
| 3012 | -C "parse new session ticket" \ |
| 3013 | -c "a session has been resumed" |
| 3014 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3015 | # Tests for Max Fragment Length extension |
| 3016 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame^] | 3017 | if [ "$MAX_IN_LEN" -lt "4096" ]; then |
| 3018 | printf '%s defines MBEDTLS_SSL_IN_CONTENT_LEN to be less than 4096. Fragment length tests will fail.\n' "${CONFIG_H}" |
| 3019 | exit 1 |
| 3020 | fi |
| 3021 | |
| 3022 | if [ "$MAX_OUT_LEN" -lt "4096" ]; then |
| 3023 | printf '%s defines MBEDTLS_SSL_OUT_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] | 3024 | exit 1 |
| 3025 | fi |
| 3026 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3027 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3028 | echo "Using non-default maximum content length $MAX_CONTENT_LEN" |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3029 | fi |
| 3030 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3031 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3032 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3033 | "$P_SRV debug_level=3" \ |
| 3034 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3035 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3036 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3037 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3038 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3039 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3040 | -C "client hello, adding max_fragment_length extension" \ |
| 3041 | -S "found max fragment length extension" \ |
| 3042 | -S "server hello, max_fragment_length extension" \ |
| 3043 | -C "found max_fragment_length extension" |
| 3044 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3045 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3046 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3047 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3048 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3049 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3050 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3051 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3052 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3053 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3054 | -C "client hello, adding max_fragment_length extension" \ |
| 3055 | -S "found max fragment length extension" \ |
| 3056 | -S "server hello, max_fragment_length extension" \ |
| 3057 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3058 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3059 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3060 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3061 | |
| 3062 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3063 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3064 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3065 | "$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] | 3066 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3067 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3068 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3069 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3070 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3071 | -C "client hello, adding max_fragment_length extension" \ |
| 3072 | -S "found max fragment length extension" \ |
| 3073 | -S "server hello, max_fragment_length extension" \ |
| 3074 | -C "found max_fragment_length extension" \ |
| 3075 | -c "fragment larger than.*maximum " |
| 3076 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3077 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3078 | # (session fragment length will be 16384 regardless of mbedtls |
| 3079 | # content length configuration.) |
| 3080 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3081 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3082 | run_test "Max fragment length: disabled, larger message" \ |
| 3083 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3084 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3085 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3086 | -C "Maximum input fragment length is 16384" \ |
| 3087 | -C "Maximum output fragment length is 16384" \ |
| 3088 | -S "Maximum input fragment length is 16384" \ |
| 3089 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3090 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3091 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3092 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3093 | |
| 3094 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3095 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 3096 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3097 | "$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] | 3098 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3099 | -C "Maximum input fragment length is 16384" \ |
| 3100 | -C "Maximum output fragment length is 16384" \ |
| 3101 | -S "Maximum input fragment length is 16384" \ |
| 3102 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3103 | -c "fragment larger than.*maximum " |
| 3104 | |
| 3105 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3106 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3107 | "$P_SRV debug_level=3" \ |
| 3108 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3109 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3110 | -c "Maximum input fragment length is 4096" \ |
| 3111 | -c "Maximum output fragment length is 4096" \ |
| 3112 | -s "Maximum input fragment length is 4096" \ |
| 3113 | -s "Maximum output fragment length is 4096" \ |
| 3114 | -c "client hello, adding max_fragment_length extension" \ |
| 3115 | -s "found max fragment length extension" \ |
| 3116 | -s "server hello, max_fragment_length extension" \ |
| 3117 | -c "found max_fragment_length extension" |
| 3118 | |
| 3119 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3120 | run_test "Max fragment length: client 512, server 1024" \ |
| 3121 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3122 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3123 | 0 \ |
| 3124 | -c "Maximum input fragment length is 512" \ |
| 3125 | -c "Maximum output fragment length is 512" \ |
| 3126 | -s "Maximum input fragment length is 512" \ |
| 3127 | -s "Maximum output fragment length is 512" \ |
| 3128 | -c "client hello, adding max_fragment_length extension" \ |
| 3129 | -s "found max fragment length extension" \ |
| 3130 | -s "server hello, max_fragment_length extension" \ |
| 3131 | -c "found max_fragment_length extension" |
| 3132 | |
| 3133 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3134 | run_test "Max fragment length: client 512, server 2048" \ |
| 3135 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3136 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3137 | 0 \ |
| 3138 | -c "Maximum input fragment length is 512" \ |
| 3139 | -c "Maximum output fragment length is 512" \ |
| 3140 | -s "Maximum input fragment length is 512" \ |
| 3141 | -s "Maximum output fragment length is 512" \ |
| 3142 | -c "client hello, adding max_fragment_length extension" \ |
| 3143 | -s "found max fragment length extension" \ |
| 3144 | -s "server hello, max_fragment_length extension" \ |
| 3145 | -c "found max_fragment_length extension" |
| 3146 | |
| 3147 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3148 | run_test "Max fragment length: client 512, server 4096" \ |
| 3149 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3150 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3151 | 0 \ |
| 3152 | -c "Maximum input fragment length is 512" \ |
| 3153 | -c "Maximum output fragment length is 512" \ |
| 3154 | -s "Maximum input fragment length is 512" \ |
| 3155 | -s "Maximum output fragment length is 512" \ |
| 3156 | -c "client hello, adding max_fragment_length extension" \ |
| 3157 | -s "found max fragment length extension" \ |
| 3158 | -s "server hello, max_fragment_length extension" \ |
| 3159 | -c "found max_fragment_length extension" |
| 3160 | |
| 3161 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3162 | run_test "Max fragment length: client 1024, server 512" \ |
| 3163 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3164 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3165 | 0 \ |
| 3166 | -c "Maximum input fragment length is 1024" \ |
| 3167 | -c "Maximum output fragment length is 1024" \ |
| 3168 | -s "Maximum input fragment length is 1024" \ |
| 3169 | -s "Maximum output fragment length is 512" \ |
| 3170 | -c "client hello, adding max_fragment_length extension" \ |
| 3171 | -s "found max fragment length extension" \ |
| 3172 | -s "server hello, max_fragment_length extension" \ |
| 3173 | -c "found max_fragment_length extension" |
| 3174 | |
| 3175 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3176 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3177 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3178 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3179 | 0 \ |
| 3180 | -c "Maximum input fragment length is 1024" \ |
| 3181 | -c "Maximum output fragment length is 1024" \ |
| 3182 | -s "Maximum input fragment length is 1024" \ |
| 3183 | -s "Maximum output fragment length is 1024" \ |
| 3184 | -c "client hello, adding max_fragment_length extension" \ |
| 3185 | -s "found max fragment length extension" \ |
| 3186 | -s "server hello, max_fragment_length extension" \ |
| 3187 | -c "found max_fragment_length extension" |
| 3188 | |
| 3189 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3190 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3191 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3192 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3193 | 0 \ |
| 3194 | -c "Maximum input fragment length is 1024" \ |
| 3195 | -c "Maximum output fragment length is 1024" \ |
| 3196 | -s "Maximum input fragment length is 1024" \ |
| 3197 | -s "Maximum output fragment length is 1024" \ |
| 3198 | -c "client hello, adding max_fragment_length extension" \ |
| 3199 | -s "found max fragment length extension" \ |
| 3200 | -s "server hello, max_fragment_length extension" \ |
| 3201 | -c "found max_fragment_length extension" |
| 3202 | |
| 3203 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3204 | run_test "Max fragment length: client 2048, server 512" \ |
| 3205 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3206 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3207 | 0 \ |
| 3208 | -c "Maximum input fragment length is 2048" \ |
| 3209 | -c "Maximum output fragment length is 2048" \ |
| 3210 | -s "Maximum input fragment length is 2048" \ |
| 3211 | -s "Maximum output fragment length is 512" \ |
| 3212 | -c "client hello, adding max_fragment_length extension" \ |
| 3213 | -s "found max fragment length extension" \ |
| 3214 | -s "server hello, max_fragment_length extension" \ |
| 3215 | -c "found max_fragment_length extension" |
| 3216 | |
| 3217 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3218 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3219 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3220 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3221 | 0 \ |
| 3222 | -c "Maximum input fragment length is 2048" \ |
| 3223 | -c "Maximum output fragment length is 2048" \ |
| 3224 | -s "Maximum input fragment length is 2048" \ |
| 3225 | -s "Maximum output fragment length is 1024" \ |
| 3226 | -c "client hello, adding max_fragment_length extension" \ |
| 3227 | -s "found max fragment length extension" \ |
| 3228 | -s "server hello, max_fragment_length extension" \ |
| 3229 | -c "found max_fragment_length extension" |
| 3230 | |
| 3231 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3232 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3233 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3234 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3235 | 0 \ |
| 3236 | -c "Maximum input fragment length is 2048" \ |
| 3237 | -c "Maximum output fragment length is 2048" \ |
| 3238 | -s "Maximum input fragment length is 2048" \ |
| 3239 | -s "Maximum output fragment length is 2048" \ |
| 3240 | -c "client hello, adding max_fragment_length extension" \ |
| 3241 | -s "found max fragment length extension" \ |
| 3242 | -s "server hello, max_fragment_length extension" \ |
| 3243 | -c "found max_fragment_length extension" |
| 3244 | |
| 3245 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3246 | run_test "Max fragment length: client 4096, server 512" \ |
| 3247 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3248 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3249 | 0 \ |
| 3250 | -c "Maximum input fragment length is 4096" \ |
| 3251 | -c "Maximum output fragment length is 4096" \ |
| 3252 | -s "Maximum input fragment length is 4096" \ |
| 3253 | -s "Maximum output fragment length is 512" \ |
| 3254 | -c "client hello, adding max_fragment_length extension" \ |
| 3255 | -s "found max fragment length extension" \ |
| 3256 | -s "server hello, max_fragment_length extension" \ |
| 3257 | -c "found max_fragment_length extension" |
| 3258 | |
| 3259 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3260 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3261 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3262 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3263 | 0 \ |
| 3264 | -c "Maximum input fragment length is 4096" \ |
| 3265 | -c "Maximum output fragment length is 4096" \ |
| 3266 | -s "Maximum input fragment length is 4096" \ |
| 3267 | -s "Maximum output fragment length is 1024" \ |
| 3268 | -c "client hello, adding max_fragment_length extension" \ |
| 3269 | -s "found max fragment length extension" \ |
| 3270 | -s "server hello, max_fragment_length extension" \ |
| 3271 | -c "found max_fragment_length extension" |
| 3272 | |
| 3273 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3274 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3275 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3276 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3277 | 0 \ |
| 3278 | -c "Maximum input fragment length is 4096" \ |
| 3279 | -c "Maximum output fragment length is 4096" \ |
| 3280 | -s "Maximum input fragment length is 4096" \ |
| 3281 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3282 | -c "client hello, adding max_fragment_length extension" \ |
| 3283 | -s "found max fragment length extension" \ |
| 3284 | -s "server hello, max_fragment_length extension" \ |
| 3285 | -c "found max_fragment_length extension" |
| 3286 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3287 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3288 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3289 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3290 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3291 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3292 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3293 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3294 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3295 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3296 | -C "client hello, adding max_fragment_length extension" \ |
| 3297 | -S "found max fragment length extension" \ |
| 3298 | -S "server hello, max_fragment_length extension" \ |
| 3299 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3300 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3301 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3302 | requires_gnutls |
| 3303 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3304 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3305 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3306 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3307 | -c "Maximum input fragment length is 4096" \ |
| 3308 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3309 | -c "client hello, adding max_fragment_length extension" \ |
| 3310 | -c "found max_fragment_length extension" |
| 3311 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3312 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3313 | run_test "Max fragment length: client, message just fits" \ |
| 3314 | "$P_SRV debug_level=3" \ |
| 3315 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3316 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3317 | -c "Maximum input fragment length is 2048" \ |
| 3318 | -c "Maximum output fragment length is 2048" \ |
| 3319 | -s "Maximum input fragment length is 2048" \ |
| 3320 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3321 | -c "client hello, adding max_fragment_length extension" \ |
| 3322 | -s "found max fragment length extension" \ |
| 3323 | -s "server hello, max_fragment_length extension" \ |
| 3324 | -c "found max_fragment_length extension" \ |
| 3325 | -c "2048 bytes written in 1 fragments" \ |
| 3326 | -s "2048 bytes read" |
| 3327 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3328 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3329 | run_test "Max fragment length: client, larger message" \ |
| 3330 | "$P_SRV debug_level=3" \ |
| 3331 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3332 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3333 | -c "Maximum input fragment length is 2048" \ |
| 3334 | -c "Maximum output fragment length is 2048" \ |
| 3335 | -s "Maximum input fragment length is 2048" \ |
| 3336 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3337 | -c "client hello, adding max_fragment_length extension" \ |
| 3338 | -s "found max fragment length extension" \ |
| 3339 | -s "server hello, max_fragment_length extension" \ |
| 3340 | -c "found max_fragment_length extension" \ |
| 3341 | -c "2345 bytes written in 2 fragments" \ |
| 3342 | -s "2048 bytes read" \ |
| 3343 | -s "297 bytes read" |
| 3344 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3345 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3346 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3347 | "$P_SRV debug_level=3 dtls=1" \ |
| 3348 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3349 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3350 | -c "Maximum input fragment length is 2048" \ |
| 3351 | -c "Maximum output fragment length is 2048" \ |
| 3352 | -s "Maximum input fragment length is 2048" \ |
| 3353 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3354 | -c "client hello, adding max_fragment_length extension" \ |
| 3355 | -s "found max fragment length extension" \ |
| 3356 | -s "server hello, max_fragment_length extension" \ |
| 3357 | -c "found max_fragment_length extension" \ |
| 3358 | -c "fragment larger than.*maximum" |
| 3359 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3360 | # Tests for renegotiation |
| 3361 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3362 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3363 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3364 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3365 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3366 | 0 \ |
| 3367 | -C "client hello, adding renegotiation extension" \ |
| 3368 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3369 | -S "found renegotiation extension" \ |
| 3370 | -s "server hello, secure renegotiation extension" \ |
| 3371 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3372 | -C "=> renegotiate" \ |
| 3373 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3374 | -S "write hello request" |
| 3375 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3376 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3377 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3378 | "$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] | 3379 | "$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] | 3380 | 0 \ |
| 3381 | -c "client hello, adding renegotiation extension" \ |
| 3382 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3383 | -s "found renegotiation extension" \ |
| 3384 | -s "server hello, secure renegotiation extension" \ |
| 3385 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3386 | -c "=> renegotiate" \ |
| 3387 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3388 | -S "write hello request" |
| 3389 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3390 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3391 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3392 | "$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] | 3393 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3394 | 0 \ |
| 3395 | -c "client hello, adding renegotiation extension" \ |
| 3396 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3397 | -s "found renegotiation extension" \ |
| 3398 | -s "server hello, secure renegotiation extension" \ |
| 3399 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3400 | -c "=> renegotiate" \ |
| 3401 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3402 | -s "write hello request" |
| 3403 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3404 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3405 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3406 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3407 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3408 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3409 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3410 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3411 | 0 \ |
| 3412 | -c "client hello, adding renegotiation extension" \ |
| 3413 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3414 | -s "found renegotiation extension" \ |
| 3415 | -s "server hello, secure renegotiation extension" \ |
| 3416 | -c "found renegotiation extension" \ |
| 3417 | -c "=> renegotiate" \ |
| 3418 | -s "=> renegotiate" \ |
| 3419 | -S "write hello request" \ |
| 3420 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3421 | |
| 3422 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3423 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3424 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3425 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3426 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3427 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3428 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3429 | 0 \ |
| 3430 | -c "client hello, adding renegotiation extension" \ |
| 3431 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3432 | -s "found renegotiation extension" \ |
| 3433 | -s "server hello, secure renegotiation extension" \ |
| 3434 | -c "found renegotiation extension" \ |
| 3435 | -c "=> renegotiate" \ |
| 3436 | -s "=> renegotiate" \ |
| 3437 | -s "write hello request" \ |
| 3438 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3439 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3440 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3441 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3442 | "$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] | 3443 | "$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] | 3444 | 0 \ |
| 3445 | -c "client hello, adding renegotiation extension" \ |
| 3446 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3447 | -s "found renegotiation extension" \ |
| 3448 | -s "server hello, secure renegotiation extension" \ |
| 3449 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3450 | -c "=> renegotiate" \ |
| 3451 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3452 | -s "write hello request" |
| 3453 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3454 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3455 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3456 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3457 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3458 | "$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" \ |
| 3459 | 0 \ |
| 3460 | -c "Maximum input fragment length is 2048" \ |
| 3461 | -c "Maximum output fragment length is 2048" \ |
| 3462 | -s "Maximum input fragment length is 2048" \ |
| 3463 | -s "Maximum output fragment length is 512" \ |
| 3464 | -c "client hello, adding max_fragment_length extension" \ |
| 3465 | -s "found max fragment length extension" \ |
| 3466 | -s "server hello, max_fragment_length extension" \ |
| 3467 | -c "found max_fragment_length extension" \ |
| 3468 | -c "client hello, adding renegotiation extension" \ |
| 3469 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3470 | -s "found renegotiation extension" \ |
| 3471 | -s "server hello, secure renegotiation extension" \ |
| 3472 | -c "found renegotiation extension" \ |
| 3473 | -c "=> renegotiate" \ |
| 3474 | -s "=> renegotiate" \ |
| 3475 | -s "write hello request" |
| 3476 | |
| 3477 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3478 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3479 | "$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] | 3480 | "$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] | 3481 | 1 \ |
| 3482 | -c "client hello, adding renegotiation extension" \ |
| 3483 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3484 | -S "found renegotiation extension" \ |
| 3485 | -s "server hello, secure renegotiation extension" \ |
| 3486 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3487 | -c "=> renegotiate" \ |
| 3488 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3489 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3490 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3491 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3492 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3493 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3494 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3495 | "$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] | 3496 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3497 | 0 \ |
| 3498 | -C "client hello, adding renegotiation extension" \ |
| 3499 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3500 | -S "found renegotiation extension" \ |
| 3501 | -s "server hello, secure renegotiation extension" \ |
| 3502 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3503 | -C "=> renegotiate" \ |
| 3504 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3505 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3506 | -S "SSL - An unexpected message was received from our peer" \ |
| 3507 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3508 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3509 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3510 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3511 | "$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] | 3512 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3513 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3514 | 0 \ |
| 3515 | -C "client hello, adding renegotiation extension" \ |
| 3516 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3517 | -S "found renegotiation extension" \ |
| 3518 | -s "server hello, secure renegotiation extension" \ |
| 3519 | -c "found renegotiation extension" \ |
| 3520 | -C "=> renegotiate" \ |
| 3521 | -S "=> renegotiate" \ |
| 3522 | -s "write hello request" \ |
| 3523 | -S "SSL - An unexpected message was received from our peer" \ |
| 3524 | -S "failed" |
| 3525 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3526 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3527 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3528 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3529 | "$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] | 3530 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3531 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3532 | 0 \ |
| 3533 | -C "client hello, adding renegotiation extension" \ |
| 3534 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3535 | -S "found renegotiation extension" \ |
| 3536 | -s "server hello, secure renegotiation extension" \ |
| 3537 | -c "found renegotiation extension" \ |
| 3538 | -C "=> renegotiate" \ |
| 3539 | -S "=> renegotiate" \ |
| 3540 | -s "write hello request" \ |
| 3541 | -S "SSL - An unexpected message was received from our peer" \ |
| 3542 | -S "failed" |
| 3543 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3544 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3545 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3546 | "$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] | 3547 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3548 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3549 | 0 \ |
| 3550 | -C "client hello, adding renegotiation extension" \ |
| 3551 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3552 | -S "found renegotiation extension" \ |
| 3553 | -s "server hello, secure renegotiation extension" \ |
| 3554 | -c "found renegotiation extension" \ |
| 3555 | -C "=> renegotiate" \ |
| 3556 | -S "=> renegotiate" \ |
| 3557 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3558 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3559 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3560 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3561 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3562 | "$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] | 3563 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3564 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3565 | 0 \ |
| 3566 | -c "client hello, adding renegotiation extension" \ |
| 3567 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3568 | -s "found renegotiation extension" \ |
| 3569 | -s "server hello, secure renegotiation extension" \ |
| 3570 | -c "found renegotiation extension" \ |
| 3571 | -c "=> renegotiate" \ |
| 3572 | -s "=> renegotiate" \ |
| 3573 | -s "write hello request" \ |
| 3574 | -S "SSL - An unexpected message was received from our peer" \ |
| 3575 | -S "failed" |
| 3576 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3577 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3578 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3579 | "$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] | 3580 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3581 | 0 \ |
| 3582 | -C "client hello, adding renegotiation extension" \ |
| 3583 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3584 | -S "found renegotiation extension" \ |
| 3585 | -s "server hello, secure renegotiation extension" \ |
| 3586 | -c "found renegotiation extension" \ |
| 3587 | -S "record counter limit reached: renegotiate" \ |
| 3588 | -C "=> renegotiate" \ |
| 3589 | -S "=> renegotiate" \ |
| 3590 | -S "write hello request" \ |
| 3591 | -S "SSL - An unexpected message was received from our peer" \ |
| 3592 | -S "failed" |
| 3593 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3594 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3595 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3596 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3597 | "$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] | 3598 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3599 | 0 \ |
| 3600 | -c "client hello, adding renegotiation extension" \ |
| 3601 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3602 | -s "found renegotiation extension" \ |
| 3603 | -s "server hello, secure renegotiation extension" \ |
| 3604 | -c "found renegotiation extension" \ |
| 3605 | -s "record counter limit reached: renegotiate" \ |
| 3606 | -c "=> renegotiate" \ |
| 3607 | -s "=> renegotiate" \ |
| 3608 | -s "write hello request" \ |
| 3609 | -S "SSL - An unexpected message was received from our peer" \ |
| 3610 | -S "failed" |
| 3611 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3612 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3613 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3614 | "$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] | 3615 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3616 | 0 \ |
| 3617 | -c "client hello, adding renegotiation extension" \ |
| 3618 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3619 | -s "found renegotiation extension" \ |
| 3620 | -s "server hello, secure renegotiation extension" \ |
| 3621 | -c "found renegotiation extension" \ |
| 3622 | -s "record counter limit reached: renegotiate" \ |
| 3623 | -c "=> renegotiate" \ |
| 3624 | -s "=> renegotiate" \ |
| 3625 | -s "write hello request" \ |
| 3626 | -S "SSL - An unexpected message was received from our peer" \ |
| 3627 | -S "failed" |
| 3628 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3629 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3630 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3631 | "$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] | 3632 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3633 | 0 \ |
| 3634 | -C "client hello, adding renegotiation extension" \ |
| 3635 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3636 | -S "found renegotiation extension" \ |
| 3637 | -s "server hello, secure renegotiation extension" \ |
| 3638 | -c "found renegotiation extension" \ |
| 3639 | -S "record counter limit reached: renegotiate" \ |
| 3640 | -C "=> renegotiate" \ |
| 3641 | -S "=> renegotiate" \ |
| 3642 | -S "write hello request" \ |
| 3643 | -S "SSL - An unexpected message was received from our peer" \ |
| 3644 | -S "failed" |
| 3645 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3646 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3647 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3648 | "$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] | 3649 | "$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] | 3650 | 0 \ |
| 3651 | -c "client hello, adding renegotiation extension" \ |
| 3652 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3653 | -s "found renegotiation extension" \ |
| 3654 | -s "server hello, secure renegotiation extension" \ |
| 3655 | -c "found renegotiation extension" \ |
| 3656 | -c "=> renegotiate" \ |
| 3657 | -s "=> renegotiate" \ |
| 3658 | -S "write hello request" |
| 3659 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3660 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3661 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3662 | "$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] | 3663 | "$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] | 3664 | 0 \ |
| 3665 | -c "client hello, adding renegotiation extension" \ |
| 3666 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3667 | -s "found renegotiation extension" \ |
| 3668 | -s "server hello, secure renegotiation extension" \ |
| 3669 | -c "found renegotiation extension" \ |
| 3670 | -c "=> renegotiate" \ |
| 3671 | -s "=> renegotiate" \ |
| 3672 | -s "write hello request" |
| 3673 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3674 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3675 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3676 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3677 | "$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] | 3678 | 0 \ |
| 3679 | -c "client hello, adding renegotiation extension" \ |
| 3680 | -c "found renegotiation extension" \ |
| 3681 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3682 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3683 | -C "error" \ |
| 3684 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3685 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3686 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3687 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3688 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3689 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3690 | "$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] | 3691 | 0 \ |
| 3692 | -c "client hello, adding renegotiation extension" \ |
| 3693 | -c "found renegotiation extension" \ |
| 3694 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3695 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3696 | -C "error" \ |
| 3697 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3698 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3699 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3700 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3701 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3702 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3703 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3704 | 1 \ |
| 3705 | -c "client hello, adding renegotiation extension" \ |
| 3706 | -C "found renegotiation extension" \ |
| 3707 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3708 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3709 | -c "error" \ |
| 3710 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3711 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3712 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3713 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3714 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3715 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3716 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3717 | allow_legacy=0" \ |
| 3718 | 1 \ |
| 3719 | -c "client hello, adding renegotiation extension" \ |
| 3720 | -C "found renegotiation extension" \ |
| 3721 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3722 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3723 | -c "error" \ |
| 3724 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3725 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3726 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3727 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3728 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3729 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3730 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3731 | allow_legacy=1" \ |
| 3732 | 0 \ |
| 3733 | -c "client hello, adding renegotiation extension" \ |
| 3734 | -C "found renegotiation extension" \ |
| 3735 | -c "=> renegotiate" \ |
| 3736 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3737 | -C "error" \ |
| 3738 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3739 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3740 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3741 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3742 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3743 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3744 | 0 \ |
| 3745 | -c "client hello, adding renegotiation extension" \ |
| 3746 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3747 | -s "found renegotiation extension" \ |
| 3748 | -s "server hello, secure renegotiation extension" \ |
| 3749 | -c "found renegotiation extension" \ |
| 3750 | -c "=> renegotiate" \ |
| 3751 | -s "=> renegotiate" \ |
| 3752 | -S "write hello request" |
| 3753 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3754 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3755 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3756 | "$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] | 3757 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3758 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3759 | 0 \ |
| 3760 | -c "client hello, adding renegotiation extension" \ |
| 3761 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3762 | -s "found renegotiation extension" \ |
| 3763 | -s "server hello, secure renegotiation extension" \ |
| 3764 | -c "found renegotiation extension" \ |
| 3765 | -c "=> renegotiate" \ |
| 3766 | -s "=> renegotiate" \ |
| 3767 | -s "write hello request" |
| 3768 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3770 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3771 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3772 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3773 | 0 \ |
| 3774 | -c "client hello, adding renegotiation extension" \ |
| 3775 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3776 | -s "found renegotiation extension" \ |
| 3777 | -s "server hello, secure renegotiation extension" \ |
| 3778 | -s "record counter limit reached: renegotiate" \ |
| 3779 | -c "=> renegotiate" \ |
| 3780 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3781 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3782 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3783 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3784 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3785 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3786 | "$G_SRV -u --mtu 4096" \ |
| 3787 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3788 | 0 \ |
| 3789 | -c "client hello, adding renegotiation extension" \ |
| 3790 | -c "found renegotiation extension" \ |
| 3791 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3792 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3793 | -C "error" \ |
| 3794 | -s "Extra-header:" |
| 3795 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3796 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3797 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3798 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3799 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3800 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3801 | "$P_CLI debug_level=3" \ |
| 3802 | 0 \ |
| 3803 | -c "found renegotiation extension" \ |
| 3804 | -C "error" \ |
| 3805 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3806 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3807 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3808 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3809 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3810 | "$P_CLI debug_level=3" \ |
| 3811 | 0 \ |
| 3812 | -C "found renegotiation extension" \ |
| 3813 | -C "error" \ |
| 3814 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3815 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3816 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3817 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3818 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3819 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3820 | 1 \ |
| 3821 | -C "found renegotiation extension" \ |
| 3822 | -c "error" \ |
| 3823 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3824 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3825 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3826 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3827 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3828 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3829 | 0 \ |
| 3830 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3831 | -s "server hello, secure renegotiation extension" |
| 3832 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3833 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3834 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3835 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3836 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3837 | 0 \ |
| 3838 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3839 | -S "server hello, secure renegotiation extension" |
| 3840 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3841 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3842 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3843 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3844 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3845 | 1 \ |
| 3846 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3847 | -S "server hello, secure renegotiation extension" |
| 3848 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3849 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3850 | |
| 3851 | requires_gnutls |
| 3852 | run_test "DER format: no trailing bytes" \ |
| 3853 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3854 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3855 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3856 | 0 \ |
| 3857 | -c "Handshake was completed" \ |
| 3858 | |
| 3859 | requires_gnutls |
| 3860 | run_test "DER format: with a trailing zero byte" \ |
| 3861 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3862 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3863 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3864 | 0 \ |
| 3865 | -c "Handshake was completed" \ |
| 3866 | |
| 3867 | requires_gnutls |
| 3868 | run_test "DER format: with a trailing random byte" \ |
| 3869 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3870 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3871 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3872 | 0 \ |
| 3873 | -c "Handshake was completed" \ |
| 3874 | |
| 3875 | requires_gnutls |
| 3876 | run_test "DER format: with 2 trailing random bytes" \ |
| 3877 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3878 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3879 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3880 | 0 \ |
| 3881 | -c "Handshake was completed" \ |
| 3882 | |
| 3883 | requires_gnutls |
| 3884 | run_test "DER format: with 4 trailing random bytes" \ |
| 3885 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3886 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3887 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3888 | 0 \ |
| 3889 | -c "Handshake was completed" \ |
| 3890 | |
| 3891 | requires_gnutls |
| 3892 | run_test "DER format: with 8 trailing random bytes" \ |
| 3893 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3894 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3895 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3896 | 0 \ |
| 3897 | -c "Handshake was completed" \ |
| 3898 | |
| 3899 | requires_gnutls |
| 3900 | run_test "DER format: with 9 trailing random bytes" \ |
| 3901 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3902 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3903 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3904 | 0 \ |
| 3905 | -c "Handshake was completed" \ |
| 3906 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3907 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3908 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3909 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3910 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3911 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3912 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3913 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3914 | 1 \ |
| 3915 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3916 | -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] | 3917 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3918 | -c "X509 - Certificate verification failed" |
| 3919 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3920 | run_test "Authentication: server badcert, client optional" \ |
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=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3924 | 0 \ |
| 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 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3930 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3931 | "$P_SRV" \ |
| 3932 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3933 | 0 \ |
| 3934 | -c "x509_verify_cert() returned" \ |
| 3935 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3936 | -c "! Certificate verification flags"\ |
| 3937 | -C "! mbedtls_ssl_handshake returned" \ |
| 3938 | -C "X509 - Certificate verification failed" \ |
| 3939 | -C "SSL - No CA Chain is set, but required to operate" |
| 3940 | |
| 3941 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3942 | "$P_SRV" \ |
| 3943 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3944 | 1 \ |
| 3945 | -c "x509_verify_cert() returned" \ |
| 3946 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3947 | -c "! Certificate verification flags"\ |
| 3948 | -c "! mbedtls_ssl_handshake returned" \ |
| 3949 | -c "SSL - No CA Chain is set, but required to operate" |
| 3950 | |
| 3951 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3952 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3953 | # the client informs the server about the supported curves - it does, though, in the |
| 3954 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3955 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3956 | # different means to have the server ignoring the client's supported curve list. |
| 3957 | |
| 3958 | requires_config_enabled MBEDTLS_ECP_C |
| 3959 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3960 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3961 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3962 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3963 | 1 \ |
| 3964 | -c "bad certificate (EC key curve)"\ |
| 3965 | -c "! Certificate verification flags"\ |
| 3966 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3967 | |
| 3968 | requires_config_enabled MBEDTLS_ECP_C |
| 3969 | run_test "Authentication: server ECDH p256v1, client optional, 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=optional 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 only at ECDH params check |
| 3977 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3978 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3979 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3980 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3981 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3982 | 0 \ |
| 3983 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3984 | -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] | 3985 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3986 | -C "X509 - Certificate verification failed" |
| 3987 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3988 | run_test "Authentication: client SHA256, server required" \ |
| 3989 | "$P_SRV auth_mode=required" \ |
| 3990 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3991 | key_file=data_files/server6.key \ |
| 3992 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3993 | 0 \ |
| 3994 | -c "Supported Signature Algorithm found: 4," \ |
| 3995 | -c "Supported Signature Algorithm found: 5," |
| 3996 | |
| 3997 | run_test "Authentication: client SHA384, server required" \ |
| 3998 | "$P_SRV auth_mode=required" \ |
| 3999 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4000 | key_file=data_files/server6.key \ |
| 4001 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4002 | 0 \ |
| 4003 | -c "Supported Signature Algorithm found: 4," \ |
| 4004 | -c "Supported Signature Algorithm found: 5," |
| 4005 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4006 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4007 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4008 | "$P_CLI debug_level=3 crt_file=none \ |
| 4009 | key_file=data_files/server5.key" \ |
| 4010 | 1 \ |
| 4011 | -S "skip write certificate request" \ |
| 4012 | -C "skip parse certificate request" \ |
| 4013 | -c "got a certificate request" \ |
| 4014 | -c "= write certificate$" \ |
| 4015 | -C "skip write certificate$" \ |
| 4016 | -S "x509_verify_cert() returned" \ |
| 4017 | -s "client has no certificate" \ |
| 4018 | -s "! mbedtls_ssl_handshake returned" \ |
| 4019 | -c "! mbedtls_ssl_handshake returned" \ |
| 4020 | -s "No client certification received from the client, but required by the authentication mode" |
| 4021 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4022 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4023 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4024 | "$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] | 4025 | key_file=data_files/server5.key" \ |
| 4026 | 1 \ |
| 4027 | -S "skip write certificate request" \ |
| 4028 | -C "skip parse certificate request" \ |
| 4029 | -c "got a certificate request" \ |
| 4030 | -C "skip write certificate" \ |
| 4031 | -C "skip write certificate verify" \ |
| 4032 | -S "skip parse certificate verify" \ |
| 4033 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4034 | -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] | 4035 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4036 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4037 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4038 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4039 | # We don't check that the client receives the alert because it might |
| 4040 | # detect that its write end of the connection is closed and abort |
| 4041 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4042 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4043 | run_test "Authentication: client cert not trusted, server required" \ |
| 4044 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4045 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4046 | key_file=data_files/server5.key" \ |
| 4047 | 1 \ |
| 4048 | -S "skip write certificate request" \ |
| 4049 | -C "skip parse certificate request" \ |
| 4050 | -c "got a certificate request" \ |
| 4051 | -C "skip write certificate" \ |
| 4052 | -C "skip write certificate verify" \ |
| 4053 | -S "skip parse certificate verify" \ |
| 4054 | -s "x509_verify_cert() returned" \ |
| 4055 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4056 | -s "! mbedtls_ssl_handshake returned" \ |
| 4057 | -c "! mbedtls_ssl_handshake returned" \ |
| 4058 | -s "X509 - Certificate verification failed" |
| 4059 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4060 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4061 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4062 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4063 | key_file=data_files/server5.key" \ |
| 4064 | 0 \ |
| 4065 | -S "skip write certificate request" \ |
| 4066 | -C "skip parse certificate request" \ |
| 4067 | -c "got a certificate request" \ |
| 4068 | -C "skip write certificate" \ |
| 4069 | -C "skip write certificate verify" \ |
| 4070 | -S "skip parse certificate verify" \ |
| 4071 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4072 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4073 | -S "! mbedtls_ssl_handshake returned" \ |
| 4074 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4075 | -S "X509 - Certificate verification failed" |
| 4076 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4077 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4078 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4079 | "$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] | 4080 | key_file=data_files/server5.key" \ |
| 4081 | 0 \ |
| 4082 | -s "skip write certificate request" \ |
| 4083 | -C "skip parse certificate request" \ |
| 4084 | -c "got no certificate request" \ |
| 4085 | -c "skip write certificate" \ |
| 4086 | -c "skip write certificate verify" \ |
| 4087 | -s "skip parse certificate verify" \ |
| 4088 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4089 | -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] | 4090 | -S "! mbedtls_ssl_handshake returned" \ |
| 4091 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4092 | -S "X509 - Certificate verification failed" |
| 4093 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4094 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4095 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4096 | "$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] | 4097 | 0 \ |
| 4098 | -S "skip write certificate request" \ |
| 4099 | -C "skip parse certificate request" \ |
| 4100 | -c "got a certificate request" \ |
| 4101 | -C "skip write certificate$" \ |
| 4102 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4103 | -c "skip write certificate verify" \ |
| 4104 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4105 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4106 | -S "! mbedtls_ssl_handshake returned" \ |
| 4107 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4108 | -S "X509 - Certificate verification failed" |
| 4109 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4110 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4111 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4112 | "$O_CLI" \ |
| 4113 | 0 \ |
| 4114 | -S "skip write certificate request" \ |
| 4115 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4116 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4117 | -S "! 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: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4121 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4122 | "$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] | 4123 | 0 \ |
| 4124 | -C "skip parse certificate request" \ |
| 4125 | -c "got a certificate request" \ |
| 4126 | -C "skip write certificate$" \ |
| 4127 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4128 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4129 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4130 | run_test "Authentication: client no cert, openssl server required" \ |
| 4131 | "$O_SRV -Verify 10" \ |
| 4132 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4133 | 1 \ |
| 4134 | -C "skip parse certificate request" \ |
| 4135 | -c "got a certificate request" \ |
| 4136 | -C "skip write certificate$" \ |
| 4137 | -c "skip write certificate verify" \ |
| 4138 | -c "! mbedtls_ssl_handshake returned" |
| 4139 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 4140 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 4141 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4142 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4143 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 4144 | 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] | 4145 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4146 | 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] | 4147 | cat <<EOF |
| 4148 | ${CONFIG_H} contains a value for the configuration of |
| 4149 | MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script's |
| 4150 | test value of ${MAX_IM_CA}. |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4151 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 4152 | The tests assume this value and if it changes, the tests in this |
| 4153 | script should also be adjusted. |
| 4154 | EOF |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4155 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4156 | fi |
| 4157 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4158 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4159 | run_test "Authentication: server max_int chain, client default" \ |
| 4160 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4161 | key_file=data_files/dir-maxpath/09.key" \ |
| 4162 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4163 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4164 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4165 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4166 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4167 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4168 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4169 | key_file=data_files/dir-maxpath/10.key" \ |
| 4170 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4171 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4172 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4173 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4174 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4175 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4176 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4177 | key_file=data_files/dir-maxpath/10.key" \ |
| 4178 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4179 | auth_mode=optional" \ |
| 4180 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4181 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4182 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4183 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4184 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4185 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4186 | key_file=data_files/dir-maxpath/10.key" \ |
| 4187 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4188 | auth_mode=none" \ |
| 4189 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4190 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4191 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4192 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4193 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4194 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4195 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4196 | key_file=data_files/dir-maxpath/10.key" \ |
| 4197 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4198 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4199 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4200 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4201 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4202 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4203 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4204 | key_file=data_files/dir-maxpath/10.key" \ |
| 4205 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4206 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4207 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4208 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4209 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4210 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4211 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4212 | key_file=data_files/dir-maxpath/10.key" \ |
| 4213 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4214 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4215 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4216 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4217 | run_test "Authentication: client max_int chain, server required" \ |
| 4218 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4219 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4220 | key_file=data_files/dir-maxpath/09.key" \ |
| 4221 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4222 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4223 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4224 | # Tests for CA list in CertificateRequest messages |
| 4225 | |
| 4226 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4227 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4228 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4229 | key_file=data_files/server6.key" \ |
| 4230 | 0 \ |
| 4231 | -s "requested DN" |
| 4232 | |
| 4233 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4234 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4235 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4236 | key_file=data_files/server6.key" \ |
| 4237 | 0 \ |
| 4238 | -S "requested DN" |
| 4239 | |
| 4240 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4241 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4242 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4243 | key_file=data_files/server5.key" \ |
| 4244 | 1 \ |
| 4245 | -S "requested DN" \ |
| 4246 | -s "x509_verify_cert() returned" \ |
| 4247 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4248 | -s "! mbedtls_ssl_handshake returned" \ |
| 4249 | -c "! mbedtls_ssl_handshake returned" \ |
| 4250 | -s "X509 - Certificate verification failed" |
| 4251 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4252 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4253 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4254 | |
| 4255 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4256 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4257 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4258 | key_file=data_files/server5.key" \ |
| 4259 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4260 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4261 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4262 | -c "x509_verify_cert() returned" \ |
| 4263 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4264 | -c "! mbedtls_ssl_handshake returned" \ |
| 4265 | -c "X509 - Certificate verification failed" |
| 4266 | |
| 4267 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4268 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4269 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4270 | key_file=data_files/server5.key" \ |
| 4271 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4272 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4273 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4274 | -c "x509_verify_cert() returned" \ |
| 4275 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4276 | -C "! mbedtls_ssl_handshake returned" \ |
| 4277 | -C "X509 - Certificate verification failed" |
| 4278 | |
| 4279 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4280 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4281 | # the client informs the server about the supported curves - it does, though, in the |
| 4282 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4283 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4284 | # different means to have the server ignoring the client's supported curve list. |
| 4285 | |
| 4286 | requires_config_enabled MBEDTLS_ECP_C |
| 4287 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4288 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4289 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4290 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4291 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4292 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4293 | -c "use CA callback for X.509 CRT verification" \ |
| 4294 | -c "bad certificate (EC key curve)" \ |
| 4295 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4296 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4297 | |
| 4298 | requires_config_enabled MBEDTLS_ECP_C |
| 4299 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4300 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4301 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4302 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4303 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4304 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4305 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4306 | -c "bad certificate (EC key curve)"\ |
| 4307 | -c "! Certificate verification flags"\ |
| 4308 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4309 | |
| 4310 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4311 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4312 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4313 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4314 | key_file=data_files/server6.key \ |
| 4315 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4316 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4317 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4318 | -c "Supported Signature Algorithm found: 4," \ |
| 4319 | -c "Supported Signature Algorithm found: 5," |
| 4320 | |
| 4321 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4322 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4323 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4324 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4325 | key_file=data_files/server6.key \ |
| 4326 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4327 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4328 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4329 | -c "Supported Signature Algorithm found: 4," \ |
| 4330 | -c "Supported Signature Algorithm found: 5," |
| 4331 | |
| 4332 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4333 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4334 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4335 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4336 | key_file=data_files/server5.key" \ |
| 4337 | 1 \ |
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 | -S "skip write certificate request" \ |
| 4340 | -C "skip parse certificate request" \ |
| 4341 | -c "got a certificate request" \ |
| 4342 | -C "skip write certificate" \ |
| 4343 | -C "skip write certificate verify" \ |
| 4344 | -S "skip parse certificate verify" \ |
| 4345 | -s "x509_verify_cert() returned" \ |
| 4346 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4347 | -s "! mbedtls_ssl_handshake returned" \ |
| 4348 | -s "send alert level=2 message=48" \ |
| 4349 | -c "! mbedtls_ssl_handshake returned" \ |
| 4350 | -s "X509 - Certificate verification failed" |
| 4351 | # We don't check that the client receives the alert because it might |
| 4352 | # detect that its write end of the connection is closed and abort |
| 4353 | # before reading the alert message. |
| 4354 | |
| 4355 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4356 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4357 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4358 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4359 | key_file=data_files/server5.key" \ |
| 4360 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4361 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4362 | -S "skip write certificate request" \ |
| 4363 | -C "skip parse certificate request" \ |
| 4364 | -c "got a certificate request" \ |
| 4365 | -C "skip write certificate" \ |
| 4366 | -C "skip write certificate verify" \ |
| 4367 | -S "skip parse certificate verify" \ |
| 4368 | -s "x509_verify_cert() returned" \ |
| 4369 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4370 | -s "! mbedtls_ssl_handshake returned" \ |
| 4371 | -c "! mbedtls_ssl_handshake returned" \ |
| 4372 | -s "X509 - Certificate verification failed" |
| 4373 | |
| 4374 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4375 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4376 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4377 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4378 | key_file=data_files/server5.key" \ |
| 4379 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4380 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4381 | -S "skip write certificate request" \ |
| 4382 | -C "skip parse certificate request" \ |
| 4383 | -c "got a certificate request" \ |
| 4384 | -C "skip write certificate" \ |
| 4385 | -C "skip write certificate verify" \ |
| 4386 | -S "skip parse certificate verify" \ |
| 4387 | -s "x509_verify_cert() returned" \ |
| 4388 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4389 | -S "! mbedtls_ssl_handshake returned" \ |
| 4390 | -C "! mbedtls_ssl_handshake returned" \ |
| 4391 | -S "X509 - Certificate verification failed" |
| 4392 | |
| 4393 | requires_full_size_output_buffer |
| 4394 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4395 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4396 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4397 | key_file=data_files/dir-maxpath/09.key" \ |
| 4398 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4399 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4400 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4401 | -C "X509 - A fatal error occurred" |
| 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+1 chain, client default" \ |
| 4406 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4407 | key_file=data_files/dir-maxpath/10.key" \ |
| 4408 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4409 | 1 \ |
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 optional" \ |
| 4416 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4417 | key_file=data_files/dir-maxpath/10.key" \ |
| 4418 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4419 | debug_level=3 auth_mode=optional" \ |
| 4420 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4421 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4422 | -c "X509 - A fatal error occurred" |
| 4423 | |
| 4424 | requires_full_size_output_buffer |
| 4425 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4426 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4427 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4428 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4429 | key_file=data_files/dir-maxpath/10.key" \ |
| 4430 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4431 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4432 | -s "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 required" \ |
| 4437 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 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 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/c09.pem \ |
| 4449 | key_file=data_files/dir-maxpath/09.key" \ |
| 4450 | 0 \ |
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 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4454 | # Tests for certificate selection based on SHA verson |
| 4455 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4456 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4457 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4458 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4459 | key_file=data_files/server5.key \ |
| 4460 | crt_file2=data_files/server5-sha1.crt \ |
| 4461 | key_file2=data_files/server5.key" \ |
| 4462 | "$P_CLI force_version=tls1_2" \ |
| 4463 | 0 \ |
| 4464 | -c "signed using.*ECDSA with SHA256" \ |
| 4465 | -C "signed using.*ECDSA with SHA1" |
| 4466 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4467 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4468 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4469 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4470 | key_file=data_files/server5.key \ |
| 4471 | crt_file2=data_files/server5-sha1.crt \ |
| 4472 | key_file2=data_files/server5.key" \ |
| 4473 | "$P_CLI force_version=tls1_1" \ |
| 4474 | 0 \ |
| 4475 | -C "signed using.*ECDSA with SHA256" \ |
| 4476 | -c "signed using.*ECDSA with SHA1" |
| 4477 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4478 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4479 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4480 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4481 | key_file=data_files/server5.key \ |
| 4482 | crt_file2=data_files/server5-sha1.crt \ |
| 4483 | key_file2=data_files/server5.key" \ |
| 4484 | "$P_CLI force_version=tls1" \ |
| 4485 | 0 \ |
| 4486 | -C "signed using.*ECDSA with SHA256" \ |
| 4487 | -c "signed using.*ECDSA with SHA1" |
| 4488 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4489 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4490 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4491 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4492 | key_file=data_files/server5.key \ |
| 4493 | crt_file2=data_files/server6.crt \ |
| 4494 | key_file2=data_files/server6.key" \ |
| 4495 | "$P_CLI force_version=tls1_1" \ |
| 4496 | 0 \ |
| 4497 | -c "serial number.*09" \ |
| 4498 | -c "signed using.*ECDSA with SHA256" \ |
| 4499 | -C "signed using.*ECDSA with SHA1" |
| 4500 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4501 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4502 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4503 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4504 | key_file=data_files/server6.key \ |
| 4505 | crt_file2=data_files/server5.crt \ |
| 4506 | key_file2=data_files/server5.key" \ |
| 4507 | "$P_CLI force_version=tls1_1" \ |
| 4508 | 0 \ |
| 4509 | -c "serial number.*0A" \ |
| 4510 | -c "signed using.*ECDSA with SHA256" \ |
| 4511 | -C "signed using.*ECDSA with SHA1" |
| 4512 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4513 | # tests for SNI |
| 4514 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4515 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4516 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4517 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4518 | 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] | 4519 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4520 | 0 \ |
| 4521 | -S "parse ServerName extension" \ |
| 4522 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4523 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4524 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4525 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4526 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4527 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4528 | 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] | 4529 | 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] | 4530 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4531 | 0 \ |
| 4532 | -s "parse ServerName extension" \ |
| 4533 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4534 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4535 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4536 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4537 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4538 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4539 | 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] | 4540 | 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] | 4541 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4542 | 0 \ |
| 4543 | -s "parse ServerName extension" \ |
| 4544 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4545 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4546 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4547 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4548 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4549 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4550 | 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] | 4551 | 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] | 4552 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4553 | 1 \ |
| 4554 | -s "parse ServerName extension" \ |
| 4555 | -s "ssl_sni_wrapper() returned" \ |
| 4556 | -s "mbedtls_ssl_handshake returned" \ |
| 4557 | -c "mbedtls_ssl_handshake returned" \ |
| 4558 | -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] | 4559 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4560 | run_test "SNI: client auth no override: optional" \ |
| 4561 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4562 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4563 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4564 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4565 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4566 | -S "skip write certificate request" \ |
| 4567 | -C "skip parse certificate request" \ |
| 4568 | -c "got a certificate request" \ |
| 4569 | -C "skip write certificate" \ |
| 4570 | -C "skip write certificate verify" \ |
| 4571 | -S "skip parse certificate verify" |
| 4572 | |
| 4573 | run_test "SNI: client auth override: none -> optional" \ |
| 4574 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4575 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4576 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4577 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4578 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4579 | -S "skip write certificate request" \ |
| 4580 | -C "skip parse certificate request" \ |
| 4581 | -c "got a certificate request" \ |
| 4582 | -C "skip write certificate" \ |
| 4583 | -C "skip write certificate verify" \ |
| 4584 | -S "skip parse certificate verify" |
| 4585 | |
| 4586 | run_test "SNI: client auth override: optional -> none" \ |
| 4587 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4588 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4589 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4590 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4591 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4592 | -s "skip write certificate request" \ |
| 4593 | -C "skip parse certificate request" \ |
| 4594 | -c "got no certificate request" \ |
| 4595 | -c "skip write certificate" \ |
| 4596 | -c "skip write certificate verify" \ |
| 4597 | -s "skip parse certificate verify" |
| 4598 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4599 | run_test "SNI: CA no override" \ |
| 4600 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4601 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4602 | ca_file=data_files/test-ca.crt \ |
| 4603 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4604 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4605 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4606 | 1 \ |
| 4607 | -S "skip write certificate request" \ |
| 4608 | -C "skip parse certificate request" \ |
| 4609 | -c "got a certificate request" \ |
| 4610 | -C "skip write certificate" \ |
| 4611 | -C "skip write certificate verify" \ |
| 4612 | -S "skip parse certificate verify" \ |
| 4613 | -s "x509_verify_cert() returned" \ |
| 4614 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4615 | -S "The certificate has been revoked (is on a CRL)" |
| 4616 | |
| 4617 | run_test "SNI: CA override" \ |
| 4618 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4619 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4620 | ca_file=data_files/test-ca.crt \ |
| 4621 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4622 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4623 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4624 | 0 \ |
| 4625 | -S "skip write certificate request" \ |
| 4626 | -C "skip parse certificate request" \ |
| 4627 | -c "got a certificate request" \ |
| 4628 | -C "skip write certificate" \ |
| 4629 | -C "skip write certificate verify" \ |
| 4630 | -S "skip parse certificate verify" \ |
| 4631 | -S "x509_verify_cert() returned" \ |
| 4632 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4633 | -S "The certificate has been revoked (is on a CRL)" |
| 4634 | |
| 4635 | run_test "SNI: CA override with CRL" \ |
| 4636 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4637 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4638 | ca_file=data_files/test-ca.crt \ |
| 4639 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4640 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4641 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4642 | 1 \ |
| 4643 | -S "skip write certificate request" \ |
| 4644 | -C "skip parse certificate request" \ |
| 4645 | -c "got a certificate request" \ |
| 4646 | -C "skip write certificate" \ |
| 4647 | -C "skip write certificate verify" \ |
| 4648 | -S "skip parse certificate verify" \ |
| 4649 | -s "x509_verify_cert() returned" \ |
| 4650 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4651 | -s "The certificate has been revoked (is on a CRL)" |
| 4652 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4653 | # Tests for SNI and DTLS |
| 4654 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4655 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
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 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4665 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4666 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4667 | "$P_SRV debug_level=3 dtls=1 \ |
| 4668 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4669 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4670 | "$P_CLI server_name=localhost dtls=1" \ |
| 4671 | 0 \ |
| 4672 | -s "parse ServerName extension" \ |
| 4673 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4674 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4675 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4676 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4677 | run_test "SNI: DTLS, matching cert 2" \ |
| 4678 | "$P_SRV debug_level=3 dtls=1 \ |
| 4679 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4680 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4681 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4682 | 0 \ |
| 4683 | -s "parse ServerName extension" \ |
| 4684 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4685 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4686 | |
| 4687 | run_test "SNI: DTLS, no matching cert" \ |
| 4688 | "$P_SRV debug_level=3 dtls=1 \ |
| 4689 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4690 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4691 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4692 | 1 \ |
| 4693 | -s "parse ServerName extension" \ |
| 4694 | -s "ssl_sni_wrapper() returned" \ |
| 4695 | -s "mbedtls_ssl_handshake returned" \ |
| 4696 | -c "mbedtls_ssl_handshake returned" \ |
| 4697 | -c "SSL - A fatal alert message was received from our peer" |
| 4698 | |
| 4699 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4700 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4701 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4702 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4703 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4704 | 0 \ |
| 4705 | -S "skip write certificate request" \ |
| 4706 | -C "skip parse certificate request" \ |
| 4707 | -c "got a certificate request" \ |
| 4708 | -C "skip write certificate" \ |
| 4709 | -C "skip write certificate verify" \ |
| 4710 | -S "skip parse certificate verify" |
| 4711 | |
| 4712 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4713 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4714 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4715 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4716 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4717 | 0 \ |
| 4718 | -S "skip write certificate request" \ |
| 4719 | -C "skip parse certificate request" \ |
| 4720 | -c "got a certificate request" \ |
| 4721 | -C "skip write certificate" \ |
| 4722 | -C "skip write certificate verify" \ |
| 4723 | -S "skip parse certificate verify" |
| 4724 | |
| 4725 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4726 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4727 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4728 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4729 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4730 | 0 \ |
| 4731 | -s "skip write certificate request" \ |
| 4732 | -C "skip parse certificate request" \ |
| 4733 | -c "got no certificate request" \ |
| 4734 | -c "skip write certificate" \ |
| 4735 | -c "skip write certificate verify" \ |
| 4736 | -s "skip parse certificate verify" |
| 4737 | |
| 4738 | run_test "SNI: DTLS, CA no override" \ |
| 4739 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4740 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4741 | ca_file=data_files/test-ca.crt \ |
| 4742 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4743 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4744 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4745 | 1 \ |
| 4746 | -S "skip write certificate request" \ |
| 4747 | -C "skip parse certificate request" \ |
| 4748 | -c "got a certificate request" \ |
| 4749 | -C "skip write certificate" \ |
| 4750 | -C "skip write certificate verify" \ |
| 4751 | -S "skip parse certificate verify" \ |
| 4752 | -s "x509_verify_cert() returned" \ |
| 4753 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4754 | -S "The certificate has been revoked (is on a CRL)" |
| 4755 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4756 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4757 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4758 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4759 | ca_file=data_files/test-ca.crt \ |
| 4760 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4761 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4762 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4763 | 0 \ |
| 4764 | -S "skip write certificate request" \ |
| 4765 | -C "skip parse certificate request" \ |
| 4766 | -c "got a certificate request" \ |
| 4767 | -C "skip write certificate" \ |
| 4768 | -C "skip write certificate verify" \ |
| 4769 | -S "skip parse certificate verify" \ |
| 4770 | -S "x509_verify_cert() returned" \ |
| 4771 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4772 | -S "The certificate has been revoked (is on a CRL)" |
| 4773 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4774 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4775 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4776 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4777 | ca_file=data_files/test-ca.crt \ |
| 4778 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4779 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4780 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4781 | 1 \ |
| 4782 | -S "skip write certificate request" \ |
| 4783 | -C "skip parse certificate request" \ |
| 4784 | -c "got a certificate request" \ |
| 4785 | -C "skip write certificate" \ |
| 4786 | -C "skip write certificate verify" \ |
| 4787 | -S "skip parse certificate verify" \ |
| 4788 | -s "x509_verify_cert() returned" \ |
| 4789 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4790 | -s "The certificate has been revoked (is on a CRL)" |
| 4791 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4792 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4793 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4794 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4795 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4796 | "$P_CLI nbio=2 tickets=0" \ |
| 4797 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4798 | -S "mbedtls_ssl_handshake returned" \ |
| 4799 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4800 | -c "Read from server: .* bytes read" |
| 4801 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4802 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4803 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4804 | "$P_CLI nbio=2 tickets=0" \ |
| 4805 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4806 | -S "mbedtls_ssl_handshake returned" \ |
| 4807 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4808 | -c "Read from server: .* bytes read" |
| 4809 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4810 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4811 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4812 | "$P_CLI nbio=2 tickets=1" \ |
| 4813 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4814 | -S "mbedtls_ssl_handshake returned" \ |
| 4815 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4816 | -c "Read from server: .* bytes read" |
| 4817 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4818 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4819 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4820 | "$P_CLI nbio=2 tickets=1" \ |
| 4821 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4822 | -S "mbedtls_ssl_handshake returned" \ |
| 4823 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4824 | -c "Read from server: .* bytes read" |
| 4825 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4826 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4827 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4828 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4829 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4830 | -S "mbedtls_ssl_handshake returned" \ |
| 4831 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4832 | -c "Read from server: .* bytes read" |
| 4833 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4834 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4835 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4836 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4837 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4838 | -S "mbedtls_ssl_handshake returned" \ |
| 4839 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4840 | -c "Read from server: .* bytes read" |
| 4841 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4842 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4843 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4844 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4845 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4846 | -S "mbedtls_ssl_handshake returned" \ |
| 4847 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4848 | -c "Read from server: .* bytes read" |
| 4849 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4850 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4851 | |
| 4852 | run_test "Event-driven I/O: basic handshake" \ |
| 4853 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4854 | "$P_CLI event=1 tickets=0" \ |
| 4855 | 0 \ |
| 4856 | -S "mbedtls_ssl_handshake returned" \ |
| 4857 | -C "mbedtls_ssl_handshake returned" \ |
| 4858 | -c "Read from server: .* bytes read" |
| 4859 | |
| 4860 | run_test "Event-driven I/O: client auth" \ |
| 4861 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4862 | "$P_CLI event=1 tickets=0" \ |
| 4863 | 0 \ |
| 4864 | -S "mbedtls_ssl_handshake returned" \ |
| 4865 | -C "mbedtls_ssl_handshake returned" \ |
| 4866 | -c "Read from server: .* bytes read" |
| 4867 | |
| 4868 | run_test "Event-driven I/O: ticket" \ |
| 4869 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4870 | "$P_CLI event=1 tickets=1" \ |
| 4871 | 0 \ |
| 4872 | -S "mbedtls_ssl_handshake returned" \ |
| 4873 | -C "mbedtls_ssl_handshake returned" \ |
| 4874 | -c "Read from server: .* bytes read" |
| 4875 | |
| 4876 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4877 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4878 | "$P_CLI event=1 tickets=1" \ |
| 4879 | 0 \ |
| 4880 | -S "mbedtls_ssl_handshake returned" \ |
| 4881 | -C "mbedtls_ssl_handshake returned" \ |
| 4882 | -c "Read from server: .* bytes read" |
| 4883 | |
| 4884 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4885 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4886 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4887 | 0 \ |
| 4888 | -S "mbedtls_ssl_handshake returned" \ |
| 4889 | -C "mbedtls_ssl_handshake returned" \ |
| 4890 | -c "Read from server: .* bytes read" |
| 4891 | |
| 4892 | run_test "Event-driven I/O: ticket + resume" \ |
| 4893 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4894 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4895 | 0 \ |
| 4896 | -S "mbedtls_ssl_handshake returned" \ |
| 4897 | -C "mbedtls_ssl_handshake returned" \ |
| 4898 | -c "Read from server: .* bytes read" |
| 4899 | |
| 4900 | run_test "Event-driven I/O: session-id resume" \ |
| 4901 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4902 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4903 | 0 \ |
| 4904 | -S "mbedtls_ssl_handshake returned" \ |
| 4905 | -C "mbedtls_ssl_handshake returned" \ |
| 4906 | -c "Read from server: .* bytes read" |
| 4907 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4908 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4909 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4910 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4911 | 0 \ |
| 4912 | -c "Read from server: .* bytes read" |
| 4913 | |
| 4914 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4915 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4916 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4917 | 0 \ |
| 4918 | -c "Read from server: .* bytes read" |
| 4919 | |
| 4920 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4921 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4922 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4923 | 0 \ |
| 4924 | -c "Read from server: .* bytes read" |
| 4925 | |
| 4926 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4927 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4928 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4929 | 0 \ |
| 4930 | -c "Read from server: .* bytes read" |
| 4931 | |
| 4932 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4933 | "$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] | 4934 | "$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] | 4935 | 0 \ |
| 4936 | -c "Read from server: .* bytes read" |
| 4937 | |
| 4938 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4939 | "$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] | 4940 | "$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] | 4941 | 0 \ |
| 4942 | -c "Read from server: .* bytes read" |
| 4943 | |
| 4944 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4945 | "$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] | 4946 | "$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] | 4947 | 0 \ |
| 4948 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4949 | |
| 4950 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4951 | # During session resumption, the client will send its ApplicationData record |
| 4952 | # within the same datagram as the Finished messages. In this situation, the |
| 4953 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4954 | # because the ApplicationData request has already been queued internally. |
| 4955 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4956 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4957 | "$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] | 4958 | "$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] | 4959 | 0 \ |
| 4960 | -c "Read from server: .* bytes read" |
| 4961 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4962 | # Tests for version negotiation |
| 4963 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4964 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4965 | "$P_SRV" \ |
| 4966 | "$P_CLI" \ |
| 4967 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4968 | -S "mbedtls_ssl_handshake returned" \ |
| 4969 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4970 | -s "Protocol is TLSv1.2" \ |
| 4971 | -c "Protocol is TLSv1.2" |
| 4972 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4973 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4974 | "$P_SRV" \ |
| 4975 | "$P_CLI max_version=tls1_1" \ |
| 4976 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4977 | -S "mbedtls_ssl_handshake returned" \ |
| 4978 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4979 | -s "Protocol is TLSv1.1" \ |
| 4980 | -c "Protocol is TLSv1.1" |
| 4981 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4982 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4983 | "$P_SRV max_version=tls1_1" \ |
| 4984 | "$P_CLI" \ |
| 4985 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4986 | -S "mbedtls_ssl_handshake returned" \ |
| 4987 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4988 | -s "Protocol is TLSv1.1" \ |
| 4989 | -c "Protocol is TLSv1.1" |
| 4990 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4991 | 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] | 4992 | "$P_SRV max_version=tls1_1" \ |
| 4993 | "$P_CLI max_version=tls1_1" \ |
| 4994 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4995 | -S "mbedtls_ssl_handshake returned" \ |
| 4996 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4997 | -s "Protocol is TLSv1.1" \ |
| 4998 | -c "Protocol is TLSv1.1" |
| 4999 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5000 | 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] | 5001 | "$P_SRV min_version=tls1_1" \ |
| 5002 | "$P_CLI max_version=tls1_1" \ |
| 5003 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5004 | -S "mbedtls_ssl_handshake returned" \ |
| 5005 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5006 | -s "Protocol is TLSv1.1" \ |
| 5007 | -c "Protocol is TLSv1.1" |
| 5008 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5009 | 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] | 5010 | "$P_SRV max_version=tls1_1" \ |
| 5011 | "$P_CLI min_version=tls1_1" \ |
| 5012 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5013 | -S "mbedtls_ssl_handshake returned" \ |
| 5014 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5015 | -s "Protocol is TLSv1.1" \ |
| 5016 | -c "Protocol is TLSv1.1" |
| 5017 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5018 | 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] | 5019 | "$P_SRV max_version=tls1_1" \ |
| 5020 | "$P_CLI min_version=tls1_2" \ |
| 5021 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5022 | -s "mbedtls_ssl_handshake returned" \ |
| 5023 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5024 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5025 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5026 | 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] | 5027 | "$P_SRV min_version=tls1_2" \ |
| 5028 | "$P_CLI max_version=tls1_1" \ |
| 5029 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5030 | -s "mbedtls_ssl_handshake returned" \ |
| 5031 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5032 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5033 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5034 | # Tests for ALPN extension |
| 5035 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5036 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5037 | "$P_SRV debug_level=3" \ |
| 5038 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5039 | 0 \ |
| 5040 | -C "client hello, adding alpn extension" \ |
| 5041 | -S "found alpn extension" \ |
| 5042 | -C "got an alert message, type: \\[2:120]" \ |
| 5043 | -S "server hello, adding alpn extension" \ |
| 5044 | -C "found alpn extension " \ |
| 5045 | -C "Application Layer Protocol is" \ |
| 5046 | -S "Application Layer Protocol is" |
| 5047 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5048 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5049 | "$P_SRV debug_level=3" \ |
| 5050 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5051 | 0 \ |
| 5052 | -c "client hello, adding alpn extension" \ |
| 5053 | -s "found alpn extension" \ |
| 5054 | -C "got an alert message, type: \\[2:120]" \ |
| 5055 | -S "server hello, adding alpn extension" \ |
| 5056 | -C "found alpn extension " \ |
| 5057 | -c "Application Layer Protocol is (none)" \ |
| 5058 | -S "Application Layer Protocol is" |
| 5059 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5060 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5061 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5062 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5063 | 0 \ |
| 5064 | -C "client hello, adding alpn extension" \ |
| 5065 | -S "found alpn extension" \ |
| 5066 | -C "got an alert message, type: \\[2:120]" \ |
| 5067 | -S "server hello, adding alpn extension" \ |
| 5068 | -C "found alpn extension " \ |
| 5069 | -C "Application Layer Protocol is" \ |
| 5070 | -s "Application Layer Protocol is (none)" |
| 5071 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5072 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5073 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5074 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5075 | 0 \ |
| 5076 | -c "client hello, adding alpn extension" \ |
| 5077 | -s "found alpn extension" \ |
| 5078 | -C "got an alert message, type: \\[2:120]" \ |
| 5079 | -s "server hello, adding alpn extension" \ |
| 5080 | -c "found alpn extension" \ |
| 5081 | -c "Application Layer Protocol is abc" \ |
| 5082 | -s "Application Layer Protocol is abc" |
| 5083 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5084 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5085 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5086 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5087 | 0 \ |
| 5088 | -c "client hello, adding alpn extension" \ |
| 5089 | -s "found alpn extension" \ |
| 5090 | -C "got an alert message, type: \\[2:120]" \ |
| 5091 | -s "server hello, adding alpn extension" \ |
| 5092 | -c "found alpn extension" \ |
| 5093 | -c "Application Layer Protocol is abc" \ |
| 5094 | -s "Application Layer Protocol is abc" |
| 5095 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5096 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5097 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5098 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5099 | 0 \ |
| 5100 | -c "client hello, adding alpn extension" \ |
| 5101 | -s "found alpn extension" \ |
| 5102 | -C "got an alert message, type: \\[2:120]" \ |
| 5103 | -s "server hello, adding alpn extension" \ |
| 5104 | -c "found alpn extension" \ |
| 5105 | -c "Application Layer Protocol is 1234" \ |
| 5106 | -s "Application Layer Protocol is 1234" |
| 5107 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5108 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5109 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5110 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5111 | 1 \ |
| 5112 | -c "client hello, adding alpn extension" \ |
| 5113 | -s "found alpn extension" \ |
| 5114 | -c "got an alert message, type: \\[2:120]" \ |
| 5115 | -S "server hello, adding alpn extension" \ |
| 5116 | -C "found alpn extension" \ |
| 5117 | -C "Application Layer Protocol is 1234" \ |
| 5118 | -S "Application Layer Protocol is 1234" |
| 5119 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5120 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5121 | # Tests for keyUsage in leaf certificates, part 1: |
| 5122 | # server-side certificate/suite selection |
| 5123 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5124 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5125 | "$P_SRV key_file=data_files/server2.key \ |
| 5126 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5127 | "$P_CLI" \ |
| 5128 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5129 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5130 | |
| 5131 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5132 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5133 | "$P_SRV key_file=data_files/server2.key \ |
| 5134 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5135 | "$P_CLI" \ |
| 5136 | 0 \ |
| 5137 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5138 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5139 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5140 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5141 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5142 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5143 | 1 \ |
| 5144 | -C "Ciphersuite is " |
| 5145 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5146 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5147 | "$P_SRV key_file=data_files/server5.key \ |
| 5148 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5149 | "$P_CLI" \ |
| 5150 | 0 \ |
| 5151 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5152 | |
| 5153 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5154 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5155 | "$P_SRV key_file=data_files/server5.key \ |
| 5156 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5157 | "$P_CLI" \ |
| 5158 | 0 \ |
| 5159 | -c "Ciphersuite is TLS-ECDH-" |
| 5160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5161 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5162 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5163 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5164 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5165 | 1 \ |
| 5166 | -C "Ciphersuite is " |
| 5167 | |
| 5168 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5169 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5170 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5171 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5172 | "$O_SRV -key data_files/server2.key \ |
| 5173 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5174 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5175 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5176 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5177 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5178 | -C "Processing of the Certificate handshake message failed" \ |
| 5179 | -c "Ciphersuite is TLS-" |
| 5180 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5181 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5182 | "$O_SRV -key data_files/server2.key \ |
| 5183 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5184 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5185 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5186 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5187 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5188 | -C "Processing of the Certificate handshake message failed" \ |
| 5189 | -c "Ciphersuite is TLS-" |
| 5190 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5191 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5192 | "$O_SRV -key data_files/server2.key \ |
| 5193 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5194 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5195 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5196 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5197 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5198 | -C "Processing of the Certificate handshake message failed" \ |
| 5199 | -c "Ciphersuite is TLS-" |
| 5200 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5201 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5202 | "$O_SRV -key data_files/server2.key \ |
| 5203 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5204 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5205 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5206 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5207 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5208 | -c "Processing of the Certificate handshake message failed" \ |
| 5209 | -C "Ciphersuite is TLS-" |
| 5210 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5211 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5212 | "$O_SRV -key data_files/server2.key \ |
| 5213 | -cert data_files/server2.ku-ke.crt" \ |
| 5214 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5215 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5216 | 0 \ |
| 5217 | -c "bad certificate (usage extensions)" \ |
| 5218 | -C "Processing of the Certificate handshake message failed" \ |
| 5219 | -c "Ciphersuite is TLS-" \ |
| 5220 | -c "! Usage does not match the keyUsage extension" |
| 5221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5222 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5223 | "$O_SRV -key data_files/server2.key \ |
| 5224 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5225 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5226 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5227 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5228 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5229 | -C "Processing of the Certificate handshake message failed" \ |
| 5230 | -c "Ciphersuite is TLS-" |
| 5231 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5232 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5233 | "$O_SRV -key data_files/server2.key \ |
| 5234 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5235 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5236 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5237 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5238 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5239 | -c "Processing of the Certificate handshake message failed" \ |
| 5240 | -C "Ciphersuite is TLS-" |
| 5241 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5242 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5243 | "$O_SRV -key data_files/server2.key \ |
| 5244 | -cert data_files/server2.ku-ds.crt" \ |
| 5245 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5246 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5247 | 0 \ |
| 5248 | -c "bad certificate (usage extensions)" \ |
| 5249 | -C "Processing of the Certificate handshake message failed" \ |
| 5250 | -c "Ciphersuite is TLS-" \ |
| 5251 | -c "! Usage does not match the keyUsage extension" |
| 5252 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5253 | # Tests for keyUsage in leaf certificates, part 3: |
| 5254 | # server-side checking of client cert |
| 5255 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5256 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5257 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5258 | "$O_CLI -key data_files/server2.key \ |
| 5259 | -cert data_files/server2.ku-ds.crt" \ |
| 5260 | 0 \ |
| 5261 | -S "bad certificate (usage extensions)" \ |
| 5262 | -S "Processing of the Certificate handshake message failed" |
| 5263 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5264 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5265 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5266 | "$O_CLI -key data_files/server2.key \ |
| 5267 | -cert data_files/server2.ku-ke.crt" \ |
| 5268 | 0 \ |
| 5269 | -s "bad certificate (usage extensions)" \ |
| 5270 | -S "Processing of the Certificate handshake message failed" |
| 5271 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5272 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5273 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5274 | "$O_CLI -key data_files/server2.key \ |
| 5275 | -cert data_files/server2.ku-ke.crt" \ |
| 5276 | 1 \ |
| 5277 | -s "bad certificate (usage extensions)" \ |
| 5278 | -s "Processing of the Certificate handshake message failed" |
| 5279 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5280 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5281 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5282 | "$O_CLI -key data_files/server5.key \ |
| 5283 | -cert data_files/server5.ku-ds.crt" \ |
| 5284 | 0 \ |
| 5285 | -S "bad certificate (usage extensions)" \ |
| 5286 | -S "Processing of the Certificate handshake message failed" |
| 5287 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5288 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5289 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5290 | "$O_CLI -key data_files/server5.key \ |
| 5291 | -cert data_files/server5.ku-ka.crt" \ |
| 5292 | 0 \ |
| 5293 | -s "bad certificate (usage extensions)" \ |
| 5294 | -S "Processing of the Certificate handshake message failed" |
| 5295 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5296 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5297 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5298 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5299 | "$P_SRV key_file=data_files/server5.key \ |
| 5300 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5301 | "$P_CLI" \ |
| 5302 | 0 |
| 5303 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5304 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5305 | "$P_SRV key_file=data_files/server5.key \ |
| 5306 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5307 | "$P_CLI" \ |
| 5308 | 0 |
| 5309 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5310 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5311 | "$P_SRV key_file=data_files/server5.key \ |
| 5312 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5313 | "$P_CLI" \ |
| 5314 | 0 |
| 5315 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5316 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5317 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5318 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5319 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5320 | 1 |
| 5321 | |
| 5322 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5323 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5324 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5325 | "$O_SRV -key data_files/server5.key \ |
| 5326 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5327 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5328 | 0 \ |
| 5329 | -C "bad certificate (usage extensions)" \ |
| 5330 | -C "Processing of the Certificate handshake message failed" \ |
| 5331 | -c "Ciphersuite is TLS-" |
| 5332 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5333 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5334 | "$O_SRV -key data_files/server5.key \ |
| 5335 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5336 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5337 | 0 \ |
| 5338 | -C "bad certificate (usage extensions)" \ |
| 5339 | -C "Processing of the Certificate handshake message failed" \ |
| 5340 | -c "Ciphersuite is TLS-" |
| 5341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5342 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5343 | "$O_SRV -key data_files/server5.key \ |
| 5344 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5345 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5346 | 0 \ |
| 5347 | -C "bad certificate (usage extensions)" \ |
| 5348 | -C "Processing of the Certificate handshake message failed" \ |
| 5349 | -c "Ciphersuite is TLS-" |
| 5350 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5351 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5352 | "$O_SRV -key data_files/server5.key \ |
| 5353 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5354 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5355 | 1 \ |
| 5356 | -c "bad certificate (usage extensions)" \ |
| 5357 | -c "Processing of the Certificate handshake message failed" \ |
| 5358 | -C "Ciphersuite is TLS-" |
| 5359 | |
| 5360 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5361 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5362 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5363 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5364 | "$O_CLI -key data_files/server5.key \ |
| 5365 | -cert data_files/server5.eku-cli.crt" \ |
| 5366 | 0 \ |
| 5367 | -S "bad certificate (usage extensions)" \ |
| 5368 | -S "Processing of the Certificate handshake message failed" |
| 5369 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5370 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5371 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5372 | "$O_CLI -key data_files/server5.key \ |
| 5373 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5374 | 0 \ |
| 5375 | -S "bad certificate (usage extensions)" \ |
| 5376 | -S "Processing of the Certificate handshake message failed" |
| 5377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5378 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5379 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5380 | "$O_CLI -key data_files/server5.key \ |
| 5381 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5382 | 0 \ |
| 5383 | -S "bad certificate (usage extensions)" \ |
| 5384 | -S "Processing of the Certificate handshake message failed" |
| 5385 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5386 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5387 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5388 | "$O_CLI -key data_files/server5.key \ |
| 5389 | -cert data_files/server5.eku-cs.crt" \ |
| 5390 | 0 \ |
| 5391 | -s "bad certificate (usage extensions)" \ |
| 5392 | -S "Processing of the Certificate handshake message failed" |
| 5393 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5394 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5395 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5396 | "$O_CLI -key data_files/server5.key \ |
| 5397 | -cert data_files/server5.eku-cs.crt" \ |
| 5398 | 1 \ |
| 5399 | -s "bad certificate (usage extensions)" \ |
| 5400 | -s "Processing of the Certificate handshake message failed" |
| 5401 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5402 | # Tests for DHM parameters loading |
| 5403 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5404 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5405 | "$P_SRV" \ |
| 5406 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5407 | debug_level=3" \ |
| 5408 | 0 \ |
| 5409 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5410 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5411 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5412 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5413 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5414 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5415 | debug_level=3" \ |
| 5416 | 0 \ |
| 5417 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5418 | -c "value of 'DHM: G ' (2 bits)" |
| 5419 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5420 | # Tests for DHM client-side size checking |
| 5421 | |
| 5422 | run_test "DHM size: server default, client default, OK" \ |
| 5423 | "$P_SRV" \ |
| 5424 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5425 | debug_level=1" \ |
| 5426 | 0 \ |
| 5427 | -C "DHM prime too short:" |
| 5428 | |
| 5429 | run_test "DHM size: server default, client 2048, OK" \ |
| 5430 | "$P_SRV" \ |
| 5431 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5432 | debug_level=1 dhmlen=2048" \ |
| 5433 | 0 \ |
| 5434 | -C "DHM prime too short:" |
| 5435 | |
| 5436 | run_test "DHM size: server 1024, client default, OK" \ |
| 5437 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5438 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5439 | debug_level=1" \ |
| 5440 | 0 \ |
| 5441 | -C "DHM prime too short:" |
| 5442 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5443 | run_test "DHM size: server 999, client 999, OK" \ |
| 5444 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5445 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5446 | debug_level=1 dhmlen=999" \ |
| 5447 | 0 \ |
| 5448 | -C "DHM prime too short:" |
| 5449 | |
| 5450 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5451 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5452 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5453 | debug_level=1 dhmlen=1000" \ |
| 5454 | 0 \ |
| 5455 | -C "DHM prime too short:" |
| 5456 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5457 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5458 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5459 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5460 | debug_level=1" \ |
| 5461 | 1 \ |
| 5462 | -c "DHM prime too short:" |
| 5463 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5464 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5465 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5466 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5467 | debug_level=1 dhmlen=1001" \ |
| 5468 | 1 \ |
| 5469 | -c "DHM prime too short:" |
| 5470 | |
| 5471 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5472 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5473 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5474 | debug_level=1 dhmlen=1000" \ |
| 5475 | 1 \ |
| 5476 | -c "DHM prime too short:" |
| 5477 | |
| 5478 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5479 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5480 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5481 | debug_level=1 dhmlen=999" \ |
| 5482 | 1 \ |
| 5483 | -c "DHM prime too short:" |
| 5484 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5485 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5486 | "$P_SRV" \ |
| 5487 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5488 | debug_level=1 dhmlen=2049" \ |
| 5489 | 1 \ |
| 5490 | -c "DHM prime too short:" |
| 5491 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5492 | # Tests for PSK callback |
| 5493 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5494 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5495 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5496 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5497 | psk_identity=foo psk=abc123" \ |
| 5498 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5499 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5500 | -S "SSL - Unknown identity received" \ |
| 5501 | -S "SSL - Verification of the message MAC failed" |
| 5502 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5503 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5504 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5505 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5506 | "$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] | 5507 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5508 | 0 \ |
| 5509 | -c "skip PMS generation for opaque PSK"\ |
| 5510 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5511 | -C "session hash for extended master secret"\ |
| 5512 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5513 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5514 | -S "SSL - Unknown identity received" \ |
| 5515 | -S "SSL - Verification of the message MAC failed" |
| 5516 | |
| 5517 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5518 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5519 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5520 | "$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] | 5521 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5522 | 0 \ |
| 5523 | -c "skip PMS generation for opaque PSK"\ |
| 5524 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5525 | -C "session hash for extended master secret"\ |
| 5526 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5527 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5528 | -S "SSL - Unknown identity received" \ |
| 5529 | -S "SSL - Verification of the message MAC failed" |
| 5530 | |
| 5531 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5532 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5533 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5534 | "$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] | 5535 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5536 | 0 \ |
| 5537 | -c "skip PMS generation for opaque PSK"\ |
| 5538 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5539 | -c "session hash for extended master secret"\ |
| 5540 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5541 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5542 | -S "SSL - Unknown identity received" \ |
| 5543 | -S "SSL - Verification of the message MAC failed" |
| 5544 | |
| 5545 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5546 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5547 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5548 | "$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] | 5549 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5550 | 0 \ |
| 5551 | -c "skip PMS generation for opaque PSK"\ |
| 5552 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5553 | -c "session hash for extended master secret"\ |
| 5554 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5555 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5556 | -S "SSL - Unknown identity received" \ |
| 5557 | -S "SSL - Verification of the message MAC failed" |
| 5558 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5559 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5560 | 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] | 5561 | "$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] | 5562 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5563 | psk_identity=foo psk=abc123" \ |
| 5564 | 0 \ |
| 5565 | -C "skip PMS generation for opaque PSK"\ |
| 5566 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5567 | -C "session hash for extended master secret"\ |
| 5568 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5569 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5570 | -S "SSL - Unknown identity received" \ |
| 5571 | -S "SSL - Verification of the message MAC failed" |
| 5572 | |
| 5573 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5574 | 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] | 5575 | "$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] | 5576 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5577 | psk_identity=foo psk=abc123" \ |
| 5578 | 0 \ |
| 5579 | -C "skip PMS generation for opaque PSK"\ |
| 5580 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5581 | -C "session hash for extended master secret"\ |
| 5582 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5583 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5584 | -S "SSL - Unknown identity received" \ |
| 5585 | -S "SSL - Verification of the message MAC failed" |
| 5586 | |
| 5587 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5588 | 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] | 5589 | "$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] | 5590 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5591 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5592 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5593 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5594 | -c "session hash for extended master secret"\ |
| 5595 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5596 | -C "skip PMS generation for opaque PSK"\ |
| 5597 | -s "skip PMS generation for opaque PSK"\ |
| 5598 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5599 | -S "SSL - Unknown identity received" \ |
| 5600 | -S "SSL - Verification of the message MAC failed" |
| 5601 | |
| 5602 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5603 | 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] | 5604 | "$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] | 5605 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5606 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5607 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5608 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5609 | -c "session hash for extended master secret"\ |
| 5610 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5611 | -C "skip PMS generation for opaque PSK"\ |
| 5612 | -s "skip PMS generation for opaque PSK"\ |
| 5613 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5614 | -S "SSL - Unknown identity received" \ |
| 5615 | -S "SSL - Verification of the message MAC failed" |
| 5616 | |
| 5617 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5618 | 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] | 5619 | "$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] | 5620 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5621 | psk_identity=def psk=beef" \ |
| 5622 | 0 \ |
| 5623 | -C "skip PMS generation for opaque PSK"\ |
| 5624 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5625 | -C "session hash for extended master secret"\ |
| 5626 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5627 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5628 | -S "SSL - Unknown identity received" \ |
| 5629 | -S "SSL - Verification of the message MAC failed" |
| 5630 | |
| 5631 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5632 | 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] | 5633 | "$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] | 5634 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5635 | psk_identity=def psk=beef" \ |
| 5636 | 0 \ |
| 5637 | -C "skip PMS generation for opaque PSK"\ |
| 5638 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5639 | -C "session hash for extended master secret"\ |
| 5640 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5641 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5642 | -S "SSL - Unknown identity received" \ |
| 5643 | -S "SSL - Verification of the message MAC failed" |
| 5644 | |
| 5645 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5646 | 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] | 5647 | "$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] | 5648 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5649 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5650 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5651 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5652 | -c "session hash for extended master secret"\ |
| 5653 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5654 | -C "skip PMS generation for opaque PSK"\ |
| 5655 | -s "skip PMS generation for opaque PSK"\ |
| 5656 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5657 | -S "SSL - Unknown identity received" \ |
| 5658 | -S "SSL - Verification of the message MAC failed" |
| 5659 | |
| 5660 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5661 | 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] | 5662 | "$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] | 5663 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5664 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5665 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5666 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5667 | -c "session hash for extended master secret"\ |
| 5668 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5669 | -C "skip PMS generation for opaque PSK"\ |
| 5670 | -s "skip PMS generation for opaque PSK"\ |
| 5671 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5672 | -S "SSL - Unknown identity received" \ |
| 5673 | -S "SSL - Verification of the message MAC failed" |
| 5674 | |
| 5675 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5676 | 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] | 5677 | "$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] | 5678 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5679 | psk_identity=def psk=beef" \ |
| 5680 | 0 \ |
| 5681 | -C "skip PMS generation for opaque PSK"\ |
| 5682 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5683 | -C "session hash for extended master secret"\ |
| 5684 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5685 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5686 | -S "SSL - Unknown identity received" \ |
| 5687 | -S "SSL - Verification of the message MAC failed" |
| 5688 | |
| 5689 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5690 | 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] | 5691 | "$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] | 5692 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5693 | psk_identity=def psk=beef" \ |
| 5694 | 0 \ |
| 5695 | -C "skip PMS generation for opaque PSK"\ |
| 5696 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5697 | -C "session hash for extended master secret"\ |
| 5698 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5699 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5700 | -S "SSL - Unknown identity received" \ |
| 5701 | -S "SSL - Verification of the message MAC failed" |
| 5702 | |
| 5703 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5704 | 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] | 5705 | "$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] | 5706 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5707 | psk_identity=def psk=beef" \ |
| 5708 | 0 \ |
| 5709 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5710 | -C "session hash for extended master secret"\ |
| 5711 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5712 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5713 | -S "SSL - Unknown identity received" \ |
| 5714 | -S "SSL - Verification of the message MAC failed" |
| 5715 | |
| 5716 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5717 | 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] | 5718 | "$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] | 5719 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5720 | psk_identity=def psk=beef" \ |
| 5721 | 0 \ |
| 5722 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5723 | -C "session hash for extended master secret"\ |
| 5724 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5725 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5726 | -S "SSL - Unknown identity received" \ |
| 5727 | -S "SSL - Verification of the message MAC failed" |
| 5728 | |
| 5729 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5730 | 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] | 5731 | "$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] | 5732 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5733 | psk_identity=def psk=beef" \ |
| 5734 | 1 \ |
| 5735 | -s "SSL - Verification of the message MAC failed" |
| 5736 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5737 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5738 | "$P_SRV" \ |
| 5739 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5740 | psk_identity=foo psk=abc123" \ |
| 5741 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5742 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5743 | -S "SSL - Unknown identity received" \ |
| 5744 | -S "SSL - Verification of the message MAC failed" |
| 5745 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5746 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5747 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5748 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5749 | psk_identity=foo psk=abc123" \ |
| 5750 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5751 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5752 | -s "SSL - Unknown identity received" \ |
| 5753 | -S "SSL - Verification of the message MAC failed" |
| 5754 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5755 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5756 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5757 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5758 | psk_identity=abc psk=dead" \ |
| 5759 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5760 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5761 | -S "SSL - Unknown identity received" \ |
| 5762 | -S "SSL - Verification of the message MAC failed" |
| 5763 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5764 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5765 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5766 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5767 | psk_identity=def psk=beef" \ |
| 5768 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5769 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5770 | -S "SSL - Unknown identity received" \ |
| 5771 | -S "SSL - Verification of the message MAC failed" |
| 5772 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5773 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5774 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5775 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5776 | psk_identity=ghi psk=beef" \ |
| 5777 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5778 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5779 | -s "SSL - Unknown identity received" \ |
| 5780 | -S "SSL - Verification of the message MAC failed" |
| 5781 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5782 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5783 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5784 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5785 | psk_identity=abc psk=beef" \ |
| 5786 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5787 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5788 | -S "SSL - Unknown identity received" \ |
| 5789 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5790 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5791 | # Tests for EC J-PAKE |
| 5792 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5793 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5794 | run_test "ECJPAKE: client not configured" \ |
| 5795 | "$P_SRV debug_level=3" \ |
| 5796 | "$P_CLI debug_level=3" \ |
| 5797 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5798 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5799 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5800 | -S "found ecjpake kkpp extension" \ |
| 5801 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5802 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5803 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5804 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5805 | -S "None of the common ciphersuites is usable" |
| 5806 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5807 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5808 | run_test "ECJPAKE: server not configured" \ |
| 5809 | "$P_SRV debug_level=3" \ |
| 5810 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5811 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5812 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5813 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5814 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5815 | -s "found ecjpake kkpp extension" \ |
| 5816 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5817 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5818 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5819 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5820 | -s "None of the common ciphersuites is usable" |
| 5821 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5822 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5823 | run_test "ECJPAKE: working, TLS" \ |
| 5824 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5825 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5826 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5827 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5828 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5829 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5830 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5831 | -s "found ecjpake kkpp extension" \ |
| 5832 | -S "skip ecjpake kkpp extension" \ |
| 5833 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5834 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5835 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5836 | -S "None of the common ciphersuites is usable" \ |
| 5837 | -S "SSL - Verification of the message MAC failed" |
| 5838 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5839 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5840 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5841 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5842 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5843 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5844 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5845 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5846 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5847 | -s "SSL - Verification of the message MAC failed" |
| 5848 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5849 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5850 | run_test "ECJPAKE: working, DTLS" \ |
| 5851 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5852 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5853 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5854 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5855 | -c "re-using cached ecjpake parameters" \ |
| 5856 | -S "SSL - Verification of the message MAC failed" |
| 5857 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5858 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5859 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5860 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5861 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5862 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5863 | 0 \ |
| 5864 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5865 | -S "SSL - Verification of the message MAC failed" |
| 5866 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5867 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5868 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5869 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5870 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5871 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5872 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5873 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5874 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5875 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5876 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5877 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5878 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5879 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5880 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5881 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5882 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5883 | 0 |
| 5884 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5885 | # Tests for ciphersuites per version |
| 5886 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5888 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5889 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5890 | run_test "Per-version suites: TLS 1.0" \ |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 5891 | "$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] | 5892 | "$P_CLI force_version=tls1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5893 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5894 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5895 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5897 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5898 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5899 | run_test "Per-version suites: TLS 1.1" \ |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 5900 | "$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] | 5901 | "$P_CLI force_version=tls1_1" \ |
| 5902 | 0 \ |
| 5903 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5904 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5905 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5906 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5907 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5908 | run_test "Per-version suites: TLS 1.2" \ |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 5909 | "$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] | 5910 | "$P_CLI force_version=tls1_2" \ |
| 5911 | 0 \ |
| 5912 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5913 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5914 | # Test for ClientHello without extensions |
| 5915 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5916 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5917 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5918 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5919 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5920 | 0 \ |
| 5921 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5922 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5923 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5924 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5925 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5926 | "$P_SRV" \ |
| 5927 | "$P_CLI request_size=100" \ |
| 5928 | 0 \ |
| 5929 | -s "Read from client: 100 bytes read$" |
| 5930 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5931 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5932 | "$P_SRV" \ |
| 5933 | "$P_CLI request_size=500" \ |
| 5934 | 0 \ |
| 5935 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5936 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5937 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5938 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5939 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5940 | "$P_SRV" \ |
| 5941 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5942 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5943 | 0 \ |
| 5944 | -s "Read from client: 1 bytes read" |
| 5945 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5946 | 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] | 5947 | "$P_SRV" \ |
| 5948 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5949 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5950 | 0 \ |
| 5951 | -s "Read from client: 1 bytes read" |
| 5952 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5953 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5954 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5955 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5956 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5957 | 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] | 5958 | 0 \ |
| 5959 | -s "Read from client: 1 bytes read" |
| 5960 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5961 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5962 | 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] | 5963 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5964 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5965 | 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] | 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.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5970 | "$P_SRV" \ |
| 5971 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5972 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 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.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 5977 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5978 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5979 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5980 | 0 \ |
| 5981 | -s "Read from client: 1 bytes read" |
| 5982 | |
| 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.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5985 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5986 | "$P_CLI request_size=1 force_version=tls1_1 \ |
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" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5988 | 0 \ |
| 5989 | -s "Read from client: 1 bytes read" |
| 5990 | |
| 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.1 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_1 \ |
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 | 169dd6a | 2014-11-04 16:15:39 +0100 | [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 BlockCipher" \ |
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-CBC-SHA" \ |
| 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 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6007 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6008 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6009 | 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] | 6010 | 0 \ |
| 6011 | -s "Read from client: 1 bytes read" |
| 6012 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6013 | 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] | 6014 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6015 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6016 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6017 | 0 \ |
| 6018 | -s "Read from client: 1 bytes read" |
| 6019 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6020 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6021 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6022 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6023 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6024 | 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] | 6025 | 0 \ |
| 6026 | -s "Read from client: 1 bytes read" |
| 6027 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6028 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6029 | 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] | 6030 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6031 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6032 | 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] | 6033 | 0 \ |
| 6034 | -s "Read from client: 1 bytes read" |
| 6035 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6036 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6037 | "$P_SRV" \ |
| 6038 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6039 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6040 | 0 \ |
| 6041 | -s "Read from client: 1 bytes read" |
| 6042 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6043 | 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] | 6044 | "$P_SRV" \ |
| 6045 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6046 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6047 | 0 \ |
| 6048 | -s "Read from client: 1 bytes read" |
| 6049 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6050 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6051 | |
| 6052 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6053 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6054 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6055 | "$P_CLI dtls=1 request_size=1 \ |
| 6056 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6057 | 0 \ |
| 6058 | -s "Read from client: 1 bytes read" |
| 6059 | |
| 6060 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6061 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6062 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6063 | "$P_CLI dtls=1 request_size=1 \ |
| 6064 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6065 | 0 \ |
| 6066 | -s "Read from client: 1 bytes read" |
| 6067 | |
| 6068 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6069 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6070 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6071 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6072 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6073 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6074 | 0 \ |
| 6075 | -s "Read from client: 1 bytes read" |
| 6076 | |
| 6077 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6078 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6079 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6080 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6081 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6082 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6083 | 0 \ |
| 6084 | -s "Read from client: 1 bytes read" |
| 6085 | |
| 6086 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6087 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6088 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 6089 | "$P_CLI dtls=1 request_size=1 \ |
| 6090 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6091 | 0 \ |
| 6092 | -s "Read from client: 1 bytes read" |
| 6093 | |
| 6094 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6095 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6096 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6097 | "$P_CLI dtls=1 request_size=1 \ |
| 6098 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6099 | 0 \ |
| 6100 | -s "Read from client: 1 bytes read" |
| 6101 | |
| 6102 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6103 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6104 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6105 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6106 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6107 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6108 | 0 \ |
| 6109 | -s "Read from client: 1 bytes read" |
| 6110 | |
| 6111 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6112 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6113 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6114 | "$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] | 6115 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6116 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6117 | 0 \ |
| 6118 | -s "Read from client: 1 bytes read" |
| 6119 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6120 | # Tests for small server packets |
| 6121 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6122 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6123 | "$P_SRV response_size=1" \ |
| 6124 | "$P_CLI force_version=tls1 \ |
| 6125 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6126 | 0 \ |
| 6127 | -c "Read from server: 1 bytes read" |
| 6128 | |
| 6129 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6130 | "$P_SRV response_size=1" \ |
| 6131 | "$P_CLI force_version=tls1 etm=0 \ |
| 6132 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6133 | 0 \ |
| 6134 | -c "Read from server: 1 bytes read" |
| 6135 | |
| 6136 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6137 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6138 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6139 | "$P_CLI force_version=tls1 \ |
| 6140 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6141 | 0 \ |
| 6142 | -c "Read from server: 1 bytes read" |
| 6143 | |
| 6144 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6145 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6146 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6147 | "$P_CLI force_version=tls1 \ |
| 6148 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6149 | 0 \ |
| 6150 | -c "Read from server: 1 bytes read" |
| 6151 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6152 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6153 | "$P_SRV response_size=1" \ |
| 6154 | "$P_CLI force_version=tls1_1 \ |
| 6155 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6156 | 0 \ |
| 6157 | -c "Read from server: 1 bytes read" |
| 6158 | |
| 6159 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6160 | "$P_SRV response_size=1" \ |
| 6161 | "$P_CLI force_version=tls1_1 \ |
| 6162 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 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.1 BlockCipher, truncated MAC" \ |
| 6168 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6169 | "$P_CLI force_version=tls1_1 \ |
| 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.1 BlockCipher, without EtM, truncated MAC" \ |
| 6176 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6177 | "$P_CLI force_version=tls1_1 \ |
| 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 BlockCipher" \ |
| 6183 | "$P_SRV response_size=1" \ |
| 6184 | "$P_CLI force_version=tls1_2 \ |
| 6185 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6186 | 0 \ |
| 6187 | -c "Read from server: 1 bytes read" |
| 6188 | |
| 6189 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6190 | "$P_SRV response_size=1" \ |
| 6191 | "$P_CLI force_version=tls1_2 \ |
| 6192 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6193 | 0 \ |
| 6194 | -c "Read from server: 1 bytes read" |
| 6195 | |
| 6196 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6197 | "$P_SRV response_size=1" \ |
| 6198 | "$P_CLI force_version=tls1_2 \ |
| 6199 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6200 | 0 \ |
| 6201 | -c "Read from server: 1 bytes read" |
| 6202 | |
| 6203 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6204 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6205 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6206 | "$P_CLI force_version=tls1_2 \ |
| 6207 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6208 | 0 \ |
| 6209 | -c "Read from server: 1 bytes read" |
| 6210 | |
| 6211 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6212 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6213 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6214 | "$P_CLI force_version=tls1_2 \ |
| 6215 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6216 | 0 \ |
| 6217 | -c "Read from server: 1 bytes read" |
| 6218 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6219 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6220 | "$P_SRV response_size=1" \ |
| 6221 | "$P_CLI force_version=tls1_2 \ |
| 6222 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6223 | 0 \ |
| 6224 | -c "Read from server: 1 bytes read" |
| 6225 | |
| 6226 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6227 | "$P_SRV response_size=1" \ |
| 6228 | "$P_CLI force_version=tls1_2 \ |
| 6229 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6230 | 0 \ |
| 6231 | -c "Read from server: 1 bytes read" |
| 6232 | |
| 6233 | # Tests for small server packets in DTLS |
| 6234 | |
| 6235 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6236 | run_test "Small server packet DTLS 1.0" \ |
| 6237 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6238 | "$P_CLI dtls=1 \ |
| 6239 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6240 | 0 \ |
| 6241 | -c "Read from server: 1 bytes read" |
| 6242 | |
| 6243 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6244 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6245 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6246 | "$P_CLI dtls=1 \ |
| 6247 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6248 | 0 \ |
| 6249 | -c "Read from server: 1 bytes read" |
| 6250 | |
| 6251 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6252 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6253 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6254 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6255 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6256 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6257 | 0 \ |
| 6258 | -c "Read from server: 1 bytes read" |
| 6259 | |
| 6260 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6261 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6262 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6263 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6264 | "$P_CLI dtls=1 \ |
| 6265 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6266 | 0 \ |
| 6267 | -c "Read from server: 1 bytes read" |
| 6268 | |
| 6269 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6270 | run_test "Small server packet DTLS 1.2" \ |
| 6271 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6272 | "$P_CLI dtls=1 \ |
| 6273 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6274 | 0 \ |
| 6275 | -c "Read from server: 1 bytes read" |
| 6276 | |
| 6277 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6278 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6279 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6280 | "$P_CLI dtls=1 \ |
| 6281 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6282 | 0 \ |
| 6283 | -c "Read from server: 1 bytes read" |
| 6284 | |
| 6285 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6286 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6287 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6288 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6289 | "$P_CLI dtls=1 \ |
| 6290 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6291 | 0 \ |
| 6292 | -c "Read from server: 1 bytes read" |
| 6293 | |
| 6294 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6295 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6296 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6297 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6298 | "$P_CLI dtls=1 \ |
| 6299 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6300 | 0 \ |
| 6301 | -c "Read from server: 1 bytes read" |
| 6302 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6303 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6304 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6305 | # How many fragments do we expect to write $1 bytes? |
| 6306 | fragments_for_write() { |
| 6307 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6308 | } |
| 6309 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6310 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6311 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6312 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6313 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6314 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6315 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6316 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6317 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6318 | 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] | 6319 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6320 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6321 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6322 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6323 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6324 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6325 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6326 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6327 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6328 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6329 | 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] | 6330 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6331 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6332 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6333 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6334 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6335 | 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] | 6336 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6337 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6338 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6339 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6340 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6341 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6342 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6343 | "$P_SRV" \ |
| 6344 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6345 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6346 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6347 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6348 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6349 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6350 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6351 | "$P_SRV" \ |
| 6352 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6353 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6354 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6355 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6356 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6357 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6358 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6359 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6360 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6361 | 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] | 6362 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6363 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6364 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6365 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6366 | 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] | 6367 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6368 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6369 | 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] | 6370 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6371 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6372 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6373 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6374 | "$P_SRV" \ |
| 6375 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6376 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6377 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6378 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6379 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6380 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6381 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6382 | "$P_SRV" \ |
| 6383 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6384 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6385 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6386 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6387 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6388 | 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] | 6389 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6390 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6391 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6392 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6393 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6394 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6395 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6396 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6397 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6398 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6399 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6400 | 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] | 6401 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6402 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6403 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6404 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6405 | 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] | 6406 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6407 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6408 | 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] | 6409 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6410 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6411 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6412 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6413 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6414 | "$P_SRV" \ |
| 6415 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6416 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6417 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6418 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6419 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6420 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6421 | 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] | 6422 | "$P_SRV" \ |
| 6423 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6424 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6425 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6426 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6427 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6428 | |
Mateusz Starzyk | 06b07fb | 2021-02-18 13:55:21 +0100 | [diff] [blame] | 6429 | # Checking next 3 tests logs for 1n-1 split against BEAST too |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6430 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6431 | "$P_SRV response_size=16384" \ |
| 6432 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6433 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6434 | 0 \ |
| 6435 | -c "Read from server: 1 bytes read"\ |
| 6436 | -c "16383 bytes read"\ |
| 6437 | -C "Read from server: 16384 bytes read" |
| 6438 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6439 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6440 | "$P_SRV response_size=16384" \ |
| 6441 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6442 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6443 | 0 \ |
| 6444 | -c "Read from server: 1 bytes read"\ |
| 6445 | -c "16383 bytes read"\ |
| 6446 | -C "Read from server: 16384 bytes read" |
| 6447 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6448 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6449 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6450 | "$P_SRV response_size=16384" \ |
| 6451 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6452 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6453 | trunc_hmac=1" \ |
| 6454 | 0 \ |
| 6455 | -c "Read from server: 1 bytes read"\ |
| 6456 | -c "16383 bytes read"\ |
| 6457 | -C "Read from server: 16384 bytes read" |
| 6458 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6459 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6460 | "$P_SRV response_size=16384" \ |
| 6461 | "$P_CLI force_version=tls1_1 \ |
| 6462 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6463 | 0 \ |
| 6464 | -c "Read from server: 16384 bytes read" |
| 6465 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6466 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6467 | "$P_SRV response_size=16384" \ |
| 6468 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6469 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6470 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6471 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6472 | -c "Read from server: 16384 bytes read" |
| 6473 | |
| 6474 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6475 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6476 | "$P_SRV response_size=16384" \ |
| 6477 | "$P_CLI force_version=tls1_1 \ |
| 6478 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6479 | trunc_hmac=1" \ |
| 6480 | 0 \ |
| 6481 | -c "Read from server: 16384 bytes read" |
| 6482 | |
| 6483 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6484 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6485 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6486 | "$P_CLI force_version=tls1_1 \ |
| 6487 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6488 | 0 \ |
| 6489 | -s "16384 bytes written in 1 fragments" \ |
| 6490 | -c "Read from server: 16384 bytes read" |
| 6491 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6492 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6493 | "$P_SRV response_size=16384" \ |
| 6494 | "$P_CLI force_version=tls1_2 \ |
| 6495 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6496 | 0 \ |
| 6497 | -c "Read from server: 16384 bytes read" |
| 6498 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6499 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6500 | "$P_SRV response_size=16384" \ |
| 6501 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6502 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6503 | 0 \ |
| 6504 | -s "16384 bytes written in 1 fragments" \ |
| 6505 | -c "Read from server: 16384 bytes read" |
| 6506 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6507 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6508 | "$P_SRV response_size=16384" \ |
| 6509 | "$P_CLI force_version=tls1_2 \ |
| 6510 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6511 | 0 \ |
| 6512 | -c "Read from server: 16384 bytes read" |
| 6513 | |
| 6514 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6515 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6516 | "$P_SRV response_size=16384" \ |
| 6517 | "$P_CLI force_version=tls1_2 \ |
| 6518 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6519 | trunc_hmac=1" \ |
| 6520 | 0 \ |
| 6521 | -c "Read from server: 16384 bytes read" |
| 6522 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6523 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6524 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6525 | "$P_CLI force_version=tls1_2 \ |
| 6526 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6527 | 0 \ |
| 6528 | -s "16384 bytes written in 1 fragments" \ |
| 6529 | -c "Read from server: 16384 bytes read" |
| 6530 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6531 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6532 | "$P_SRV response_size=16384" \ |
| 6533 | "$P_CLI force_version=tls1_2 \ |
| 6534 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6535 | 0 \ |
| 6536 | -c "Read from server: 16384 bytes read" |
| 6537 | |
| 6538 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6539 | "$P_SRV response_size=16384" \ |
| 6540 | "$P_CLI force_version=tls1_2 \ |
| 6541 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6542 | 0 \ |
| 6543 | -c "Read from server: 16384 bytes read" |
| 6544 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6545 | # Tests for restartable ECC |
| 6546 | |
| 6547 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6548 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6549 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6550 | "$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] | 6551 | 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] | 6552 | debug_level=1" \ |
| 6553 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6554 | -C "x509_verify_cert.*4b00" \ |
| 6555 | -C "mbedtls_pk_verify.*4b00" \ |
| 6556 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6557 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6558 | |
| 6559 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6560 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6561 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6562 | "$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] | 6563 | 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] | 6564 | debug_level=1 ec_max_ops=0" \ |
| 6565 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6566 | -C "x509_verify_cert.*4b00" \ |
| 6567 | -C "mbedtls_pk_verify.*4b00" \ |
| 6568 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6569 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6570 | |
| 6571 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6572 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6573 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6574 | "$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] | 6575 | 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] | 6576 | debug_level=1 ec_max_ops=65535" \ |
| 6577 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6578 | -C "x509_verify_cert.*4b00" \ |
| 6579 | -C "mbedtls_pk_verify.*4b00" \ |
| 6580 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6581 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6582 | |
| 6583 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6584 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6585 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6586 | "$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] | 6587 | 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] | 6588 | debug_level=1 ec_max_ops=1000" \ |
| 6589 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6590 | -c "x509_verify_cert.*4b00" \ |
| 6591 | -c "mbedtls_pk_verify.*4b00" \ |
| 6592 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6593 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6594 | |
| 6595 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6596 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 6597 | "$P_SRV auth_mode=required \ |
| 6598 | crt_file=data_files/server5-badsign.crt \ |
| 6599 | key_file=data_files/server5.key" \ |
| 6600 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6601 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6602 | debug_level=1 ec_max_ops=1000" \ |
| 6603 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6604 | -c "x509_verify_cert.*4b00" \ |
| 6605 | -C "mbedtls_pk_verify.*4b00" \ |
| 6606 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6607 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6608 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6609 | -c "! mbedtls_ssl_handshake returned" \ |
| 6610 | -c "X509 - Certificate verification failed" |
| 6611 | |
| 6612 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6613 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 6614 | "$P_SRV auth_mode=required \ |
| 6615 | crt_file=data_files/server5-badsign.crt \ |
| 6616 | key_file=data_files/server5.key" \ |
| 6617 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6618 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6619 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6620 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6621 | -c "x509_verify_cert.*4b00" \ |
| 6622 | -c "mbedtls_pk_verify.*4b00" \ |
| 6623 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6624 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6625 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6626 | -C "! mbedtls_ssl_handshake returned" \ |
| 6627 | -C "X509 - Certificate verification failed" |
| 6628 | |
| 6629 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6630 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6631 | "$P_SRV auth_mode=required \ |
| 6632 | crt_file=data_files/server5-badsign.crt \ |
| 6633 | key_file=data_files/server5.key" \ |
| 6634 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6635 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6636 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 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 | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6642 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6643 | -C "! mbedtls_ssl_handshake returned" \ |
| 6644 | -C "X509 - Certificate verification failed" |
| 6645 | |
| 6646 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6647 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6648 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6649 | "$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] | 6650 | 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] | 6651 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6652 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6653 | -c "x509_verify_cert.*4b00" \ |
| 6654 | -c "mbedtls_pk_verify.*4b00" \ |
| 6655 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6656 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6657 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6658 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6659 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6660 | "$P_SRV" \ |
| 6661 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6662 | debug_level=1 ec_max_ops=1000" \ |
| 6663 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6664 | -c "x509_verify_cert.*4b00" \ |
| 6665 | -c "mbedtls_pk_verify.*4b00" \ |
| 6666 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6667 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6668 | |
| 6669 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6670 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6671 | "$P_SRV psk=abc123" \ |
| 6672 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6673 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6674 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6675 | -C "x509_verify_cert.*4b00" \ |
| 6676 | -C "mbedtls_pk_verify.*4b00" \ |
| 6677 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6678 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6679 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6680 | # Tests of asynchronous private key support in SSL |
| 6681 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6682 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6683 | run_test "SSL async private: sign, delay=0" \ |
| 6684 | "$P_SRV \ |
| 6685 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6686 | "$P_CLI" \ |
| 6687 | 0 \ |
| 6688 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6689 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6690 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6691 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6692 | run_test "SSL async private: sign, delay=1" \ |
| 6693 | "$P_SRV \ |
| 6694 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6695 | "$P_CLI" \ |
| 6696 | 0 \ |
| 6697 | -s "Async sign callback: using key slot " \ |
| 6698 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6699 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6700 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6701 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6702 | run_test "SSL async private: sign, delay=2" \ |
| 6703 | "$P_SRV \ |
| 6704 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6705 | "$P_CLI" \ |
| 6706 | 0 \ |
| 6707 | -s "Async sign callback: using key slot " \ |
| 6708 | -U "Async sign callback: using key slot " \ |
| 6709 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6710 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6711 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6712 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6713 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6714 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6715 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6717 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6718 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6719 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6720 | "$P_CLI force_version=tls1_1" \ |
| 6721 | 0 \ |
| 6722 | -s "Async sign callback: using key slot " \ |
| 6723 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6724 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6725 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6726 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6727 | run_test "SSL async private: sign, SNI" \ |
| 6728 | "$P_SRV debug_level=3 \ |
| 6729 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6730 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6731 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6732 | "$P_CLI server_name=polarssl.example" \ |
| 6733 | 0 \ |
| 6734 | -s "Async sign callback: using key slot " \ |
| 6735 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6736 | -s "parse ServerName extension" \ |
| 6737 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6738 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6739 | |
| 6740 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6741 | run_test "SSL async private: decrypt, delay=0" \ |
| 6742 | "$P_SRV \ |
| 6743 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6744 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6745 | 0 \ |
| 6746 | -s "Async decrypt callback: using key slot " \ |
| 6747 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6748 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6749 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6750 | run_test "SSL async private: decrypt, delay=1" \ |
| 6751 | "$P_SRV \ |
| 6752 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6753 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6754 | 0 \ |
| 6755 | -s "Async decrypt callback: using key slot " \ |
| 6756 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6757 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6758 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6759 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6760 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6761 | "$P_SRV psk=abc123 \ |
| 6762 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6763 | "$P_CLI psk=abc123 \ |
| 6764 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6765 | 0 \ |
| 6766 | -s "Async decrypt callback: using key slot " \ |
| 6767 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6768 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6769 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6770 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6771 | "$P_SRV psk=abc123 \ |
| 6772 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6773 | "$P_CLI psk=abc123 \ |
| 6774 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6775 | 0 \ |
| 6776 | -s "Async decrypt callback: using key slot " \ |
| 6777 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6778 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6779 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6780 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6781 | run_test "SSL async private: sign callback not present" \ |
| 6782 | "$P_SRV \ |
| 6783 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6784 | "$P_CLI; [ \$? -eq 1 ] && |
| 6785 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6786 | 0 \ |
| 6787 | -S "Async sign callback" \ |
| 6788 | -s "! mbedtls_ssl_handshake returned" \ |
| 6789 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6790 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6791 | -s "Successful connection" |
| 6792 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6793 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6794 | run_test "SSL async private: decrypt callback not present" \ |
| 6795 | "$P_SRV debug_level=1 \ |
| 6796 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6797 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6798 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6799 | 0 \ |
| 6800 | -S "Async decrypt callback" \ |
| 6801 | -s "! mbedtls_ssl_handshake returned" \ |
| 6802 | -s "got no RSA private key" \ |
| 6803 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6804 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6805 | |
| 6806 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6807 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6808 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6809 | "$P_SRV \ |
| 6810 | async_operations=s async_private_delay1=1 \ |
| 6811 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6812 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6813 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6814 | 0 \ |
| 6815 | -s "Async sign callback: using key slot 0," \ |
| 6816 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6817 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6818 | |
| 6819 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6820 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6821 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6822 | "$P_SRV \ |
| 6823 | async_operations=s async_private_delay2=1 \ |
| 6824 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6825 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6826 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6827 | 0 \ |
| 6828 | -s "Async sign callback: using key slot 0," \ |
| 6829 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6830 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6831 | |
| 6832 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6833 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6834 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6835 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6836 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6837 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6838 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6839 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6840 | 0 \ |
| 6841 | -s "Async sign callback: using key slot 1," \ |
| 6842 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6843 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6844 | |
| 6845 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6846 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6847 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6848 | "$P_SRV \ |
| 6849 | async_operations=s async_private_delay1=1 \ |
| 6850 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6851 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6852 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6853 | 0 \ |
| 6854 | -s "Async sign callback: no key matches this certificate." |
| 6855 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6856 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6857 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6858 | "$P_SRV \ |
| 6859 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6860 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6861 | "$P_CLI" \ |
| 6862 | 1 \ |
| 6863 | -s "Async sign callback: injected error" \ |
| 6864 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6865 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6866 | -s "! mbedtls_ssl_handshake returned" |
| 6867 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6868 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6869 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6870 | "$P_SRV \ |
| 6871 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6872 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6873 | "$P_CLI" \ |
| 6874 | 1 \ |
| 6875 | -s "Async sign callback: using key slot " \ |
| 6876 | -S "Async resume" \ |
| 6877 | -s "Async cancel" |
| 6878 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6879 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6880 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6881 | "$P_SRV \ |
| 6882 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6883 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6884 | "$P_CLI" \ |
| 6885 | 1 \ |
| 6886 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6887 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6888 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6889 | -s "! mbedtls_ssl_handshake returned" |
| 6890 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6891 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6892 | run_test "SSL async private: decrypt, error in start" \ |
| 6893 | "$P_SRV \ |
| 6894 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6895 | async_private_error=1" \ |
| 6896 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6897 | 1 \ |
| 6898 | -s "Async decrypt callback: injected error" \ |
| 6899 | -S "Async resume" \ |
| 6900 | -S "Async cancel" \ |
| 6901 | -s "! mbedtls_ssl_handshake returned" |
| 6902 | |
| 6903 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6904 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6905 | "$P_SRV \ |
| 6906 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6907 | async_private_error=2" \ |
| 6908 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6909 | 1 \ |
| 6910 | -s "Async decrypt callback: using key slot " \ |
| 6911 | -S "Async resume" \ |
| 6912 | -s "Async cancel" |
| 6913 | |
| 6914 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6915 | run_test "SSL async private: decrypt, error in resume" \ |
| 6916 | "$P_SRV \ |
| 6917 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6918 | async_private_error=3" \ |
| 6919 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6920 | 1 \ |
| 6921 | -s "Async decrypt callback: using key slot " \ |
| 6922 | -s "Async resume callback: decrypt done but injected error" \ |
| 6923 | -S "Async cancel" \ |
| 6924 | -s "! mbedtls_ssl_handshake returned" |
| 6925 | |
| 6926 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6927 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6928 | "$P_SRV \ |
| 6929 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6930 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6931 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6932 | 0 \ |
| 6933 | -s "Async cancel" \ |
| 6934 | -s "! mbedtls_ssl_handshake returned" \ |
| 6935 | -s "Async resume" \ |
| 6936 | -s "Successful connection" |
| 6937 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6938 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6939 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6940 | "$P_SRV \ |
| 6941 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6942 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6943 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6944 | 0 \ |
| 6945 | -s "! mbedtls_ssl_handshake returned" \ |
| 6946 | -s "Async resume" \ |
| 6947 | -s "Successful connection" |
| 6948 | |
| 6949 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6950 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6951 | 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] | 6952 | "$P_SRV \ |
| 6953 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6954 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6955 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6956 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6957 | [ \$? -eq 1 ] && |
| 6958 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6959 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6960 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6961 | -S "Async resume" \ |
| 6962 | -s "Async cancel" \ |
| 6963 | -s "! mbedtls_ssl_handshake returned" \ |
| 6964 | -s "Async sign callback: no key matches this certificate." \ |
| 6965 | -s "Successful connection" |
| 6966 | |
| 6967 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6968 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6969 | 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] | 6970 | "$P_SRV \ |
| 6971 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6972 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6973 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6974 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6975 | [ \$? -eq 1 ] && |
| 6976 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6977 | 0 \ |
| 6978 | -s "Async resume" \ |
| 6979 | -s "! mbedtls_ssl_handshake returned" \ |
| 6980 | -s "Async sign callback: no key matches this certificate." \ |
| 6981 | -s "Successful connection" |
| 6982 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6983 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6984 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6985 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6986 | "$P_SRV \ |
| 6987 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6988 | exchanges=2 renegotiation=1" \ |
| 6989 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6990 | 0 \ |
| 6991 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6992 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6993 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6994 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6995 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6996 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6997 | "$P_SRV \ |
| 6998 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6999 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7000 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7001 | 0 \ |
| 7002 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7003 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7004 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7005 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7006 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7007 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7008 | "$P_SRV \ |
| 7009 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7010 | exchanges=2 renegotiation=1" \ |
| 7011 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7012 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7013 | 0 \ |
| 7014 | -s "Async decrypt callback: using key slot " \ |
| 7015 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7016 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7017 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7018 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7019 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7020 | "$P_SRV \ |
| 7021 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7022 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7023 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7024 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7025 | 0 \ |
| 7026 | -s "Async decrypt callback: using key slot " \ |
| 7027 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7028 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7029 | # Tests for ECC extensions (rfc 4492) |
| 7030 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7031 | requires_config_enabled MBEDTLS_AES_C |
| 7032 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7033 | requires_config_enabled MBEDTLS_SHA256_C |
| 7034 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7035 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7036 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7037 | "$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] | 7038 | 0 \ |
| 7039 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7040 | -C "client hello, adding supported_point_formats extension" \ |
| 7041 | -S "found supported elliptic curves extension" \ |
| 7042 | -S "found supported point formats extension" |
| 7043 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7044 | requires_config_enabled MBEDTLS_AES_C |
| 7045 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7046 | requires_config_enabled MBEDTLS_SHA256_C |
| 7047 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7048 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7049 | "$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] | 7050 | "$P_CLI debug_level=3" \ |
| 7051 | 0 \ |
| 7052 | -C "found supported_point_formats extension" \ |
| 7053 | -S "server hello, supported_point_formats extension" |
| 7054 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7055 | requires_config_enabled MBEDTLS_AES_C |
| 7056 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7057 | requires_config_enabled MBEDTLS_SHA256_C |
| 7058 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7059 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7060 | "$P_SRV debug_level=3" \ |
| 7061 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7062 | 0 \ |
| 7063 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7064 | -c "client hello, adding supported_point_formats extension" \ |
| 7065 | -s "found supported elliptic curves extension" \ |
| 7066 | -s "found supported point formats extension" |
| 7067 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7068 | requires_config_enabled MBEDTLS_AES_C |
| 7069 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7070 | requires_config_enabled MBEDTLS_SHA256_C |
| 7071 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7072 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7073 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7074 | "$P_CLI debug_level=3" \ |
| 7075 | 0 \ |
| 7076 | -c "found supported_point_formats extension" \ |
| 7077 | -s "server hello, supported_point_formats extension" |
| 7078 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7079 | # Tests for DTLS HelloVerifyRequest |
| 7080 | |
| 7081 | run_test "DTLS cookie: enabled" \ |
| 7082 | "$P_SRV dtls=1 debug_level=2" \ |
| 7083 | "$P_CLI dtls=1 debug_level=2" \ |
| 7084 | 0 \ |
| 7085 | -s "cookie verification failed" \ |
| 7086 | -s "cookie verification passed" \ |
| 7087 | -S "cookie verification skipped" \ |
| 7088 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7089 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7090 | -S "SSL - The requested feature is not available" |
| 7091 | |
| 7092 | run_test "DTLS cookie: disabled" \ |
| 7093 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7094 | "$P_CLI dtls=1 debug_level=2" \ |
| 7095 | 0 \ |
| 7096 | -S "cookie verification failed" \ |
| 7097 | -S "cookie verification passed" \ |
| 7098 | -s "cookie verification skipped" \ |
| 7099 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7100 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7101 | -S "SSL - The requested feature is not available" |
| 7102 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7103 | run_test "DTLS cookie: default (failing)" \ |
| 7104 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7105 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7106 | 1 \ |
| 7107 | -s "cookie verification failed" \ |
| 7108 | -S "cookie verification passed" \ |
| 7109 | -S "cookie verification skipped" \ |
| 7110 | -C "received hello verify request" \ |
| 7111 | -S "hello verification requested" \ |
| 7112 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7113 | |
| 7114 | requires_ipv6 |
| 7115 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7116 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7117 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7118 | 0 \ |
| 7119 | -s "cookie verification failed" \ |
| 7120 | -s "cookie verification passed" \ |
| 7121 | -S "cookie verification skipped" \ |
| 7122 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7123 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7124 | -S "SSL - The requested feature is not available" |
| 7125 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7126 | run_test "DTLS cookie: enabled, nbio" \ |
| 7127 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7128 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7129 | 0 \ |
| 7130 | -s "cookie verification failed" \ |
| 7131 | -s "cookie verification passed" \ |
| 7132 | -S "cookie verification skipped" \ |
| 7133 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7134 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7135 | -S "SSL - The requested feature is not available" |
| 7136 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7137 | # Tests for client reconnecting from the same port with DTLS |
| 7138 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7139 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7140 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7141 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7142 | "$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] | 7143 | 0 \ |
| 7144 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7145 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7146 | -S "Client initiated reconnection from same port" |
| 7147 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7148 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7149 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7150 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7151 | "$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] | 7152 | 0 \ |
| 7153 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7154 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7155 | -s "Client initiated reconnection from same port" |
| 7156 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7157 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7158 | 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] | 7159 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7160 | "$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] | 7161 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7162 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7163 | -s "Client initiated reconnection from same port" |
| 7164 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7165 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7166 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7167 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7168 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7169 | 0 \ |
| 7170 | -S "The operation timed out" \ |
| 7171 | -s "Client initiated reconnection from same port" |
| 7172 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7173 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7174 | "$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] | 7175 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7176 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7177 | -s "The operation timed out" \ |
| 7178 | -S "Client initiated reconnection from same port" |
| 7179 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7180 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7181 | -p "$P_PXY inject_clihlo=1" \ |
| 7182 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7183 | "$P_CLI dtls=1 exchanges=2" \ |
| 7184 | 0 \ |
| 7185 | -s "possible client reconnect from the same port" \ |
| 7186 | -S "Client initiated reconnection from same port" |
| 7187 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7188 | # Tests for various cases of client authentication with DTLS |
| 7189 | # (focused on handshake flows and message parsing) |
| 7190 | |
| 7191 | run_test "DTLS client auth: required" \ |
| 7192 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7193 | "$P_CLI dtls=1" \ |
| 7194 | 0 \ |
| 7195 | -s "Verifying peer X.509 certificate... ok" |
| 7196 | |
| 7197 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7198 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7199 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7200 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7201 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7202 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7203 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7204 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7205 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7206 | 0 \ |
| 7207 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7208 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7209 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7210 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7211 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7212 | "$P_CLI dtls=1 psk=abc124" \ |
| 7213 | 1 \ |
| 7214 | -s "SSL - Verification of the message MAC failed" \ |
| 7215 | -c "SSL - A fatal alert message was received from our peer" |
| 7216 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7217 | # Tests for receiving fragmented handshake messages with DTLS |
| 7218 | |
| 7219 | requires_gnutls |
| 7220 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7221 | "$G_SRV -u --mtu 2048 -a" \ |
| 7222 | "$P_CLI dtls=1 debug_level=2" \ |
| 7223 | 0 \ |
| 7224 | -C "found fragmented DTLS handshake message" \ |
| 7225 | -C "error" |
| 7226 | |
| 7227 | requires_gnutls |
| 7228 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7229 | "$G_SRV -u --mtu 512" \ |
| 7230 | "$P_CLI dtls=1 debug_level=2" \ |
| 7231 | 0 \ |
| 7232 | -c "found fragmented DTLS handshake message" \ |
| 7233 | -C "error" |
| 7234 | |
| 7235 | requires_gnutls |
| 7236 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7237 | "$G_SRV -u --mtu 128" \ |
| 7238 | "$P_CLI dtls=1 debug_level=2" \ |
| 7239 | 0 \ |
| 7240 | -c "found fragmented DTLS handshake message" \ |
| 7241 | -C "error" |
| 7242 | |
| 7243 | requires_gnutls |
| 7244 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7245 | "$G_SRV -u --mtu 128" \ |
| 7246 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7247 | 0 \ |
| 7248 | -c "found fragmented DTLS handshake message" \ |
| 7249 | -C "error" |
| 7250 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7251 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7253 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7254 | "$G_SRV -u --mtu 256" \ |
| 7255 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7256 | 0 \ |
| 7257 | -c "found fragmented DTLS handshake message" \ |
| 7258 | -c "client hello, adding renegotiation extension" \ |
| 7259 | -c "found renegotiation extension" \ |
| 7260 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7261 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7262 | -C "error" \ |
| 7263 | -s "Extra-header:" |
| 7264 | |
| 7265 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7266 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7267 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7268 | "$G_SRV -u --mtu 256" \ |
| 7269 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7270 | 0 \ |
| 7271 | -c "found fragmented DTLS handshake message" \ |
| 7272 | -c "client hello, adding renegotiation extension" \ |
| 7273 | -c "found renegotiation extension" \ |
| 7274 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7275 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7276 | -C "error" \ |
| 7277 | -s "Extra-header:" |
| 7278 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7279 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7280 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7281 | "$P_CLI dtls=1 debug_level=2" \ |
| 7282 | 0 \ |
| 7283 | -C "found fragmented DTLS handshake message" \ |
| 7284 | -C "error" |
| 7285 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7286 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7287 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7288 | "$P_CLI dtls=1 debug_level=2" \ |
| 7289 | 0 \ |
| 7290 | -c "found fragmented DTLS handshake message" \ |
| 7291 | -C "error" |
| 7292 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7293 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7294 | "$O_SRV -dtls1 -mtu 256" \ |
| 7295 | "$P_CLI dtls=1 debug_level=2" \ |
| 7296 | 0 \ |
| 7297 | -c "found fragmented DTLS handshake message" \ |
| 7298 | -C "error" |
| 7299 | |
| 7300 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7301 | "$O_SRV -dtls1 -mtu 256" \ |
| 7302 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7303 | 0 \ |
| 7304 | -c "found fragmented DTLS handshake message" \ |
| 7305 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7306 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7307 | # Tests for sending fragmented handshake messages with DTLS |
| 7308 | # |
| 7309 | # Use client auth when we need the client to send large messages, |
| 7310 | # and use large cert chains on both sides too (the long chains we have all use |
| 7311 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7312 | # Sizes reached (UDP payload): |
| 7313 | # - 2037B for server certificate |
| 7314 | # - 1542B for client certificate |
| 7315 | # - 1013B for newsessionticket |
| 7316 | # - all others below 512B |
| 7317 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7318 | |
| 7319 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7320 | requires_config_enabled MBEDTLS_RSA_C |
| 7321 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7322 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7323 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7324 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7325 | crt_file=data_files/server7_int-ca.crt \ |
| 7326 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7327 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7328 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7329 | "$P_CLI dtls=1 debug_level=2 \ |
| 7330 | crt_file=data_files/server8_int-ca2.crt \ |
| 7331 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7332 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7333 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7334 | 0 \ |
| 7335 | -S "found fragmented DTLS handshake message" \ |
| 7336 | -C "found fragmented DTLS handshake message" \ |
| 7337 | -C "error" |
| 7338 | |
| 7339 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7340 | requires_config_enabled MBEDTLS_RSA_C |
| 7341 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7342 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7343 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7344 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7345 | crt_file=data_files/server7_int-ca.crt \ |
| 7346 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7347 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7348 | max_frag_len=1024" \ |
| 7349 | "$P_CLI dtls=1 debug_level=2 \ |
| 7350 | crt_file=data_files/server8_int-ca2.crt \ |
| 7351 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7352 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7353 | max_frag_len=2048" \ |
| 7354 | 0 \ |
| 7355 | -S "found fragmented DTLS handshake message" \ |
| 7356 | -c "found fragmented DTLS handshake message" \ |
| 7357 | -C "error" |
| 7358 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7359 | # With the MFL extension, the server has no way of forcing |
| 7360 | # the client to not exceed a certain MTU; hence, the following |
| 7361 | # test can't be replicated with an MTU proxy such as the one |
| 7362 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7363 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7364 | requires_config_enabled MBEDTLS_RSA_C |
| 7365 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7366 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7367 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7368 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7369 | crt_file=data_files/server7_int-ca.crt \ |
| 7370 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7371 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7372 | max_frag_len=512" \ |
| 7373 | "$P_CLI dtls=1 debug_level=2 \ |
| 7374 | crt_file=data_files/server8_int-ca2.crt \ |
| 7375 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7376 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7377 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7378 | 0 \ |
| 7379 | -S "found fragmented DTLS handshake message" \ |
| 7380 | -c "found fragmented DTLS handshake message" \ |
| 7381 | -C "error" |
| 7382 | |
| 7383 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7384 | requires_config_enabled MBEDTLS_RSA_C |
| 7385 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7386 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7387 | 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] | 7388 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7389 | crt_file=data_files/server7_int-ca.crt \ |
| 7390 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7391 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7392 | max_frag_len=2048" \ |
| 7393 | "$P_CLI dtls=1 debug_level=2 \ |
| 7394 | crt_file=data_files/server8_int-ca2.crt \ |
| 7395 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7396 | hs_timeout=2500-60000 \ |
| 7397 | max_frag_len=1024" \ |
| 7398 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7399 | -S "found fragmented DTLS handshake message" \ |
| 7400 | -c "found fragmented DTLS handshake message" \ |
| 7401 | -C "error" |
| 7402 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7403 | # While not required by the standard defining the MFL extension |
| 7404 | # (according to which it only applies to records, not to datagrams), |
| 7405 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7406 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7407 | # to the peer. |
| 7408 | # The next test checks that no datagrams significantly larger than the |
| 7409 | # negotiated MFL are sent. |
| 7410 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7411 | requires_config_enabled MBEDTLS_RSA_C |
| 7412 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7413 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7414 | 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] | 7415 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7416 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7417 | crt_file=data_files/server7_int-ca.crt \ |
| 7418 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7419 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7420 | max_frag_len=2048" \ |
| 7421 | "$P_CLI dtls=1 debug_level=2 \ |
| 7422 | crt_file=data_files/server8_int-ca2.crt \ |
| 7423 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7424 | hs_timeout=2500-60000 \ |
| 7425 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7426 | 0 \ |
| 7427 | -S "found fragmented DTLS handshake message" \ |
| 7428 | -c "found fragmented DTLS handshake message" \ |
| 7429 | -C "error" |
| 7430 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7431 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7432 | requires_config_enabled MBEDTLS_RSA_C |
| 7433 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7434 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7435 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7436 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7437 | crt_file=data_files/server7_int-ca.crt \ |
| 7438 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7439 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7440 | max_frag_len=2048" \ |
| 7441 | "$P_CLI dtls=1 debug_level=2 \ |
| 7442 | crt_file=data_files/server8_int-ca2.crt \ |
| 7443 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7444 | hs_timeout=2500-60000 \ |
| 7445 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7446 | 0 \ |
| 7447 | -s "found fragmented DTLS handshake message" \ |
| 7448 | -c "found fragmented DTLS handshake message" \ |
| 7449 | -C "error" |
| 7450 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7451 | # While not required by the standard defining the MFL extension |
| 7452 | # (according to which it only applies to records, not to datagrams), |
| 7453 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7454 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7455 | # to the peer. |
| 7456 | # The next test checks that no datagrams significantly larger than the |
| 7457 | # negotiated MFL are sent. |
| 7458 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7459 | requires_config_enabled MBEDTLS_RSA_C |
| 7460 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7461 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7462 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7463 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 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 | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7467 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7468 | max_frag_len=2048" \ |
| 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 | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7472 | hs_timeout=2500-60000 \ |
| 7473 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7474 | 0 \ |
| 7475 | -s "found fragmented DTLS handshake message" \ |
| 7476 | -c "found fragmented DTLS handshake message" \ |
| 7477 | -C "error" |
| 7478 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 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: none (for reference) (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 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7487 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 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 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7492 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 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 |
| 7501 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7502 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7503 | crt_file=data_files/server7_int-ca.crt \ |
| 7504 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7505 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7506 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7507 | "$P_CLI dtls=1 debug_level=2 \ |
| 7508 | crt_file=data_files/server8_int-ca2.crt \ |
| 7509 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7510 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7511 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7512 | 0 \ |
| 7513 | -s "found fragmented DTLS handshake message" \ |
| 7514 | -C "found fragmented DTLS handshake message" \ |
| 7515 | -C "error" |
| 7516 | |
| 7517 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7518 | requires_config_enabled MBEDTLS_RSA_C |
| 7519 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7520 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7521 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7522 | crt_file=data_files/server7_int-ca.crt \ |
| 7523 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7524 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7525 | mtu=512" \ |
| 7526 | "$P_CLI dtls=1 debug_level=2 \ |
| 7527 | crt_file=data_files/server8_int-ca2.crt \ |
| 7528 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7529 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7530 | mtu=2048" \ |
| 7531 | 0 \ |
| 7532 | -S "found fragmented DTLS handshake message" \ |
| 7533 | -c "found fragmented DTLS handshake message" \ |
| 7534 | -C "error" |
| 7535 | |
| 7536 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7537 | requires_config_enabled MBEDTLS_RSA_C |
| 7538 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7539 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7540 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7541 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7542 | crt_file=data_files/server7_int-ca.crt \ |
| 7543 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7544 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7545 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7546 | "$P_CLI dtls=1 debug_level=2 \ |
| 7547 | crt_file=data_files/server8_int-ca2.crt \ |
| 7548 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7549 | hs_timeout=2500-60000 \ |
| 7550 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7551 | 0 \ |
| 7552 | -s "found fragmented DTLS handshake message" \ |
| 7553 | -c "found fragmented DTLS handshake message" \ |
| 7554 | -C "error" |
| 7555 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7556 | # 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] | 7557 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7558 | requires_config_enabled MBEDTLS_RSA_C |
| 7559 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7560 | requires_config_enabled MBEDTLS_SHA256_C |
| 7561 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7562 | requires_config_enabled MBEDTLS_AES_C |
| 7563 | requires_config_enabled MBEDTLS_GCM_C |
| 7564 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7565 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7566 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7567 | crt_file=data_files/server7_int-ca.crt \ |
| 7568 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7569 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7570 | mtu=512" \ |
| 7571 | "$P_CLI dtls=1 debug_level=2 \ |
| 7572 | crt_file=data_files/server8_int-ca2.crt \ |
| 7573 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7574 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7575 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7576 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7577 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7578 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7579 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7580 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7581 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7582 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7583 | # 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] | 7584 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7585 | # retransmissions, but in some cases (like both the server and client using |
| 7586 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7587 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7588 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7589 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7590 | requires_config_enabled MBEDTLS_RSA_C |
| 7591 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7592 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7593 | requires_config_enabled MBEDTLS_AES_C |
| 7594 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7595 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7596 | -p "$P_PXY mtu=508" \ |
| 7597 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7598 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7599 | key_file=data_files/server7.key \ |
| 7600 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7601 | "$P_CLI dtls=1 debug_level=2 \ |
| 7602 | crt_file=data_files/server8_int-ca2.crt \ |
| 7603 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7604 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7605 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7606 | 0 \ |
| 7607 | -s "found fragmented DTLS handshake message" \ |
| 7608 | -c "found fragmented DTLS handshake message" \ |
| 7609 | -C "error" |
| 7610 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7611 | # 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] | 7612 | only_with_valgrind |
| 7613 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7614 | requires_config_enabled MBEDTLS_RSA_C |
| 7615 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7616 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7617 | requires_config_enabled MBEDTLS_AES_C |
| 7618 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7619 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7620 | -p "$P_PXY mtu=508" \ |
| 7621 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7622 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7623 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7624 | hs_timeout=250-10000" \ |
| 7625 | "$P_CLI dtls=1 debug_level=2 \ |
| 7626 | crt_file=data_files/server8_int-ca2.crt \ |
| 7627 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7628 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7629 | hs_timeout=250-10000" \ |
| 7630 | 0 \ |
| 7631 | -s "found fragmented DTLS handshake message" \ |
| 7632 | -c "found fragmented DTLS handshake message" \ |
| 7633 | -C "error" |
| 7634 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7635 | # 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] | 7636 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7637 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7638 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7639 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7640 | requires_config_enabled MBEDTLS_RSA_C |
| 7641 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7642 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7643 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7644 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7645 | crt_file=data_files/server7_int-ca.crt \ |
| 7646 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7647 | hs_timeout=10000-60000 \ |
| 7648 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7649 | "$P_CLI dtls=1 debug_level=2 \ |
| 7650 | crt_file=data_files/server8_int-ca2.crt \ |
| 7651 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7652 | hs_timeout=10000-60000 \ |
| 7653 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7654 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7655 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7656 | -s "found fragmented DTLS handshake message" \ |
| 7657 | -c "found fragmented DTLS handshake message" \ |
| 7658 | -C "error" |
| 7659 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7660 | # 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] | 7661 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7662 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7663 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7664 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7665 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7666 | requires_config_enabled MBEDTLS_RSA_C |
| 7667 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7668 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7669 | requires_config_enabled MBEDTLS_AES_C |
| 7670 | requires_config_enabled MBEDTLS_GCM_C |
| 7671 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7672 | -p "$P_PXY mtu=512" \ |
| 7673 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7674 | crt_file=data_files/server7_int-ca.crt \ |
| 7675 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7676 | hs_timeout=10000-60000 \ |
| 7677 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7678 | "$P_CLI dtls=1 debug_level=2 \ |
| 7679 | crt_file=data_files/server8_int-ca2.crt \ |
| 7680 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7681 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7682 | hs_timeout=10000-60000 \ |
| 7683 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7684 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7685 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7686 | -s "found fragmented DTLS handshake message" \ |
| 7687 | -c "found fragmented DTLS handshake message" \ |
| 7688 | -C "error" |
| 7689 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7690 | not_with_valgrind # spurious autoreduction due to timeout |
| 7691 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7692 | requires_config_enabled MBEDTLS_RSA_C |
| 7693 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7694 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7695 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7696 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7697 | crt_file=data_files/server7_int-ca.crt \ |
| 7698 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7699 | hs_timeout=10000-60000 \ |
| 7700 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7701 | "$P_CLI dtls=1 debug_level=2 \ |
| 7702 | crt_file=data_files/server8_int-ca2.crt \ |
| 7703 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7704 | hs_timeout=10000-60000 \ |
| 7705 | mtu=1024 nbio=2" \ |
| 7706 | 0 \ |
| 7707 | -S "autoreduction" \ |
| 7708 | -s "found fragmented DTLS handshake message" \ |
| 7709 | -c "found fragmented DTLS handshake message" \ |
| 7710 | -C "error" |
| 7711 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7712 | # 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] | 7713 | not_with_valgrind # spurious autoreduction due to timeout |
| 7714 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7715 | requires_config_enabled MBEDTLS_RSA_C |
| 7716 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7717 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7718 | requires_config_enabled MBEDTLS_AES_C |
| 7719 | requires_config_enabled MBEDTLS_GCM_C |
| 7720 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7721 | -p "$P_PXY mtu=512" \ |
| 7722 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7723 | crt_file=data_files/server7_int-ca.crt \ |
| 7724 | key_file=data_files/server7.key \ |
| 7725 | hs_timeout=10000-60000 \ |
| 7726 | mtu=512 nbio=2" \ |
| 7727 | "$P_CLI dtls=1 debug_level=2 \ |
| 7728 | crt_file=data_files/server8_int-ca2.crt \ |
| 7729 | key_file=data_files/server8.key \ |
| 7730 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7731 | hs_timeout=10000-60000 \ |
| 7732 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7733 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7734 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7735 | -s "found fragmented DTLS handshake message" \ |
| 7736 | -c "found fragmented DTLS handshake message" \ |
| 7737 | -C "error" |
| 7738 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7739 | # 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] | 7740 | # This ensures things still work after session_reset(). |
| 7741 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7742 | # Since we don't support reading fragmented ClientHello yet, |
| 7743 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7744 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7745 | # An autoreduction on the client-side might happen if the server is |
| 7746 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7747 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7748 | # resumed listening, which would result in a spurious autoreduction. |
| 7749 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7750 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7751 | requires_config_enabled MBEDTLS_RSA_C |
| 7752 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7753 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7754 | requires_config_enabled MBEDTLS_AES_C |
| 7755 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7756 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7757 | -p "$P_PXY mtu=1450" \ |
| 7758 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7759 | crt_file=data_files/server7_int-ca.crt \ |
| 7760 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7761 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7762 | mtu=1450" \ |
| 7763 | "$P_CLI dtls=1 debug_level=2 \ |
| 7764 | crt_file=data_files/server8_int-ca2.crt \ |
| 7765 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7766 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7767 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7768 | 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] | 7769 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7770 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7771 | -s "found fragmented DTLS handshake message" \ |
| 7772 | -c "found fragmented DTLS handshake message" \ |
| 7773 | -C "error" |
| 7774 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7775 | # An autoreduction on the client-side might happen if the server is |
| 7776 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7777 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7778 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7779 | requires_config_enabled MBEDTLS_RSA_C |
| 7780 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7781 | requires_config_enabled MBEDTLS_SHA256_C |
| 7782 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7783 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7784 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7785 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7786 | -p "$P_PXY mtu=512" \ |
| 7787 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7788 | crt_file=data_files/server7_int-ca.crt \ |
| 7789 | key_file=data_files/server7.key \ |
| 7790 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7791 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7792 | mtu=512" \ |
| 7793 | "$P_CLI dtls=1 debug_level=2 \ |
| 7794 | crt_file=data_files/server8_int-ca2.crt \ |
| 7795 | key_file=data_files/server8.key \ |
| 7796 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7797 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7798 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7799 | mtu=512" \ |
| 7800 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7801 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7802 | -s "found fragmented DTLS handshake message" \ |
| 7803 | -c "found fragmented DTLS handshake message" \ |
| 7804 | -C "error" |
| 7805 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7806 | # An autoreduction on the client-side might happen if the server is |
| 7807 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7808 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7809 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7810 | requires_config_enabled MBEDTLS_RSA_C |
| 7811 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7812 | requires_config_enabled MBEDTLS_SHA256_C |
| 7813 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7814 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7815 | requires_config_enabled MBEDTLS_AES_C |
| 7816 | requires_config_enabled MBEDTLS_GCM_C |
| 7817 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7818 | -p "$P_PXY mtu=512" \ |
| 7819 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7820 | crt_file=data_files/server7_int-ca.crt \ |
| 7821 | key_file=data_files/server7.key \ |
| 7822 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7823 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7824 | mtu=512" \ |
| 7825 | "$P_CLI dtls=1 debug_level=2 \ |
| 7826 | crt_file=data_files/server8_int-ca2.crt \ |
| 7827 | key_file=data_files/server8.key \ |
| 7828 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7829 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7830 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7831 | mtu=512" \ |
| 7832 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7833 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7834 | -s "found fragmented DTLS handshake message" \ |
| 7835 | -c "found fragmented DTLS handshake message" \ |
| 7836 | -C "error" |
| 7837 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7838 | # An autoreduction on the client-side might happen if the server is |
| 7839 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7840 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7841 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7842 | requires_config_enabled MBEDTLS_RSA_C |
| 7843 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7844 | requires_config_enabled MBEDTLS_SHA256_C |
| 7845 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7846 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7847 | requires_config_enabled MBEDTLS_AES_C |
| 7848 | requires_config_enabled MBEDTLS_CCM_C |
| 7849 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7850 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7851 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7852 | crt_file=data_files/server7_int-ca.crt \ |
| 7853 | key_file=data_files/server7.key \ |
| 7854 | exchanges=2 renegotiation=1 \ |
| 7855 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7856 | hs_timeout=10000-60000 \ |
| 7857 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7858 | "$P_CLI dtls=1 debug_level=2 \ |
| 7859 | crt_file=data_files/server8_int-ca2.crt \ |
| 7860 | key_file=data_files/server8.key \ |
| 7861 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7862 | hs_timeout=10000-60000 \ |
| 7863 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7864 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7865 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7866 | -s "found fragmented DTLS handshake message" \ |
| 7867 | -c "found fragmented DTLS handshake message" \ |
| 7868 | -C "error" |
| 7869 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7870 | # An autoreduction on the client-side might happen if the server is |
| 7871 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7872 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7873 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7874 | requires_config_enabled MBEDTLS_RSA_C |
| 7875 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7876 | requires_config_enabled MBEDTLS_SHA256_C |
| 7877 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7878 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7879 | requires_config_enabled MBEDTLS_AES_C |
| 7880 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7881 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7882 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7883 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7884 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7885 | crt_file=data_files/server7_int-ca.crt \ |
| 7886 | key_file=data_files/server7.key \ |
| 7887 | exchanges=2 renegotiation=1 \ |
| 7888 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
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 | "$P_CLI dtls=1 debug_level=2 \ |
| 7892 | crt_file=data_files/server8_int-ca2.crt \ |
| 7893 | key_file=data_files/server8.key \ |
| 7894 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7895 | hs_timeout=10000-60000 \ |
| 7896 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7897 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7898 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7899 | -s "found fragmented DTLS handshake message" \ |
| 7900 | -c "found fragmented DTLS handshake message" \ |
| 7901 | -C "error" |
| 7902 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7903 | # An autoreduction on the client-side might happen if the server is |
| 7904 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7905 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7906 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7907 | requires_config_enabled MBEDTLS_RSA_C |
| 7908 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7909 | requires_config_enabled MBEDTLS_SHA256_C |
| 7910 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7911 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7912 | requires_config_enabled MBEDTLS_AES_C |
| 7913 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7914 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7915 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7916 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7917 | crt_file=data_files/server7_int-ca.crt \ |
| 7918 | key_file=data_files/server7.key \ |
| 7919 | exchanges=2 renegotiation=1 \ |
| 7920 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7921 | hs_timeout=10000-60000 \ |
| 7922 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7923 | "$P_CLI dtls=1 debug_level=2 \ |
| 7924 | crt_file=data_files/server8_int-ca2.crt \ |
| 7925 | key_file=data_files/server8.key \ |
| 7926 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7927 | hs_timeout=10000-60000 \ |
| 7928 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7929 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7930 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7931 | -s "found fragmented DTLS handshake message" \ |
| 7932 | -c "found fragmented DTLS handshake message" \ |
| 7933 | -C "error" |
| 7934 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7935 | # 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] | 7936 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7937 | requires_config_enabled MBEDTLS_RSA_C |
| 7938 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7939 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7940 | requires_config_enabled MBEDTLS_AES_C |
| 7941 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7942 | client_needs_more_time 2 |
| 7943 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7944 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7945 | "$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] | 7946 | crt_file=data_files/server7_int-ca.crt \ |
| 7947 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7948 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7949 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7950 | crt_file=data_files/server8_int-ca2.crt \ |
| 7951 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7952 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7953 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7954 | 0 \ |
| 7955 | -s "found fragmented DTLS handshake message" \ |
| 7956 | -c "found fragmented DTLS handshake message" \ |
| 7957 | -C "error" |
| 7958 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7959 | # 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] | 7960 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7961 | requires_config_enabled MBEDTLS_RSA_C |
| 7962 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7963 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7964 | requires_config_enabled MBEDTLS_AES_C |
| 7965 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7966 | client_needs_more_time 2 |
| 7967 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7968 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7969 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7970 | crt_file=data_files/server7_int-ca.crt \ |
| 7971 | key_file=data_files/server7.key \ |
| 7972 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7973 | "$P_CLI dtls=1 debug_level=2 \ |
| 7974 | crt_file=data_files/server8_int-ca2.crt \ |
| 7975 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7976 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7977 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7978 | 0 \ |
| 7979 | -s "found fragmented DTLS handshake message" \ |
| 7980 | -c "found fragmented DTLS handshake message" \ |
| 7981 | -C "error" |
| 7982 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7983 | # interop tests for DTLS fragmentating with reliable connection |
| 7984 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7985 | # here and below we just want to test that the we fragment in a way that |
| 7986 | # pleases other implementations, so we don't need the peer to fragment |
| 7987 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7988 | requires_config_enabled MBEDTLS_RSA_C |
| 7989 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7991 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7992 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7993 | "$G_SRV -u" \ |
| 7994 | "$P_CLI dtls=1 debug_level=2 \ |
| 7995 | crt_file=data_files/server8_int-ca2.crt \ |
| 7996 | key_file=data_files/server8.key \ |
| 7997 | mtu=512 force_version=dtls1_2" \ |
| 7998 | 0 \ |
| 7999 | -c "fragmenting handshake message" \ |
| 8000 | -C "error" |
| 8001 | |
| 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 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8007 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8008 | "$G_SRV -u" \ |
| 8009 | "$P_CLI dtls=1 debug_level=2 \ |
| 8010 | crt_file=data_files/server8_int-ca2.crt \ |
| 8011 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8012 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8013 | 0 \ |
| 8014 | -c "fragmenting handshake message" \ |
| 8015 | -C "error" |
| 8016 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8017 | # We use --insecure for the GnuTLS client because it expects |
| 8018 | # the hostname / IP it connects to to be the name used in the |
| 8019 | # certificate obtained from the server. Here, however, it |
| 8020 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8021 | # as the server name in the certificate. This will make the |
| 8022 | # certifiate validation fail, but passing --insecure makes |
| 8023 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8024 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8025 | requires_config_enabled MBEDTLS_RSA_C |
| 8026 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8028 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8029 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8030 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8031 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8032 | crt_file=data_files/server7_int-ca.crt \ |
| 8033 | key_file=data_files/server7.key \ |
| 8034 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8035 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8036 | 0 \ |
| 8037 | -s "fragmenting handshake message" |
| 8038 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8039 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8040 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8041 | requires_config_enabled MBEDTLS_RSA_C |
| 8042 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8044 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8045 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8046 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8047 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8048 | crt_file=data_files/server7_int-ca.crt \ |
| 8049 | key_file=data_files/server7.key \ |
| 8050 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8051 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8052 | 0 \ |
| 8053 | -s "fragmenting handshake message" |
| 8054 | |
| 8055 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8056 | requires_config_enabled MBEDTLS_RSA_C |
| 8057 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8058 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8059 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8060 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8061 | "$P_CLI dtls=1 debug_level=2 \ |
| 8062 | crt_file=data_files/server8_int-ca2.crt \ |
| 8063 | key_file=data_files/server8.key \ |
| 8064 | mtu=512 force_version=dtls1_2" \ |
| 8065 | 0 \ |
| 8066 | -c "fragmenting handshake message" \ |
| 8067 | -C "error" |
| 8068 | |
| 8069 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8070 | requires_config_enabled MBEDTLS_RSA_C |
| 8071 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8073 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8074 | "$O_SRV -dtls1 -verify 10" \ |
| 8075 | "$P_CLI dtls=1 debug_level=2 \ |
| 8076 | crt_file=data_files/server8_int-ca2.crt \ |
| 8077 | key_file=data_files/server8.key \ |
| 8078 | mtu=512 force_version=dtls1" \ |
| 8079 | 0 \ |
| 8080 | -c "fragmenting handshake message" \ |
| 8081 | -C "error" |
| 8082 | |
| 8083 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8084 | requires_config_enabled MBEDTLS_RSA_C |
| 8085 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8087 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8088 | "$P_SRV dtls=1 debug_level=2 \ |
| 8089 | crt_file=data_files/server7_int-ca.crt \ |
| 8090 | key_file=data_files/server7.key \ |
| 8091 | mtu=512 force_version=dtls1_2" \ |
| 8092 | "$O_CLI -dtls1_2" \ |
| 8093 | 0 \ |
| 8094 | -s "fragmenting handshake message" |
| 8095 | |
| 8096 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8097 | requires_config_enabled MBEDTLS_RSA_C |
| 8098 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8100 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8101 | "$P_SRV dtls=1 debug_level=2 \ |
| 8102 | crt_file=data_files/server7_int-ca.crt \ |
| 8103 | key_file=data_files/server7.key \ |
| 8104 | mtu=512 force_version=dtls1" \ |
| 8105 | "$O_CLI -dtls1" \ |
| 8106 | 0 \ |
| 8107 | -s "fragmenting handshake message" |
| 8108 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8109 | # interop tests for DTLS fragmentating with unreliable connection |
| 8110 | # |
| 8111 | # again we just want to test that the we fragment in a way that |
| 8112 | # pleases other implementations, so we don't need the peer to fragment |
| 8113 | requires_gnutls_next |
| 8114 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8115 | requires_config_enabled MBEDTLS_RSA_C |
| 8116 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8117 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8118 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8119 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8120 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8121 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8122 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8123 | crt_file=data_files/server8_int-ca2.crt \ |
| 8124 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8125 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8126 | 0 \ |
| 8127 | -c "fragmenting handshake message" \ |
| 8128 | -C "error" |
| 8129 | |
| 8130 | requires_gnutls_next |
| 8131 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8132 | requires_config_enabled MBEDTLS_RSA_C |
| 8133 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8134 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8135 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8136 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8137 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8138 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8139 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8140 | crt_file=data_files/server8_int-ca2.crt \ |
| 8141 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8142 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8143 | 0 \ |
| 8144 | -c "fragmenting handshake message" \ |
| 8145 | -C "error" |
| 8146 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8147 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8148 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8149 | requires_config_enabled MBEDTLS_RSA_C |
| 8150 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8152 | client_needs_more_time 4 |
| 8153 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8154 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8155 | "$P_SRV dtls=1 debug_level=2 \ |
| 8156 | crt_file=data_files/server7_int-ca.crt \ |
| 8157 | key_file=data_files/server7.key \ |
| 8158 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8159 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8160 | 0 \ |
| 8161 | -s "fragmenting handshake message" |
| 8162 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8163 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [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 |
| 8168 | client_needs_more_time 4 |
| 8169 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8170 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8171 | "$P_SRV dtls=1 debug_level=2 \ |
| 8172 | crt_file=data_files/server7_int-ca.crt \ |
| 8173 | key_file=data_files/server7.key \ |
| 8174 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8175 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8176 | 0 \ |
| 8177 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8178 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8179 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8180 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8181 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8182 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8183 | ## (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] | 8184 | skip_next_test |
| 8185 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8186 | requires_config_enabled MBEDTLS_RSA_C |
| 8187 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8189 | client_needs_more_time 4 |
| 8190 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8191 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8192 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8193 | "$P_CLI dtls=1 debug_level=2 \ |
| 8194 | crt_file=data_files/server8_int-ca2.crt \ |
| 8195 | key_file=data_files/server8.key \ |
| 8196 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8197 | 0 \ |
| 8198 | -c "fragmenting handshake message" \ |
| 8199 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8200 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8201 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8202 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8203 | requires_config_enabled MBEDTLS_RSA_C |
| 8204 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8206 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8207 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8208 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8209 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8210 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8211 | crt_file=data_files/server8_int-ca2.crt \ |
| 8212 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8213 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8214 | 0 \ |
| 8215 | -c "fragmenting handshake message" \ |
| 8216 | -C "error" |
| 8217 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8218 | skip_next_test |
| 8219 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8220 | requires_config_enabled MBEDTLS_RSA_C |
| 8221 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8223 | client_needs_more_time 4 |
| 8224 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8225 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8226 | "$P_SRV dtls=1 debug_level=2 \ |
| 8227 | crt_file=data_files/server7_int-ca.crt \ |
| 8228 | key_file=data_files/server7.key \ |
| 8229 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8230 | "$O_CLI -dtls1_2" \ |
| 8231 | 0 \ |
| 8232 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8233 | |
| 8234 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8235 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8236 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8237 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8238 | requires_config_enabled MBEDTLS_RSA_C |
| 8239 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8241 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8242 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8243 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8244 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8245 | crt_file=data_files/server7_int-ca.crt \ |
| 8246 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8247 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8248 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8249 | 0 \ |
| 8250 | -s "fragmenting handshake message" |
| 8251 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8252 | # Tests for DTLS-SRTP (RFC 5764) |
| 8253 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8254 | run_test "DTLS-SRTP all profiles supported" \ |
| 8255 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8256 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8257 | 0 \ |
| 8258 | -s "found use_srtp extension" \ |
| 8259 | -s "found srtp profile" \ |
| 8260 | -s "selected srtp profile" \ |
| 8261 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8262 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8263 | -c "client hello, adding use_srtp extension" \ |
| 8264 | -c "found use_srtp extension" \ |
| 8265 | -c "found srtp profile" \ |
| 8266 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8267 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8268 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8269 | -C "error" |
| 8270 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8271 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8272 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8273 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 8274 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8275 | "$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] | 8276 | 0 \ |
| 8277 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8278 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 8279 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8280 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8281 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8282 | -c "client hello, adding use_srtp extension" \ |
| 8283 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8284 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8285 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8286 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8287 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8288 | -C "error" |
| 8289 | |
| 8290 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8291 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8292 | "$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] | 8293 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8294 | 0 \ |
| 8295 | -s "found use_srtp extension" \ |
| 8296 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8297 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8298 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8299 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8300 | -c "client hello, adding use_srtp extension" \ |
| 8301 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8302 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8303 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8304 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8305 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8306 | -C "error" |
| 8307 | |
| 8308 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8309 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 8310 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8311 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8312 | 0 \ |
| 8313 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8314 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8315 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8316 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8317 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8318 | -c "client hello, adding use_srtp extension" \ |
| 8319 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8320 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8321 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8322 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8323 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8324 | -C "error" |
| 8325 | |
| 8326 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8327 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 8328 | "$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] | 8329 | "$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] | 8330 | 0 \ |
| 8331 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8332 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8333 | -S "selected srtp profile" \ |
| 8334 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8335 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8336 | -c "client hello, adding use_srtp extension" \ |
| 8337 | -C "found use_srtp extension" \ |
| 8338 | -C "found srtp profile" \ |
| 8339 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8340 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8341 | -C "error" |
| 8342 | |
| 8343 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8344 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 8345 | "$P_SRV dtls=1 debug_level=3" \ |
| 8346 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8347 | 0 \ |
| 8348 | -s "found use_srtp extension" \ |
| 8349 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8350 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8351 | -c "client hello, adding use_srtp extension" \ |
| 8352 | -C "found use_srtp extension" \ |
| 8353 | -C "found srtp profile" \ |
| 8354 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8355 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8356 | -C "error" |
| 8357 | |
| 8358 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8359 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 8360 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 8361 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8362 | 0 \ |
| 8363 | -s "found use_srtp extension" \ |
| 8364 | -s "found srtp profile" \ |
| 8365 | -s "selected srtp profile" \ |
| 8366 | -s "server hello, adding use_srtp extension" \ |
| 8367 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8368 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8369 | -c "client hello, adding use_srtp extension" \ |
| 8370 | -c "found use_srtp extension" \ |
| 8371 | -c "found srtp profile" \ |
| 8372 | -c "selected srtp profile" \ |
| 8373 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8374 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8375 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8376 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8377 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8378 | -C "error" |
| 8379 | |
| 8380 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8381 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 8382 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8383 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8384 | 0 \ |
| 8385 | -s "found use_srtp extension" \ |
| 8386 | -s "found srtp profile" \ |
| 8387 | -s "selected srtp profile" \ |
| 8388 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8389 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8390 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8391 | -S "dumping 'using mki' (8 bytes)" \ |
| 8392 | -c "client hello, adding use_srtp extension" \ |
| 8393 | -c "found use_srtp extension" \ |
| 8394 | -c "found srtp profile" \ |
| 8395 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8396 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8397 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8398 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8399 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8400 | -C "dumping 'received mki' (8 bytes)" \ |
| 8401 | -C "error" |
| 8402 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8403 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8404 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 8405 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8406 | "$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] | 8407 | 0 \ |
| 8408 | -s "found use_srtp extension" \ |
| 8409 | -s "found srtp profile" \ |
| 8410 | -s "selected srtp profile" \ |
| 8411 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8412 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8413 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8414 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 8415 | |
| 8416 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8417 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 8418 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8419 | "$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] | 8420 | 0 \ |
| 8421 | -s "found use_srtp extension" \ |
| 8422 | -s "found srtp profile" \ |
| 8423 | -s "selected srtp profile" \ |
| 8424 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8425 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8426 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8427 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8428 | |
| 8429 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8430 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 8431 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8432 | "$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] | 8433 | 0 \ |
| 8434 | -s "found use_srtp extension" \ |
| 8435 | -s "found srtp profile" \ |
| 8436 | -s "selected srtp profile" \ |
| 8437 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8438 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8439 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8440 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8441 | |
| 8442 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8443 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 8444 | "$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] | 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 "found srtp profile" \ |
| 8449 | -s "selected srtp profile" \ |
| 8450 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8451 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8452 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8453 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8454 | |
| 8455 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8456 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 8457 | "$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] | 8458 | "$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] | 8459 | 0 \ |
| 8460 | -s "found use_srtp extension" \ |
| 8461 | -s "found srtp profile" \ |
| 8462 | -s "selected srtp profile" \ |
| 8463 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8464 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8465 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8466 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 8467 | |
| 8468 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8469 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 8470 | "$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] | 8471 | "$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] | 8472 | 0 \ |
| 8473 | -s "found use_srtp extension" \ |
| 8474 | -s "found srtp profile" \ |
| 8475 | -S "selected srtp profile" \ |
| 8476 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8477 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8478 | -C "SRTP Extension negotiated, profile" |
| 8479 | |
| 8480 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8481 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 8482 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8483 | "$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] | 8484 | 0 \ |
| 8485 | -s "found use_srtp extension" \ |
| 8486 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8487 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8488 | -C "SRTP Extension negotiated, profile" |
| 8489 | |
| 8490 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8491 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8492 | "$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] | 8493 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8494 | 0 \ |
| 8495 | -c "client hello, adding use_srtp extension" \ |
| 8496 | -c "found use_srtp extension" \ |
| 8497 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8498 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8499 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8500 | -C "error" |
| 8501 | |
| 8502 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8503 | 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] | 8504 | "$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] | 8505 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8506 | 0 \ |
| 8507 | -c "client hello, adding use_srtp extension" \ |
| 8508 | -c "found use_srtp extension" \ |
| 8509 | -c "found srtp profile" \ |
| 8510 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8511 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8512 | -C "error" |
| 8513 | |
| 8514 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8515 | 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] | 8516 | "$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] | 8517 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8518 | 0 \ |
| 8519 | -c "client hello, adding use_srtp extension" \ |
| 8520 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8521 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8522 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8523 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8524 | -C "error" |
| 8525 | |
| 8526 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8527 | 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] | 8528 | "$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] | 8529 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8530 | 0 \ |
| 8531 | -c "client hello, adding use_srtp extension" \ |
| 8532 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8533 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8534 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8535 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8536 | -C "error" |
| 8537 | |
| 8538 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8539 | 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] | 8540 | "$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] | 8541 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8542 | 0 \ |
| 8543 | -c "client hello, adding use_srtp extension" \ |
| 8544 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8545 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8546 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8547 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8548 | -C "error" |
| 8549 | |
| 8550 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8551 | 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] | 8552 | "$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] | 8553 | "$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] | 8554 | 0 \ |
| 8555 | -c "client hello, adding use_srtp extension" \ |
| 8556 | -C "found use_srtp extension" \ |
| 8557 | -C "found srtp profile" \ |
| 8558 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8559 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8560 | -C "error" |
| 8561 | |
| 8562 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8563 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 8564 | "$O_SRV -dtls1" \ |
| 8565 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8566 | 0 \ |
| 8567 | -c "client hello, adding use_srtp extension" \ |
| 8568 | -C "found use_srtp extension" \ |
| 8569 | -C "found srtp profile" \ |
| 8570 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8571 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8572 | -C "error" |
| 8573 | |
| 8574 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 8575 | 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] | 8576 | "$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] | 8577 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8578 | 0 \ |
| 8579 | -c "client hello, adding use_srtp extension" \ |
| 8580 | -c "found use_srtp extension" \ |
| 8581 | -c "found srtp profile" \ |
| 8582 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8583 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8584 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8585 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8586 | -C "dumping 'received mki' (8 bytes)" \ |
| 8587 | -C "error" |
| 8588 | |
| 8589 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8590 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8591 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8592 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8593 | "$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] | 8594 | 0 \ |
| 8595 | -s "found use_srtp extension" \ |
| 8596 | -s "found srtp profile" \ |
| 8597 | -s "selected srtp profile" \ |
| 8598 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8599 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8600 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 8601 | |
| 8602 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8603 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8604 | 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] | 8605 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8606 | "$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] | 8607 | 0 \ |
| 8608 | -s "found use_srtp extension" \ |
| 8609 | -s "found srtp profile" \ |
| 8610 | -s "selected srtp profile" \ |
| 8611 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8612 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8613 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 8614 | |
| 8615 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8616 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8617 | 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] | 8618 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 8619 | "$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] | 8620 | 0 \ |
| 8621 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8622 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8623 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8624 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8625 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8626 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8627 | |
| 8628 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8629 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8630 | 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] | 8631 | "$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] | 8632 | "$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] | 8633 | 0 \ |
| 8634 | -s "found use_srtp extension" \ |
| 8635 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8636 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8637 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8638 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8639 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8640 | |
| 8641 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8642 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8643 | 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] | 8644 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8645 | "$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] | 8646 | 0 \ |
| 8647 | -s "found use_srtp extension" \ |
| 8648 | -s "found srtp profile" \ |
| 8649 | -s "selected srtp profile" \ |
| 8650 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8651 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8652 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8653 | |
| 8654 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8655 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8656 | 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] | 8657 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8658 | "$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] | 8659 | 0 \ |
| 8660 | -s "found use_srtp extension" \ |
| 8661 | -s "found srtp profile" \ |
| 8662 | -S "selected srtp profile" \ |
| 8663 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8664 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8665 | -C "SRTP profile:" |
| 8666 | |
| 8667 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8668 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8669 | 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] | 8670 | "$P_SRV dtls=1 debug_level=3" \ |
| 8671 | "$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] | 8672 | 0 \ |
| 8673 | -s "found use_srtp extension" \ |
| 8674 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8675 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8676 | -C "SRTP profile:" |
| 8677 | |
| 8678 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8679 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8680 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8681 | "$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" \ |
| 8682 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8683 | 0 \ |
| 8684 | -c "client hello, adding use_srtp extension" \ |
| 8685 | -c "found use_srtp extension" \ |
| 8686 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8687 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8688 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8689 | -C "error" |
| 8690 | |
| 8691 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8692 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8693 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8694 | "$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" \ |
| 8695 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8696 | 0 \ |
| 8697 | -c "client hello, adding use_srtp extension" \ |
| 8698 | -c "found use_srtp extension" \ |
| 8699 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8700 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8701 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8702 | -C "error" |
| 8703 | |
| 8704 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8705 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8706 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8707 | "$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" \ |
| 8708 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8709 | 0 \ |
| 8710 | -c "client hello, adding use_srtp extension" \ |
| 8711 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8712 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8713 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8714 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8715 | -C "error" |
| 8716 | |
| 8717 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8718 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8719 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8720 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8721 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8722 | 0 \ |
| 8723 | -c "client hello, adding use_srtp extension" \ |
| 8724 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8725 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8726 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8727 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8728 | -C "error" |
| 8729 | |
| 8730 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8731 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8732 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8733 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8734 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8735 | 0 \ |
| 8736 | -c "client hello, adding use_srtp extension" \ |
| 8737 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8738 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8739 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8740 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8741 | -C "error" |
| 8742 | |
| 8743 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8744 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8745 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8746 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8747 | "$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] | 8748 | 0 \ |
| 8749 | -c "client hello, adding use_srtp extension" \ |
| 8750 | -C "found use_srtp extension" \ |
| 8751 | -C "found srtp profile" \ |
| 8752 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8753 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8754 | -C "error" |
| 8755 | |
| 8756 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8757 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8758 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8759 | "$G_SRV -u" \ |
| 8760 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8761 | 0 \ |
| 8762 | -c "client hello, adding use_srtp extension" \ |
| 8763 | -C "found use_srtp extension" \ |
| 8764 | -C "found srtp profile" \ |
| 8765 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8766 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8767 | -C "error" |
| 8768 | |
| 8769 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8770 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8771 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8772 | "$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" \ |
| 8773 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8774 | 0 \ |
| 8775 | -c "client hello, adding use_srtp extension" \ |
| 8776 | -c "found use_srtp extension" \ |
| 8777 | -c "found srtp profile" \ |
| 8778 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8779 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8780 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8781 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8782 | -c "dumping 'received mki' (8 bytes)" \ |
| 8783 | -C "error" |
| 8784 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8785 | # Tests for specific things with "unreliable" UDP connection |
| 8786 | |
| 8787 | not_with_valgrind # spurious resend due to timeout |
| 8788 | run_test "DTLS proxy: reference" \ |
| 8789 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8790 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8791 | "$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] | 8792 | 0 \ |
| 8793 | -C "replayed record" \ |
| 8794 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8795 | -C "Buffer record from epoch" \ |
| 8796 | -S "Buffer record from epoch" \ |
| 8797 | -C "ssl_buffer_message" \ |
| 8798 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8799 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8800 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8801 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8802 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8803 | -c "HTTP/1.0 200 OK" |
| 8804 | |
| 8805 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8806 | run_test "DTLS proxy: duplicate every packet" \ |
| 8807 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8808 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8809 | "$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] | 8810 | 0 \ |
| 8811 | -c "replayed record" \ |
| 8812 | -s "replayed record" \ |
| 8813 | -c "record from another epoch" \ |
| 8814 | -s "record from another epoch" \ |
| 8815 | -S "resend" \ |
| 8816 | -s "Extra-header:" \ |
| 8817 | -c "HTTP/1.0 200 OK" |
| 8818 | |
| 8819 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8820 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8821 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8822 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8823 | 0 \ |
| 8824 | -c "replayed record" \ |
| 8825 | -S "replayed record" \ |
| 8826 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8827 | -s "record from another epoch" \ |
| 8828 | -c "resend" \ |
| 8829 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8830 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8831 | -c "HTTP/1.0 200 OK" |
| 8832 | |
| 8833 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8834 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8835 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8836 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8837 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8838 | -c "next record in same datagram" \ |
| 8839 | -s "next record in same datagram" |
| 8840 | |
| 8841 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8842 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8843 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8844 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8845 | 0 \ |
| 8846 | -c "next record in same datagram" \ |
| 8847 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8848 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8849 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8850 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8851 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8852 | "$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] | 8853 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8854 | -c "discarding invalid record (mac)" \ |
| 8855 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8856 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8857 | -c "HTTP/1.0 200 OK" \ |
| 8858 | -S "too many records with bad MAC" \ |
| 8859 | -S "Verification of the message MAC failed" |
| 8860 | |
| 8861 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8862 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8863 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8864 | "$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] | 8865 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8866 | -C "discarding invalid record (mac)" \ |
| 8867 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8868 | -S "Extra-header:" \ |
| 8869 | -C "HTTP/1.0 200 OK" \ |
| 8870 | -s "too many records with bad MAC" \ |
| 8871 | -s "Verification of the message MAC failed" |
| 8872 | |
| 8873 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8874 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8875 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8876 | "$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] | 8877 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8878 | -c "discarding invalid record (mac)" \ |
| 8879 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8880 | -s "Extra-header:" \ |
| 8881 | -c "HTTP/1.0 200 OK" \ |
| 8882 | -S "too many records with bad MAC" \ |
| 8883 | -S "Verification of the message MAC failed" |
| 8884 | |
| 8885 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8886 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8887 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8888 | "$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] | 8889 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8890 | -c "discarding invalid record (mac)" \ |
| 8891 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8892 | -s "Extra-header:" \ |
| 8893 | -c "HTTP/1.0 200 OK" \ |
| 8894 | -s "too many records with bad MAC" \ |
| 8895 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8896 | |
| 8897 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8898 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8899 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8900 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8901 | 0 \ |
| 8902 | -c "record from another epoch" \ |
| 8903 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8904 | -s "Extra-header:" \ |
| 8905 | -c "HTTP/1.0 200 OK" |
| 8906 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8907 | # Tests for reordering support with DTLS |
| 8908 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8909 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8910 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8911 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8912 | hs_timeout=2500-60000" \ |
| 8913 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8914 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8915 | 0 \ |
| 8916 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8917 | -c "Next handshake message has been buffered - load"\ |
| 8918 | -S "Buffering HS message" \ |
| 8919 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8920 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8921 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8922 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8923 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8924 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8925 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8926 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8927 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8928 | hs_timeout=2500-60000" \ |
| 8929 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8930 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8931 | 0 \ |
| 8932 | -c "Buffering HS message" \ |
| 8933 | -c "found fragmented DTLS handshake message"\ |
| 8934 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8935 | -c "Next handshake message has been buffered - load"\ |
| 8936 | -S "Buffering HS message" \ |
| 8937 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8938 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8939 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8940 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8941 | -S "Remember CCS message" |
| 8942 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8943 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8944 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8945 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8946 | # while keeping the ServerKeyExchange. |
| 8947 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8948 | 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] | 8949 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8950 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8951 | hs_timeout=2500-60000" \ |
| 8952 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8953 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8954 | 0 \ |
| 8955 | -c "Buffering HS message" \ |
| 8956 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8957 | -C "attempt to make space by freeing buffered messages" \ |
| 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 | a1adcca | 2018-08-24 14:41:07 +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 | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8963 | -S "Remember CCS message" |
| 8964 | |
| 8965 | # The size constraints ensure that the delayed certificate message can't |
| 8966 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8967 | # when dropping it first. |
| 8968 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8969 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8970 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8971 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8972 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8973 | hs_timeout=2500-60000" \ |
| 8974 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8975 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8976 | 0 \ |
| 8977 | -c "Buffering HS message" \ |
| 8978 | -c "attempt to make space by freeing buffered future messages" \ |
| 8979 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8980 | -S "Buffering HS message" \ |
| 8981 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8982 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8983 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8984 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8985 | -S "Remember CCS message" |
| 8986 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8987 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8988 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8989 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8990 | hs_timeout=2500-60000" \ |
| 8991 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8992 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8993 | 0 \ |
| 8994 | -C "Buffering HS message" \ |
| 8995 | -C "Next handshake message has been buffered - load"\ |
| 8996 | -s "Buffering HS message" \ |
| 8997 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8998 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8999 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9000 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9001 | -S "Remember CCS message" |
| 9002 | |
| 9003 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9004 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9005 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9006 | hs_timeout=2500-60000" \ |
| 9007 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9008 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9009 | 0 \ |
| 9010 | -C "Buffering HS message" \ |
| 9011 | -C "Next handshake message has been buffered - load"\ |
| 9012 | -S "Buffering HS message" \ |
| 9013 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9014 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9015 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9016 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9017 | -S "Remember CCS message" |
| 9018 | |
| 9019 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9020 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9021 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9022 | hs_timeout=2500-60000" \ |
| 9023 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9024 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9025 | 0 \ |
| 9026 | -C "Buffering HS message" \ |
| 9027 | -C "Next handshake message has been buffered - load"\ |
| 9028 | -S "Buffering HS message" \ |
| 9029 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9030 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9031 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9032 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9033 | -s "Remember CCS message" |
| 9034 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9035 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9036 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9037 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9038 | hs_timeout=2500-60000" \ |
| 9039 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9040 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9041 | 0 \ |
| 9042 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9043 | -s "Found buffered record from current epoch - load" \ |
| 9044 | -c "Buffer record from epoch 1" \ |
| 9045 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9046 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9047 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9048 | # from the server are delayed, so that the encrypted Finished message |
| 9049 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9050 | # in afterwards, the encrypted Finished message must be freed in order |
| 9051 | # to make space for the NewSessionTicket to be reassembled. |
| 9052 | # This works only in very particular circumstances: |
| 9053 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9054 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9055 | # the encrypted Finished message. |
| 9056 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9057 | # needs to be fragmented. |
| 9058 | # - All messages sent by the server must be small enough to be either sent |
| 9059 | # without fragmentation or be reassembled within the bounds of |
| 9060 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9061 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9062 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9063 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9064 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9065 | -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] | 9066 | "$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] | 9067 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9068 | 0 \ |
| 9069 | -s "Buffer record from epoch 1" \ |
| 9070 | -s "Found buffered record from current epoch - load" \ |
| 9071 | -c "Buffer record from epoch 1" \ |
| 9072 | -C "Found buffered record from current epoch - load" \ |
| 9073 | -c "Enough space available after freeing future epoch record" |
| 9074 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9075 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9076 | |
| 9077 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9078 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9079 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9080 | "$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] | 9081 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9082 | "$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] | 9083 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9084 | 0 \ |
| 9085 | -s "Extra-header:" \ |
| 9086 | -c "HTTP/1.0 200 OK" |
| 9087 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9088 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9089 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9090 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9091 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9092 | "$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] | 9093 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9094 | 0 \ |
| 9095 | -s "Extra-header:" \ |
| 9096 | -c "HTTP/1.0 200 OK" |
| 9097 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9098 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9099 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9100 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9101 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9102 | "$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] | 9103 | 0 \ |
| 9104 | -s "Extra-header:" \ |
| 9105 | -c "HTTP/1.0 200 OK" |
| 9106 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9107 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9108 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9109 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9110 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9111 | "$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] | 9112 | 0 \ |
| 9113 | -s "Extra-header:" \ |
| 9114 | -c "HTTP/1.0 200 OK" |
| 9115 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9116 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9117 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9118 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9119 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9120 | "$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] | 9121 | 0 \ |
| 9122 | -s "Extra-header:" \ |
| 9123 | -c "HTTP/1.0 200 OK" |
| 9124 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9125 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9126 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9127 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9128 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9129 | "$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] | 9130 | 0 \ |
| 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 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9135 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9136 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9137 | "$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] | 9138 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9139 | "$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] | 9140 | 0 \ |
| 9141 | -s "Extra-header:" \ |
| 9142 | -c "HTTP/1.0 200 OK" |
| 9143 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9144 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9145 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9146 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9147 | "$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] | 9148 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9149 | "$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] | 9150 | 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] | 9151 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9152 | 0 \ |
| 9153 | -s "a session has been resumed" \ |
| 9154 | -c "a session has been resumed" \ |
| 9155 | -s "Extra-header:" \ |
| 9156 | -c "HTTP/1.0 200 OK" |
| 9157 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9158 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9159 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9160 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9161 | "$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] | 9162 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9163 | "$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] | 9164 | 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] | 9165 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9166 | 0 \ |
| 9167 | -s "a session has been resumed" \ |
| 9168 | -c "a session has been resumed" \ |
| 9169 | -s "Extra-header:" \ |
| 9170 | -c "HTTP/1.0 200 OK" |
| 9171 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9172 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9173 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9174 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9175 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9176 | "$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] | 9177 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9178 | "$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] | 9179 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9180 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9181 | 0 \ |
| 9182 | -c "=> renegotiate" \ |
| 9183 | -s "=> renegotiate" \ |
| 9184 | -s "Extra-header:" \ |
| 9185 | -c "HTTP/1.0 200 OK" |
| 9186 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9187 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9188 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9189 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9190 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9191 | "$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] | 9192 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9193 | "$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] | 9194 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9195 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9196 | 0 \ |
| 9197 | -c "=> renegotiate" \ |
| 9198 | -s "=> renegotiate" \ |
| 9199 | -s "Extra-header:" \ |
| 9200 | -c "HTTP/1.0 200 OK" |
| 9201 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9202 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9203 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9204 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9205 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9206 | "$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] | 9207 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9208 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9209 | "$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] | 9210 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9211 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9212 | 0 \ |
| 9213 | -c "=> renegotiate" \ |
| 9214 | -s "=> renegotiate" \ |
| 9215 | -s "Extra-header:" \ |
| 9216 | -c "HTTP/1.0 200 OK" |
| 9217 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9218 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9219 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9220 | 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] | 9221 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9222 | "$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] | 9223 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9224 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9225 | "$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] | 9226 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9227 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9228 | 0 \ |
| 9229 | -c "=> renegotiate" \ |
| 9230 | -s "=> renegotiate" \ |
| 9231 | -s "Extra-header:" \ |
| 9232 | -c "HTTP/1.0 200 OK" |
| 9233 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9234 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9235 | ## all versions installed on the CI machines), reported here: |
| 9236 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9237 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9238 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9239 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9240 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9241 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9242 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9243 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9244 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9245 | "$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] | 9246 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9247 | -c "HTTP/1.0 200 OK" |
| 9248 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9249 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9250 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9251 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9252 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9253 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9254 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9255 | "$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] | 9256 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9257 | -c "HTTP/1.0 200 OK" |
| 9258 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9259 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9260 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9261 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9262 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9263 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9264 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9265 | "$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] | 9266 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9267 | -c "HTTP/1.0 200 OK" |
| 9268 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9269 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9270 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9271 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9272 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9273 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9274 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9275 | "$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] | 9276 | 0 \ |
| 9277 | -s "Extra-header:" \ |
| 9278 | -c "Extra-header:" |
| 9279 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9280 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9281 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9282 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9283 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9284 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9285 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9286 | "$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] | 9287 | 0 \ |
| 9288 | -s "Extra-header:" \ |
| 9289 | -c "Extra-header:" |
| 9290 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9291 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9292 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9293 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9294 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9295 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9296 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9297 | "$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] | 9298 | 0 \ |
| 9299 | -s "Extra-header:" \ |
| 9300 | -c "Extra-header:" |
| 9301 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9302 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 9303 | run_test "export keys functionality" \ |
| 9304 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9305 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9306 | 0 \ |
| 9307 | -s "exported maclen is " \ |
| 9308 | -s "exported keylen is " \ |
| 9309 | -s "exported ivlen is " \ |
| 9310 | -c "exported maclen is " \ |
| 9311 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9312 | -c "exported ivlen is " \ |
| 9313 | -c "EAP-TLS key material is:"\ |
| 9314 | -s "EAP-TLS key material is:"\ |
| 9315 | -c "EAP-TLS IV is:" \ |
| 9316 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9317 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9318 | # Test heap memory usage after handshake |
| 9319 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9320 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9321 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 9322 | run_tests_memory_after_hanshake |
| 9323 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9324 | # Final report |
| 9325 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9326 | echo "------------------------------------------------------------------------" |
| 9327 | |
| 9328 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9329 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9330 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9331 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9332 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9333 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9334 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9335 | |
| 9336 | exit $FAILS |