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 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 80 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 81 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 82 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 83 | else |
| 84 | O_NEXT_SRV=false |
| 85 | O_NEXT_CLI=false |
| 86 | fi |
| 87 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 88 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 89 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 90 | else |
| 91 | G_NEXT_SRV=false |
| 92 | fi |
| 93 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 94 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 95 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 96 | else |
| 97 | G_NEXT_CLI=false |
| 98 | fi |
| 99 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 100 | TESTS=0 |
| 101 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 102 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 103 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 104 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 105 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 106 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 107 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 108 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 109 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 110 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 111 | RUN_TEST_NUMBER='' |
| 112 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 113 | PRESERVE_LOGS=0 |
| 114 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 115 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 116 | # port which is this plus 10000. Each port number may be independently |
| 117 | # overridden by a command line option. |
| 118 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 119 | PXY_PORT=$((SRV_PORT + 10000)) |
| 120 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 121 | print_usage() { |
| 122 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 123 | printf " -h|--help\tPrint this help.\n" |
| 124 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 125 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 126 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 127 | 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] | 128 | 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] | 129 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 130 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 131 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 132 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 133 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 134 | 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] | 135 | } |
| 136 | |
| 137 | get_options() { |
| 138 | while [ $# -gt 0 ]; do |
| 139 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 140 | -f|--filter) |
| 141 | shift; FILTER=$1 |
| 142 | ;; |
| 143 | -e|--exclude) |
| 144 | shift; EXCLUDE=$1 |
| 145 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 146 | -m|--memcheck) |
| 147 | MEMCHECK=1 |
| 148 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 149 | -n|--number) |
| 150 | shift; RUN_TEST_NUMBER=$1 |
| 151 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 152 | -s|--show-numbers) |
| 153 | SHOW_TEST_NUMBER=1 |
| 154 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 155 | -p|--preserve-logs) |
| 156 | PRESERVE_LOGS=1 |
| 157 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 158 | --port) |
| 159 | shift; SRV_PORT=$1 |
| 160 | ;; |
| 161 | --proxy-port) |
| 162 | shift; PXY_PORT=$1 |
| 163 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 164 | --seed) |
| 165 | shift; SEED="$1" |
| 166 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 167 | -h|--help) |
| 168 | print_usage |
| 169 | exit 0 |
| 170 | ;; |
| 171 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 172 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 173 | print_usage |
| 174 | exit 1 |
| 175 | ;; |
| 176 | esac |
| 177 | shift |
| 178 | done |
| 179 | } |
| 180 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 181 | # Make the outcome file path relative to the original directory, not |
| 182 | # to .../tests |
| 183 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 184 | [!/]*) |
| 185 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 186 | ;; |
| 187 | esac |
| 188 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 189 | # Read boolean configuration options from config.h for easy and quick |
| 190 | # testing. Skip non-boolean options (with something other than spaces |
| 191 | # and a comment after "#define SYMBOL"). The variable contains a |
| 192 | # space-separated list of symbols. |
| 193 | CONFIGS_ENABLED=" $(<"$CONFIG_H" \ |
| 194 | sed -n 's!^ *#define *\([A-Za-z][0-9A-Z_a-z]*\) *\(/*\)*!\1!p' | |
| 195 | tr '\n' ' ')" |
| 196 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 197 | # Skip next test; use this macro to skip tests which are legitimate |
| 198 | # in theory and expected to be re-introduced at some point, but |
| 199 | # aren't expected to succeed at the moment due to problems outside |
| 200 | # our control (such as bugs in other TLS implementations). |
| 201 | skip_next_test() { |
| 202 | SKIP_NEXT="YES" |
| 203 | } |
| 204 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 205 | # skip next test if the flag is not enabled in config.h |
| 206 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 207 | case $CONFIGS_ENABLED in |
| 208 | *" $1 "*) :;; |
| 209 | *) SKIP_NEXT="YES";; |
| 210 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 211 | } |
| 212 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 213 | # skip next test if the flag is enabled in config.h |
| 214 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 215 | case $CONFIGS_ENABLED in |
| 216 | *" $1 "*) SKIP_NEXT="YES";; |
| 217 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 218 | } |
| 219 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 220 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 221 | # This function uses the query_config command line option to query the |
| 222 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 223 | # program. The command will always return a success value if the |
| 224 | # configuration is defined and the value will be printed to stdout. |
| 225 | # |
| 226 | # Note that if the configuration is not defined or is defined to nothing, |
| 227 | # the output of this function will be an empty string. |
| 228 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 232 | VAL="$( get_config_value_or_default "$1" )" |
| 233 | if [ -z "$VAL" ]; then |
| 234 | # Should never happen |
| 235 | echo "Mbed TLS configuration $1 is not defined" |
| 236 | exit 1 |
| 237 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 238 | SKIP_NEXT="YES" |
| 239 | fi |
| 240 | } |
| 241 | |
| 242 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 243 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 244 | if [ -z "$VAL" ]; then |
| 245 | # Should never happen |
| 246 | echo "Mbed TLS configuration $1 is not defined" |
| 247 | exit 1 |
| 248 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 249 | SKIP_NEXT="YES" |
| 250 | fi |
| 251 | } |
| 252 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 253 | requires_config_value_equals() { |
| 254 | VAL=$( get_config_value_or_default "$1" ) |
| 255 | if [ -z "$VAL" ]; then |
| 256 | # Should never happen |
| 257 | echo "Mbed TLS configuration $1 is not defined" |
| 258 | exit 1 |
| 259 | elif [ "$VAL" -ne "$2" ]; then |
| 260 | SKIP_NEXT="YES" |
| 261 | fi |
| 262 | } |
| 263 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 264 | # Space-separated list of ciphersuites supported by this build of |
| 265 | # Mbed TLS. |
| 266 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 267 | grep TLS- | |
| 268 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 269 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | case $P_CIPHERSUITES in |
| 271 | *" $1 "*) :;; |
| 272 | *) SKIP_NEXT="YES";; |
| 273 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 274 | } |
| 275 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 276 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 277 | # If CMD (call to a TLS client or server program) requires a specific |
| 278 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
| 279 | # enabled. As an exception, do run the test case if it expects a ciphersuite |
| 280 | # mismatch. |
| 281 | maybe_requires_ciphersuite_enabled() { |
| 282 | case "$1" in |
| 283 | *\ force_ciphersuite=*) :;; |
| 284 | *) return;; # No specific required ciphersuite |
| 285 | esac |
| 286 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 287 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 288 | shift |
| 289 | |
| 290 | case "$*" in |
| 291 | *"-s SSL - The server has no ciphersuites in common"*) |
| 292 | # This test case expects a ciphersuite mismatch, so it doesn't |
| 293 | # require the ciphersuite to be enabled. |
| 294 | ;; |
| 295 | *) |
| 296 | requires_ciphersuite_enabled "$ciphersuite" |
| 297 | ;; |
| 298 | esac |
| 299 | |
| 300 | unset ciphersuite |
| 301 | } |
| 302 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 303 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 304 | requires_openssl_with_fallback_scsv() { |
| 305 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 306 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 307 | then |
| 308 | OPENSSL_HAS_FBSCSV="YES" |
| 309 | else |
| 310 | OPENSSL_HAS_FBSCSV="NO" |
| 311 | fi |
| 312 | fi |
| 313 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 314 | SKIP_NEXT="YES" |
| 315 | fi |
| 316 | } |
| 317 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 318 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 319 | requires_max_content_len() { |
| 320 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 321 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 322 | } |
| 323 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 324 | # skip next test if GnuTLS isn't available |
| 325 | requires_gnutls() { |
| 326 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 327 | 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] | 328 | GNUTLS_AVAILABLE="YES" |
| 329 | else |
| 330 | GNUTLS_AVAILABLE="NO" |
| 331 | fi |
| 332 | fi |
| 333 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 334 | SKIP_NEXT="YES" |
| 335 | fi |
| 336 | } |
| 337 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 338 | # skip next test if GnuTLS-next isn't available |
| 339 | requires_gnutls_next() { |
| 340 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 341 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 342 | GNUTLS_NEXT_AVAILABLE="YES" |
| 343 | else |
| 344 | GNUTLS_NEXT_AVAILABLE="NO" |
| 345 | fi |
| 346 | fi |
| 347 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 348 | SKIP_NEXT="YES" |
| 349 | fi |
| 350 | } |
| 351 | |
| 352 | # skip next test if OpenSSL-legacy isn't available |
| 353 | requires_openssl_legacy() { |
| 354 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 355 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 356 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 357 | else |
| 358 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 359 | fi |
| 360 | fi |
| 361 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 362 | SKIP_NEXT="YES" |
| 363 | fi |
| 364 | } |
| 365 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 366 | requires_openssl_next() { |
| 367 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 368 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 369 | OPENSSL_NEXT_AVAILABLE="YES" |
| 370 | else |
| 371 | OPENSSL_NEXT_AVAILABLE="NO" |
| 372 | fi |
| 373 | fi |
| 374 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 375 | SKIP_NEXT="YES" |
| 376 | fi |
| 377 | } |
| 378 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 379 | # skip next test if IPv6 isn't available on this host |
| 380 | requires_ipv6() { |
| 381 | if [ -z "${HAS_IPV6:-}" ]; then |
| 382 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 383 | SRV_PID=$! |
| 384 | sleep 1 |
| 385 | kill $SRV_PID >/dev/null 2>&1 |
| 386 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 387 | HAS_IPV6="NO" |
| 388 | else |
| 389 | HAS_IPV6="YES" |
| 390 | fi |
| 391 | rm -r $SRV_OUT |
| 392 | fi |
| 393 | |
| 394 | if [ "$HAS_IPV6" = "NO" ]; then |
| 395 | SKIP_NEXT="YES" |
| 396 | fi |
| 397 | } |
| 398 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 399 | # skip next test if it's i686 or uname is not available |
| 400 | requires_not_i686() { |
| 401 | if [ -z "${IS_I686:-}" ]; then |
| 402 | IS_I686="YES" |
| 403 | if which "uname" >/dev/null 2>&1; then |
| 404 | if [ -z "$(uname -a | grep i686)" ]; then |
| 405 | IS_I686="NO" |
| 406 | fi |
| 407 | fi |
| 408 | fi |
| 409 | if [ "$IS_I686" = "YES" ]; then |
| 410 | SKIP_NEXT="YES" |
| 411 | fi |
| 412 | } |
| 413 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 414 | # Calculate the input & output maximum content lengths set in the config |
Yuto Takano | ab9e4333 | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 415 | MAX_CONTENT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_MAX_CONTENT_LEN" ) |
| 416 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 417 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 418 | |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 419 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 420 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 421 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 422 | fi |
| 423 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 424 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 425 | fi |
| 426 | |
| 427 | # skip the next test if the SSL output buffer is less than 16KB |
| 428 | requires_full_size_output_buffer() { |
| 429 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 430 | SKIP_NEXT="YES" |
| 431 | fi |
| 432 | } |
| 433 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 434 | # skip the next test if valgrind is in use |
| 435 | not_with_valgrind() { |
| 436 | if [ "$MEMCHECK" -gt 0 ]; then |
| 437 | SKIP_NEXT="YES" |
| 438 | fi |
| 439 | } |
| 440 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 441 | # skip the next test if valgrind is NOT in use |
| 442 | only_with_valgrind() { |
| 443 | if [ "$MEMCHECK" -eq 0 ]; then |
| 444 | SKIP_NEXT="YES" |
| 445 | fi |
| 446 | } |
| 447 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 448 | # 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] | 449 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 450 | CLI_DELAY_FACTOR=$1 |
| 451 | } |
| 452 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 453 | # wait for the given seconds after the client finished in the next test |
| 454 | server_needs_more_time() { |
| 455 | SRV_DELAY_SECONDS=$1 |
| 456 | } |
| 457 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 458 | # print_name <name> |
| 459 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 460 | TESTS=$(( $TESTS + 1 )) |
| 461 | LINE="" |
| 462 | |
| 463 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 464 | LINE="$TESTS " |
| 465 | fi |
| 466 | |
| 467 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 468 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 469 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 470 | for i in `seq 1 $LEN`; do printf '.'; done |
| 471 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 472 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 473 | } |
| 474 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 475 | # record_outcome <outcome> [<failure-reason>] |
| 476 | # The test name must be in $NAME. |
| 477 | record_outcome() { |
| 478 | echo "$1" |
| 479 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 480 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 481 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 482 | "ssl-opt" "$NAME" \ |
| 483 | "$1" "${2-}" \ |
| 484 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 485 | fi |
| 486 | } |
| 487 | |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame^] | 488 | # True if the presence of the given pattern in a log definitely indicates |
| 489 | # that the test has failed. False if the presence is inconclusive. |
| 490 | # |
| 491 | # Inputs: |
| 492 | # * $1: pattern found in the logs |
| 493 | # * $TIMES_LEFT: >0 if retrying is an option |
| 494 | # |
| 495 | # Outputs: |
| 496 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 497 | # unchanged otherwise. |
| 498 | # * Return value: 1 if the pattern is inconclusive, |
| 499 | # 0 if the failure is definitive. |
| 500 | log_pattern_presence_is_conclusive() { |
| 501 | # If we've run out of attempts, then don't retry no matter what. |
| 502 | if [ $TIMES_LEFT -eq 0 ]; then |
| 503 | return 0 |
| 504 | fi |
| 505 | case $1 in |
| 506 | "resend") |
| 507 | # An undesired resend may have been caused by the OS dropping or |
| 508 | # delaying a packet at an inopportune time. |
| 509 | outcome="RETRY(resend)" |
| 510 | return 1;; |
| 511 | esac |
| 512 | } |
| 513 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 514 | # fail <message> |
| 515 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 516 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 517 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 518 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 519 | mv $SRV_OUT o-srv-${TESTS}.log |
| 520 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 521 | if [ -n "$PXY_CMD" ]; then |
| 522 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 523 | fi |
| 524 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 525 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 526 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 527 | echo " ! server output:" |
| 528 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 529 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 530 | echo " ! client output:" |
| 531 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 532 | if [ -n "$PXY_CMD" ]; then |
| 533 | echo " ! ========================================================" |
| 534 | echo " ! proxy output:" |
| 535 | cat o-pxy-${TESTS}.log |
| 536 | fi |
| 537 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 538 | fi |
| 539 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 540 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 541 | } |
| 542 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 543 | # is_polar <cmd_line> |
| 544 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 545 | case "$1" in |
| 546 | *ssl_client2*) true;; |
| 547 | *ssl_server2*) true;; |
| 548 | *) false;; |
| 549 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 550 | } |
| 551 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 552 | # openssl s_server doesn't have -www with DTLS |
| 553 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 554 | case "$SRV_CMD" in |
| 555 | *s_server*-dtls*) |
| 556 | NEEDS_INPUT=1 |
| 557 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 558 | *) NEEDS_INPUT=0;; |
| 559 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 560 | } |
| 561 | |
| 562 | # provide input to commands that need it |
| 563 | provide_input() { |
| 564 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 565 | return |
| 566 | fi |
| 567 | |
| 568 | while true; do |
| 569 | echo "HTTP/1.0 200 OK" |
| 570 | sleep 1 |
| 571 | done |
| 572 | } |
| 573 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 574 | # has_mem_err <log_file_name> |
| 575 | has_mem_err() { |
| 576 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 577 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 578 | then |
| 579 | return 1 # false: does not have errors |
| 580 | else |
| 581 | return 0 # true: has errors |
| 582 | fi |
| 583 | } |
| 584 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 585 | # 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] | 586 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 587 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 588 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 589 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 590 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 591 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 592 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 593 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 594 | # Make a tight loop, server normally takes less than 1s to start. |
| 595 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 596 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 597 | echo "$3 START TIMEOUT" |
| 598 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 599 | break |
| 600 | fi |
| 601 | # Linux and *BSD support decimal arguments to sleep. On other |
| 602 | # OSes this may be a tight loop. |
| 603 | sleep 0.1 2>/dev/null || true |
| 604 | done |
| 605 | } |
| 606 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 607 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 608 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 609 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 610 | } |
| 611 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 612 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 613 | # Wait for server process $2 to be listening on port $1. |
| 614 | wait_server_start() { |
| 615 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 616 | } |
| 617 | |
| 618 | # Wait for proxy process $2 to be listening on port $1. |
| 619 | wait_proxy_start() { |
| 620 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 621 | } |
| 622 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 623 | # 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] | 624 | # 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] | 625 | # acceptable bounds |
| 626 | check_server_hello_time() { |
| 627 | # 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] | 628 | 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] | 629 | # Get the Unix timestamp for now |
| 630 | CUR_TIME=$(date +'%s') |
| 631 | THRESHOLD_IN_SECS=300 |
| 632 | |
| 633 | # Check if the ServerHello time was printed |
| 634 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 635 | return 1 |
| 636 | fi |
| 637 | |
| 638 | # Check the time in ServerHello is within acceptable bounds |
| 639 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 640 | # The time in ServerHello is at least 5 minutes before now |
| 641 | return 1 |
| 642 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 643 | # 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] | 644 | return 1 |
| 645 | else |
| 646 | return 0 |
| 647 | fi |
| 648 | } |
| 649 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 650 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 651 | handshake_memory_get() { |
| 652 | OUTPUT_VARIABLE="$1" |
| 653 | OUTPUT_FILE="$2" |
| 654 | |
| 655 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 656 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 657 | |
| 658 | # Check if memory usage was read |
| 659 | if [ -z "$MEM_USAGE" ]; then |
| 660 | echo "Error: Can not read the value of handshake memory usage" |
| 661 | return 1 |
| 662 | else |
| 663 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 664 | return 0 |
| 665 | fi |
| 666 | } |
| 667 | |
| 668 | # Get handshake memory usage from server or client output and check if this value |
| 669 | # is not higher than the maximum given by the first argument |
| 670 | handshake_memory_check() { |
| 671 | MAX_MEMORY="$1" |
| 672 | OUTPUT_FILE="$2" |
| 673 | |
| 674 | # Get memory usage |
| 675 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 676 | return 1 |
| 677 | fi |
| 678 | |
| 679 | # Check if memory usage is below max value |
| 680 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 681 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 682 | "but should be below $MAX_MEMORY bytes" |
| 683 | return 1 |
| 684 | else |
| 685 | return 0 |
| 686 | fi |
| 687 | } |
| 688 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 689 | # wait for client to terminate and set CLI_EXIT |
| 690 | # must be called right after starting the client |
| 691 | wait_client_done() { |
| 692 | CLI_PID=$! |
| 693 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 694 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 695 | CLI_DELAY_FACTOR=1 |
| 696 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 697 | ( 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] | 698 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 699 | |
| 700 | wait $CLI_PID |
| 701 | CLI_EXIT=$? |
| 702 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 703 | kill $DOG_PID >/dev/null 2>&1 |
| 704 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 705 | |
| 706 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 707 | |
| 708 | sleep $SRV_DELAY_SECONDS |
| 709 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 710 | } |
| 711 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 712 | # check if the given command uses dtls and sets global variable DTLS |
| 713 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 714 | case "$1" in |
Paul Elliott | 405fccc | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 715 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 716 | *) DTLS=0;; |
| 717 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 718 | } |
| 719 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 720 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 721 | is_gnutls() { |
| 722 | case "$1" in |
| 723 | *gnutls-cli*) |
| 724 | CMD_IS_GNUTLS=1 |
| 725 | ;; |
| 726 | *gnutls-serv*) |
| 727 | CMD_IS_GNUTLS=1 |
| 728 | ;; |
| 729 | *) |
| 730 | CMD_IS_GNUTLS=0 |
| 731 | ;; |
| 732 | esac |
| 733 | } |
| 734 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 735 | # Compare file content |
| 736 | # Usage: find_in_both pattern file1 file2 |
| 737 | # extract from file1 the first line matching the pattern |
| 738 | # check in file2 that the same line can be found |
| 739 | find_in_both() { |
| 740 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 741 | if [ -z "$srv_pattern" ]; then |
| 742 | return 1; |
| 743 | fi |
| 744 | |
| 745 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 746 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 747 | else |
| 748 | return 1; |
| 749 | fi |
| 750 | } |
| 751 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 752 | # Analyze the commands that will be used in a test. |
| 753 | # |
| 754 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 755 | # extra arguments or go through wrappers. |
| 756 | # Set $DTLS (0=TLS, 1=DTLS). |
| 757 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 758 | # update DTLS variable |
| 759 | detect_dtls "$SRV_CMD" |
| 760 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 761 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 762 | # 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] | 763 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 764 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 765 | case " $SRV_CMD " in |
| 766 | *' server_addr=::1 '*) |
| 767 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 768 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 769 | fi |
| 770 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 771 | # update CMD_IS_GNUTLS variable |
| 772 | is_gnutls "$SRV_CMD" |
| 773 | |
| 774 | # if the server uses gnutls but doesn't set priority, explicitly |
| 775 | # set the default priority |
| 776 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 777 | case "$SRV_CMD" in |
| 778 | *--priority*) :;; |
| 779 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 780 | esac |
| 781 | fi |
| 782 | |
| 783 | # update CMD_IS_GNUTLS variable |
| 784 | is_gnutls "$CLI_CMD" |
| 785 | |
| 786 | # if the client uses gnutls but doesn't set priority, explicitly |
| 787 | # set the default priority |
| 788 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 789 | case "$CLI_CMD" in |
| 790 | *--priority*) :;; |
| 791 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 792 | esac |
| 793 | fi |
| 794 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 795 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 796 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 797 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 798 | else |
| 799 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 800 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 801 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 802 | # prepend valgrind to our commands if active |
| 803 | if [ "$MEMCHECK" -gt 0 ]; then |
| 804 | if is_polar "$SRV_CMD"; then |
| 805 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 806 | fi |
| 807 | if is_polar "$CLI_CMD"; then |
| 808 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 809 | fi |
| 810 | fi |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 811 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 812 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 813 | # Check for failure conditions after a test case. |
| 814 | # |
| 815 | # Inputs from run_test: |
| 816 | # * positional parameters: test options (see run_test documentation) |
| 817 | # * $CLI_EXIT: client return code |
| 818 | # * $CLI_EXPECT: expected client return code |
| 819 | # * $SRV_RET: server return code |
| 820 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 821 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 822 | # |
| 823 | # Outputs: |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 824 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 825 | check_test_failure() { |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 826 | outcome=FAIL |
| 827 | |
| 828 | if [ $TIMES_LEFT -gt 0 ] && |
| 829 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 830 | then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 831 | outcome="RETRY(client-timeout)" |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 832 | return |
| 833 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 834 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 835 | # 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] | 836 | # (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] | 837 | # expected client exit to incorrectly succeed in case of catastrophic |
| 838 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 839 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 840 | 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] | 841 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 842 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 843 | return |
| 844 | fi |
| 845 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 846 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 847 | 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] | 848 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 849 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 850 | return |
| 851 | fi |
| 852 | fi |
| 853 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 854 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 855 | # exit with status 0 when interrupted by a signal, and we don't really |
| 856 | # care anyway), in case e.g. the server reports a memory leak. |
| 857 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 858 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 859 | return |
| 860 | fi |
| 861 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 862 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 863 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 864 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 865 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 866 | 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] | 867 | return |
| 868 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 869 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 870 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 871 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 872 | # 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] | 873 | while [ $# -gt 0 ] |
| 874 | do |
| 875 | case $1 in |
| 876 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 877 | 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] | 878 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 879 | return |
| 880 | fi |
| 881 | ;; |
| 882 | |
| 883 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 884 | 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] | 885 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 886 | return |
| 887 | fi |
| 888 | ;; |
| 889 | |
| 890 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 891 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame^] | 892 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 893 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 894 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 895 | return |
| 896 | fi |
| 897 | ;; |
| 898 | |
| 899 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 900 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame^] | 901 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 902 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 903 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 904 | return |
| 905 | fi |
| 906 | ;; |
| 907 | |
| 908 | # The filtering in the following two options (-u and -U) do the following |
| 909 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 910 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 911 | # - keep one of each non-unique line |
| 912 | # - count how many lines remain |
| 913 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 914 | # if there were no duplicates. |
| 915 | "-U") |
| 916 | 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 |
| 917 | fail "lines following pattern '$2' must be unique in Server output" |
| 918 | return |
| 919 | fi |
| 920 | ;; |
| 921 | |
| 922 | "-u") |
| 923 | 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 |
| 924 | 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] | 925 | return |
| 926 | fi |
| 927 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 928 | "-F") |
| 929 | if ! $2 "$SRV_OUT"; then |
| 930 | fail "function call to '$2' failed on Server output" |
| 931 | return |
| 932 | fi |
| 933 | ;; |
| 934 | "-f") |
| 935 | if ! $2 "$CLI_OUT"; then |
| 936 | fail "function call to '$2' failed on Client output" |
| 937 | return |
| 938 | fi |
| 939 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 940 | "-g") |
| 941 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 942 | fail "function call to '$2' failed on Server and Client output" |
| 943 | return |
| 944 | fi |
| 945 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 946 | |
| 947 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 948 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 949 | exit 1 |
| 950 | esac |
| 951 | shift 2 |
| 952 | done |
| 953 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 954 | # check valgrind's results |
| 955 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 956 | 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] | 957 | fail "Server has memory errors" |
| 958 | return |
| 959 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 960 | 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] | 961 | fail "Client has memory errors" |
| 962 | return |
| 963 | fi |
| 964 | fi |
| 965 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 966 | # if we're here, everything is ok |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 967 | outcome=PASS |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 968 | } |
| 969 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 970 | # Run the current test case: start the server and if applicable the proxy, run |
| 971 | # the client, wait for all processes to finish or time out. |
| 972 | # |
| 973 | # Inputs: |
| 974 | # * $NAME: test case name |
| 975 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 976 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 977 | # |
| 978 | # Outputs: |
| 979 | # * $CLI_EXIT: client return code |
| 980 | # * $SRV_RET: server return code |
| 981 | do_run_test_once() { |
| 982 | # run the commands |
| 983 | if [ -n "$PXY_CMD" ]; then |
| 984 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 985 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 986 | PXY_PID=$! |
| 987 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 988 | fi |
| 989 | |
| 990 | check_osrv_dtls |
| 991 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 992 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 993 | SRV_PID=$! |
| 994 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 995 | |
| 996 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 997 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 998 | wait_client_done |
| 999 | |
| 1000 | sleep 0.05 |
| 1001 | |
| 1002 | # terminate the server (and the proxy) |
| 1003 | kill $SRV_PID |
| 1004 | wait $SRV_PID |
| 1005 | SRV_RET=$? |
| 1006 | |
| 1007 | if [ -n "$PXY_CMD" ]; then |
| 1008 | kill $PXY_PID >/dev/null 2>&1 |
| 1009 | wait $PXY_PID |
| 1010 | fi |
| 1011 | } |
| 1012 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1013 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1014 | # Options: -s pattern pattern that must be present in server output |
| 1015 | # -c pattern pattern that must be present in client output |
| 1016 | # -u pattern lines after pattern must be unique in client output |
| 1017 | # -f call shell function on client output |
| 1018 | # -S pattern pattern that must be absent in server output |
| 1019 | # -C pattern pattern that must be absent in client output |
| 1020 | # -U pattern lines after pattern must be unique in server output |
| 1021 | # -F call shell function on server output |
| 1022 | # -g call shell function on server and client output |
| 1023 | run_test() { |
| 1024 | NAME="$1" |
| 1025 | shift 1 |
| 1026 | |
| 1027 | if is_excluded "$NAME"; then |
| 1028 | SKIP_NEXT="NO" |
| 1029 | # There was no request to run the test, so don't record its outcome. |
| 1030 | return |
| 1031 | fi |
| 1032 | |
| 1033 | print_name "$NAME" |
| 1034 | |
| 1035 | # Do we only run numbered tests? |
| 1036 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1037 | case ",$RUN_TEST_NUMBER," in |
| 1038 | *",$TESTS,"*) :;; |
| 1039 | *) SKIP_NEXT="YES";; |
| 1040 | esac |
| 1041 | fi |
| 1042 | |
| 1043 | # does this test use a proxy? |
| 1044 | if [ "X$1" = "X-p" ]; then |
| 1045 | PXY_CMD="$2" |
| 1046 | shift 2 |
| 1047 | else |
| 1048 | PXY_CMD="" |
| 1049 | fi |
| 1050 | |
| 1051 | # get commands and client output |
| 1052 | SRV_CMD="$1" |
| 1053 | CLI_CMD="$2" |
| 1054 | CLI_EXPECT="$3" |
| 1055 | shift 3 |
| 1056 | |
| 1057 | # Check if test uses files |
| 1058 | case "$SRV_CMD $CLI_CMD" in |
| 1059 | *data_files/*) |
| 1060 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1061 | esac |
| 1062 | |
| 1063 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1064 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1065 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1066 | |
| 1067 | # should we skip? |
| 1068 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1069 | SKIP_NEXT="NO" |
| 1070 | record_outcome "SKIP" |
| 1071 | SKIPS=$(( $SKIPS + 1 )) |
| 1072 | return |
| 1073 | fi |
| 1074 | |
| 1075 | analyze_test_commands "$@" |
| 1076 | |
| 1077 | TIMES_LEFT=2 |
| 1078 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1079 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1080 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1081 | do_run_test_once |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1082 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1083 | check_test_failure "$@" |
| 1084 | case $outcome in |
| 1085 | PASS) break;; |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1086 | RETRY*) printf "$outcome ";; |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1087 | FAIL) return;; |
| 1088 | esac |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1089 | done |
| 1090 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1091 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1092 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1093 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1094 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1095 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1096 | if [ -n "$PXY_CMD" ]; then |
| 1097 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1098 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1099 | fi |
| 1100 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1101 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1102 | } |
| 1103 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1104 | run_test_psa() { |
| 1105 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1106 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 1107 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 1108 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1109 | 0 \ |
| 1110 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1111 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1112 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1113 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1114 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1115 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1116 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1117 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1118 | -C "Failed to setup PSA-based cipher context"\ |
| 1119 | -S "Failed to setup PSA-based cipher context"\ |
| 1120 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1121 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1122 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1123 | -S "error" \ |
| 1124 | -C "error" |
| 1125 | } |
| 1126 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1127 | run_test_psa_force_curve() { |
| 1128 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1129 | run_test "PSA - ECDH with $1" \ |
| 1130 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 1131 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1132 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1133 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1134 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1135 | -c "PSA calc verify" \ |
| 1136 | -c "calc PSA finished" \ |
| 1137 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1138 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1139 | -s "PSA calc verify" \ |
| 1140 | -s "calc PSA finished" \ |
| 1141 | -C "Failed to setup PSA-based cipher context"\ |
| 1142 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1143 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1144 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1145 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1146 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1147 | -C "error" |
| 1148 | } |
| 1149 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1150 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1151 | # a maximum fragment length. |
| 1152 | # first argument ($1) is MFL for SSL client |
| 1153 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1154 | run_test_memory_after_hanshake_with_mfl() |
| 1155 | { |
| 1156 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1157 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1158 | |
| 1159 | # Leave some margin for robustness |
| 1160 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1161 | |
| 1162 | run_test "Handshake memory usage (MFL $1)" \ |
| 1163 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1164 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1165 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1166 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1167 | 0 \ |
| 1168 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1169 | } |
| 1170 | |
| 1171 | |
| 1172 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1173 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1174 | run_tests_memory_after_hanshake() |
| 1175 | { |
| 1176 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1177 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1178 | |
| 1179 | # first test with default MFU is to get reference memory usage |
| 1180 | MEMORY_USAGE_MFL_16K=0 |
| 1181 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1182 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1183 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1184 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1185 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1186 | 0 \ |
| 1187 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1188 | |
| 1189 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1190 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1191 | |
| 1192 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1193 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1194 | |
| 1195 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1196 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1197 | |
| 1198 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1199 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1200 | } |
| 1201 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1202 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1203 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1204 | rm -f context_srv.txt |
| 1205 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1206 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1207 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1208 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1209 | 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] | 1210 | exit 1 |
| 1211 | } |
| 1212 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1213 | # |
| 1214 | # MAIN |
| 1215 | # |
| 1216 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1217 | get_options "$@" |
| 1218 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1219 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1220 | # patterns rather than regular expressions, use a case statement instead |
| 1221 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1222 | # detects simple cases: plain substring, everything, nothing. |
| 1223 | # |
| 1224 | # As an exception, the character '.' is treated as an ordinary character |
| 1225 | # if it is the only special character in the string. This is because it's |
| 1226 | # rare to need "any one character", but needing a literal '.' is common |
| 1227 | # (e.g. '-f "DTLS 1.2"'). |
| 1228 | need_grep= |
| 1229 | case "$FILTER" in |
| 1230 | '^$') simple_filter=;; |
| 1231 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1232 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1233 | need_grep=1;; |
| 1234 | *) # No regexp or shell-pattern special character |
| 1235 | simple_filter="*$FILTER*";; |
| 1236 | esac |
| 1237 | case "$EXCLUDE" in |
| 1238 | '^$') simple_exclude=;; |
| 1239 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1240 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1241 | need_grep=1;; |
| 1242 | *) # No regexp or shell-pattern special character |
| 1243 | simple_exclude="*$EXCLUDE*";; |
| 1244 | esac |
| 1245 | if [ -n "$need_grep" ]; then |
| 1246 | is_excluded () { |
| 1247 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1248 | } |
| 1249 | else |
| 1250 | is_excluded () { |
| 1251 | case "$1" in |
| 1252 | $simple_exclude) true;; |
| 1253 | $simple_filter) false;; |
| 1254 | *) true;; |
| 1255 | esac |
| 1256 | } |
| 1257 | fi |
| 1258 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1259 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1260 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1261 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1262 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1263 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1264 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1265 | exit 1 |
| 1266 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1267 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1268 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1269 | exit 1 |
| 1270 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1271 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1272 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1273 | exit 1 |
| 1274 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1275 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1276 | if which valgrind >/dev/null 2>&1; then :; else |
| 1277 | echo "Memcheck not possible. Valgrind not found" |
| 1278 | exit 1 |
| 1279 | fi |
| 1280 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1281 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1282 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1283 | exit 1 |
| 1284 | fi |
| 1285 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1286 | # used by watchdog |
| 1287 | MAIN_PID="$$" |
| 1288 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1289 | # We use somewhat arbitrary delays for tests: |
| 1290 | # - how long do we wait for the server to start (when lsof not available)? |
| 1291 | # - how long do we allow for the client to finish? |
| 1292 | # (not to check performance, just to avoid waiting indefinitely) |
| 1293 | # Things are slower with valgrind, so give extra time here. |
| 1294 | # |
| 1295 | # Note: without lsof, there is a trade-off between the running time of this |
| 1296 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1297 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1298 | # 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] | 1299 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1300 | START_DELAY=6 |
| 1301 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1302 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1303 | START_DELAY=2 |
| 1304 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1305 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1306 | |
| 1307 | # some particular tests need more time: |
| 1308 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1309 | # - for the server, we sleep for a number of seconds after the client exits |
| 1310 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1311 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1312 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1313 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1314 | # 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] | 1315 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1316 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1317 | # machines that will resolve to ::1, and we don't want ipv6 here. |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1318 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1319 | 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] | 1320 | 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"}" |
Gilles Peskine | 3aec89b | 2021-04-01 14:00:11 +0200 | [diff] [blame] | 1321 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1322 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1323 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1324 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1325 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1326 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1327 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1328 | O_LEGACY_CLI="$O_LEGACY_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1329 | fi |
| 1330 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 1331 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1332 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1333 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 1334 | fi |
| 1335 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1336 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1337 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1338 | fi |
| 1339 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1340 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1341 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1342 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1343 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1344 | # Allow SHA-1, because many of our test certificates use it |
| 1345 | P_SRV="$P_SRV allow_sha1=1" |
| 1346 | P_CLI="$P_CLI allow_sha1=1" |
| 1347 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1348 | # Also pick a unique name for intermediate files |
| 1349 | SRV_OUT="srv_out.$$" |
| 1350 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1351 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1352 | SESSION="session.$$" |
| 1353 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1354 | SKIP_NEXT="NO" |
| 1355 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1356 | trap cleanup INT TERM HUP |
| 1357 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1358 | # Basic test |
| 1359 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1360 | # Checks that: |
| 1361 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1362 | # - the expected (highest security) parameters are selected |
| 1363 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1364 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1365 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1366 | "$P_CLI" \ |
| 1367 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1368 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1369 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1370 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1371 | -s "ECDHE curve: secp521r1" \ |
| 1372 | -S "error" \ |
| 1373 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1374 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1375 | run_test "Default, DTLS" \ |
| 1376 | "$P_SRV dtls=1" \ |
| 1377 | "$P_CLI dtls=1" \ |
| 1378 | 0 \ |
| 1379 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1380 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1381 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1382 | run_test "TLS client auth: required" \ |
| 1383 | "$P_SRV auth_mode=required" \ |
| 1384 | "$P_CLI" \ |
| 1385 | 0 \ |
| 1386 | -s "Verifying peer X.509 certificate... ok" |
| 1387 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1388 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1389 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1390 | requires_config_enabled MBEDTLS_SHA256_C |
| 1391 | run_test "TLS: password protected client key" \ |
| 1392 | "$P_SRV auth_mode=required" \ |
| 1393 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1394 | 0 |
| 1395 | |
| 1396 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1397 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1398 | requires_config_enabled MBEDTLS_SHA256_C |
| 1399 | run_test "TLS: password protected server key" \ |
| 1400 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1401 | "$P_CLI" \ |
| 1402 | 0 |
| 1403 | |
| 1404 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1405 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1406 | requires_config_enabled MBEDTLS_RSA_C |
| 1407 | requires_config_enabled MBEDTLS_SHA256_C |
| 1408 | run_test "TLS: password protected server key, two certificates" \ |
| 1409 | "$P_SRV \ |
| 1410 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1411 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1412 | "$P_CLI" \ |
| 1413 | 0 |
| 1414 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1415 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1416 | run_test "Default (compression enabled)" \ |
| 1417 | "$P_SRV debug_level=3" \ |
| 1418 | "$P_CLI debug_level=3" \ |
| 1419 | 0 \ |
| 1420 | -s "Allocating compression buffer" \ |
| 1421 | -c "Allocating compression buffer" \ |
| 1422 | -s "Record expansion is unknown (compression)" \ |
| 1423 | -c "Record expansion is unknown (compression)" \ |
| 1424 | -S "error" \ |
| 1425 | -C "error" |
| 1426 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1427 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1428 | run_test "CA callback on client" \ |
| 1429 | "$P_SRV debug_level=3" \ |
| 1430 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1431 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1432 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1433 | -S "error" \ |
| 1434 | -C "error" |
| 1435 | |
| 1436 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1437 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1438 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1439 | requires_config_enabled MBEDTLS_SHA256_C |
| 1440 | run_test "CA callback on server" \ |
| 1441 | "$P_SRV auth_mode=required" \ |
| 1442 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1443 | key_file=data_files/server5.key" \ |
| 1444 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1445 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1446 | -s "Verifying peer X.509 certificate... ok" \ |
| 1447 | -S "error" \ |
| 1448 | -C "error" |
| 1449 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1450 | # Test using an opaque private key for client authentication |
| 1451 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1452 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1453 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1454 | requires_config_enabled MBEDTLS_SHA256_C |
| 1455 | run_test "Opaque key for client authentication" \ |
| 1456 | "$P_SRV auth_mode=required" \ |
| 1457 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1458 | key_file=data_files/server5.key" \ |
| 1459 | 0 \ |
| 1460 | -c "key type: Opaque" \ |
| 1461 | -s "Verifying peer X.509 certificate... ok" \ |
| 1462 | -S "error" \ |
| 1463 | -C "error" |
| 1464 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1465 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1466 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1467 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1468 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1469 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1470 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1471 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1472 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1473 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1474 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1475 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1476 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1477 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1478 | run_test_psa_force_curve "secp521r1" |
| 1479 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1480 | run_test_psa_force_curve "brainpoolP512r1" |
| 1481 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1482 | run_test_psa_force_curve "secp384r1" |
| 1483 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1484 | run_test_psa_force_curve "brainpoolP384r1" |
| 1485 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1486 | run_test_psa_force_curve "secp256r1" |
| 1487 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1488 | run_test_psa_force_curve "secp256k1" |
| 1489 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1490 | run_test_psa_force_curve "brainpoolP256r1" |
| 1491 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1492 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1493 | ## SECP224K1 is buggy via the PSA API |
| 1494 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1495 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1496 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1497 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1498 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1499 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1500 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1501 | run_test_psa_force_curve "secp192r1" |
| 1502 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1503 | run_test_psa_force_curve "secp192k1" |
| 1504 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1505 | # Test current time in ServerHello |
| 1506 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1507 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1508 | "$P_SRV debug_level=3" \ |
| 1509 | "$P_CLI debug_level=3" \ |
| 1510 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1511 | -f "check_server_hello_time" \ |
| 1512 | -F "check_server_hello_time" |
| 1513 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1514 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1515 | run_test "Unique IV in GCM" \ |
| 1516 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1517 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1518 | 0 \ |
| 1519 | -u "IV used" \ |
| 1520 | -U "IV used" |
| 1521 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1522 | # Tests for certificate verification callback |
| 1523 | run_test "Configuration-specific CRT verification callback" \ |
| 1524 | "$P_SRV debug_level=3" \ |
| 1525 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1526 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1527 | -S "error" \ |
| 1528 | -c "Verify requested for " \ |
| 1529 | -c "Use configuration-specific verification callback" \ |
| 1530 | -C "Use context-specific verification callback" \ |
| 1531 | -C "error" |
| 1532 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1533 | run_test "Context-specific CRT verification callback" \ |
| 1534 | "$P_SRV debug_level=3" \ |
| 1535 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1536 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1537 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1538 | -c "Verify requested for " \ |
| 1539 | -c "Use context-specific verification callback" \ |
| 1540 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1541 | -C "error" |
| 1542 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1543 | # Tests for rc4 option |
| 1544 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1545 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1546 | run_test "RC4: server disabled, client enabled" \ |
| 1547 | "$P_SRV" \ |
| 1548 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1549 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1550 | -s "SSL - The server has no ciphersuites in common" |
| 1551 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1552 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1553 | run_test "RC4: server half, client enabled" \ |
| 1554 | "$P_SRV arc4=1" \ |
| 1555 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1556 | 1 \ |
| 1557 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1558 | |
| 1559 | run_test "RC4: server enabled, client disabled" \ |
| 1560 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1561 | "$P_CLI" \ |
| 1562 | 1 \ |
| 1563 | -s "SSL - The server has no ciphersuites in common" |
| 1564 | |
| 1565 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1566 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1567 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1568 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1569 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1570 | -S "SSL - The server has no ciphersuites in common" |
| 1571 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1572 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1573 | |
| 1574 | requires_gnutls |
| 1575 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1576 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1577 | "$G_SRV"\ |
| 1578 | "$P_CLI force_version=tls1_1" \ |
| 1579 | 0 |
| 1580 | |
| 1581 | requires_gnutls |
| 1582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1583 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1584 | "$G_SRV"\ |
| 1585 | "$P_CLI force_version=tls1" \ |
| 1586 | 0 |
| 1587 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1588 | # Tests for SHA-1 support |
| 1589 | |
| 1590 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1591 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1592 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1593 | 1 \ |
| 1594 | -c "The certificate is signed with an unacceptable hash" |
| 1595 | |
| 1596 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1597 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1598 | "$P_CLI allow_sha1=1" \ |
| 1599 | 0 |
| 1600 | |
| 1601 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1602 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1603 | "$P_CLI allow_sha1=0" \ |
| 1604 | 0 |
| 1605 | |
| 1606 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1607 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1608 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1609 | 1 \ |
| 1610 | -s "The certificate is signed with an unacceptable hash" |
| 1611 | |
| 1612 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1613 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1614 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1615 | 0 |
| 1616 | |
| 1617 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1618 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1619 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1620 | 0 |
| 1621 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1622 | # Tests for datagram packing |
| 1623 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1624 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1625 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1626 | 0 \ |
| 1627 | -c "next record in same datagram" \ |
| 1628 | -s "next record in same datagram" |
| 1629 | |
| 1630 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1631 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1632 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1633 | 0 \ |
| 1634 | -s "next record in same datagram" \ |
| 1635 | -C "next record in same datagram" |
| 1636 | |
| 1637 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1638 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1639 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1640 | 0 \ |
| 1641 | -S "next record in same datagram" \ |
| 1642 | -c "next record in same datagram" |
| 1643 | |
| 1644 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1645 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1646 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1647 | 0 \ |
| 1648 | -S "next record in same datagram" \ |
| 1649 | -C "next record in same datagram" |
| 1650 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1651 | # Tests for Truncated HMAC extension |
| 1652 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1653 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1654 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1655 | "$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] | 1656 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1657 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1658 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1659 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1660 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1661 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1662 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1663 | "$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] | 1664 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1665 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1666 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1667 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1668 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1669 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1670 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1671 | "$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] | 1672 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1673 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1674 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1675 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1676 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1677 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1678 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1679 | "$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] | 1680 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1681 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1682 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1683 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1684 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1685 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1686 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1687 | "$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] | 1688 | 0 \ |
| 1689 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1690 | -S "dumping 'expected mac' (10 bytes)" |
| 1691 | |
| 1692 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1693 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1694 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1695 | "$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] | 1696 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1697 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1698 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1699 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1700 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1701 | "$P_SRV dtls=1 debug_level=4" \ |
| 1702 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1703 | 0 \ |
| 1704 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1705 | -S "dumping 'expected mac' (10 bytes)" |
| 1706 | |
| 1707 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1708 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1709 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1710 | "$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] | 1711 | 0 \ |
| 1712 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1713 | -S "dumping 'expected mac' (10 bytes)" |
| 1714 | |
| 1715 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1716 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1717 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1718 | "$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] | 1719 | 0 \ |
| 1720 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1721 | -S "dumping 'expected mac' (10 bytes)" |
| 1722 | |
| 1723 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1724 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1725 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1726 | "$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] | 1727 | 0 \ |
| 1728 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1729 | -S "dumping 'expected mac' (10 bytes)" |
| 1730 | |
| 1731 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1732 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1733 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1734 | "$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] | 1735 | 0 \ |
| 1736 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1737 | -S "dumping 'expected mac' (10 bytes)" |
| 1738 | |
| 1739 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1740 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1741 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1742 | "$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] | 1743 | 0 \ |
| 1744 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1745 | -s "dumping 'expected mac' (10 bytes)" |
| 1746 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1747 | # Tests for Context serialization |
| 1748 | |
| 1749 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1750 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1751 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1752 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1753 | 0 \ |
| 1754 | -c "Deserializing connection..." \ |
| 1755 | -S "Deserializing connection..." |
| 1756 | |
| 1757 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1758 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1759 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1760 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1761 | 0 \ |
| 1762 | -c "Deserializing connection..." \ |
| 1763 | -S "Deserializing connection..." |
| 1764 | |
| 1765 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1766 | run_test "Context serialization, client serializes, GCM" \ |
| 1767 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1768 | "$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] | 1769 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1770 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1771 | -S "Deserializing connection..." |
| 1772 | |
| 1773 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1774 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1775 | run_test "Context serialization, client serializes, with CID" \ |
| 1776 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1777 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1778 | 0 \ |
| 1779 | -c "Deserializing connection..." \ |
| 1780 | -S "Deserializing connection..." |
| 1781 | |
| 1782 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1783 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1784 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1785 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1786 | 0 \ |
| 1787 | -C "Deserializing connection..." \ |
| 1788 | -s "Deserializing connection..." |
| 1789 | |
| 1790 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1791 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1792 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1793 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1794 | 0 \ |
| 1795 | -C "Deserializing connection..." \ |
| 1796 | -s "Deserializing connection..." |
| 1797 | |
| 1798 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1799 | run_test "Context serialization, server serializes, GCM" \ |
| 1800 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1801 | "$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] | 1802 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1803 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1804 | -s "Deserializing connection..." |
| 1805 | |
| 1806 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1807 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1808 | run_test "Context serialization, server serializes, with CID" \ |
| 1809 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1810 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1811 | 0 \ |
| 1812 | -C "Deserializing connection..." \ |
| 1813 | -s "Deserializing connection..." |
| 1814 | |
| 1815 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1816 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1817 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1818 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1819 | 0 \ |
| 1820 | -c "Deserializing connection..." \ |
| 1821 | -s "Deserializing connection..." |
| 1822 | |
| 1823 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1824 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1825 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1826 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1827 | 0 \ |
| 1828 | -c "Deserializing connection..." \ |
| 1829 | -s "Deserializing connection..." |
| 1830 | |
| 1831 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1832 | run_test "Context serialization, both serialize, GCM" \ |
| 1833 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1834 | "$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] | 1835 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1836 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1837 | -s "Deserializing connection..." |
| 1838 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1839 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1840 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1841 | run_test "Context serialization, both serialize, with CID" \ |
| 1842 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1843 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1844 | 0 \ |
| 1845 | -c "Deserializing connection..." \ |
| 1846 | -s "Deserializing connection..." |
| 1847 | |
| 1848 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1849 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1850 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1851 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1852 | 0 \ |
| 1853 | -c "Deserializing connection..." \ |
| 1854 | -S "Deserializing connection..." |
| 1855 | |
| 1856 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1857 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1858 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1859 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1860 | 0 \ |
| 1861 | -c "Deserializing connection..." \ |
| 1862 | -S "Deserializing connection..." |
| 1863 | |
| 1864 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1865 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1866 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1867 | "$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] | 1868 | 0 \ |
| 1869 | -c "Deserializing connection..." \ |
| 1870 | -S "Deserializing connection..." |
| 1871 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1872 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1873 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1874 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1875 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1876 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1877 | 0 \ |
| 1878 | -c "Deserializing connection..." \ |
| 1879 | -S "Deserializing connection..." |
| 1880 | |
| 1881 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1882 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1883 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1884 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1885 | 0 \ |
| 1886 | -C "Deserializing connection..." \ |
| 1887 | -s "Deserializing connection..." |
| 1888 | |
| 1889 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1890 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1891 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1892 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1893 | 0 \ |
| 1894 | -C "Deserializing connection..." \ |
| 1895 | -s "Deserializing connection..." |
| 1896 | |
| 1897 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1898 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1899 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1900 | "$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] | 1901 | 0 \ |
| 1902 | -C "Deserializing connection..." \ |
| 1903 | -s "Deserializing connection..." |
| 1904 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1905 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1906 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1907 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1908 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1909 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1910 | 0 \ |
| 1911 | -C "Deserializing connection..." \ |
| 1912 | -s "Deserializing connection..." |
| 1913 | |
| 1914 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1915 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1916 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1917 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1918 | 0 \ |
| 1919 | -c "Deserializing connection..." \ |
| 1920 | -s "Deserializing connection..." |
| 1921 | |
| 1922 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1923 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1924 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1925 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1926 | 0 \ |
| 1927 | -c "Deserializing connection..." \ |
| 1928 | -s "Deserializing connection..." |
| 1929 | |
| 1930 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1931 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1932 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1933 | "$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] | 1934 | 0 \ |
| 1935 | -c "Deserializing connection..." \ |
| 1936 | -s "Deserializing connection..." |
| 1937 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1938 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1939 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1940 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1941 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1942 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1943 | 0 \ |
| 1944 | -c "Deserializing connection..." \ |
| 1945 | -s "Deserializing connection..." |
| 1946 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1947 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1948 | run_test "Saving the serialized context to a file" \ |
| 1949 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1950 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1951 | 0 \ |
| 1952 | -s "Save serialized context to a file... ok" \ |
| 1953 | -c "Save serialized context to a file... ok" |
| 1954 | rm -f context_srv.txt |
| 1955 | rm -f context_cli.txt |
| 1956 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1957 | # Tests for DTLS Connection ID extension |
| 1958 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1959 | # So far, the CID API isn't implemented, so we can't |
| 1960 | # grep for output witnessing its use. This needs to be |
| 1961 | # changed once the CID extension is implemented. |
| 1962 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1963 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1964 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1965 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1966 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1967 | 0 \ |
| 1968 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1969 | -s "found CID extension" \ |
| 1970 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1971 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1972 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1973 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1974 | -C "found CID extension" \ |
| 1975 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1976 | -C "Copy CIDs into SSL transform" \ |
| 1977 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1978 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1979 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1980 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1981 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1982 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1983 | 0 \ |
| 1984 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1985 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1986 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1987 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1988 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1989 | -C "found CID extension" \ |
| 1990 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1991 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1992 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1993 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1994 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1995 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1996 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1997 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1998 | 0 \ |
| 1999 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2000 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2001 | -c "client hello, adding CID extension" \ |
| 2002 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2003 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2004 | -s "server hello, adding CID extension" \ |
| 2005 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2006 | -c "Use of CID extension negotiated" \ |
| 2007 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2008 | -c "Copy CIDs into SSL transform" \ |
| 2009 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2010 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2011 | -s "Use of Connection ID has been negotiated" \ |
| 2012 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2013 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2014 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2015 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2016 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2017 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2018 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2019 | 0 \ |
| 2020 | -c "Enable use of CID extension." \ |
| 2021 | -s "Enable use of CID extension." \ |
| 2022 | -c "client hello, adding CID extension" \ |
| 2023 | -s "found CID extension" \ |
| 2024 | -s "Use of CID extension negotiated" \ |
| 2025 | -s "server hello, adding CID extension" \ |
| 2026 | -c "found CID extension" \ |
| 2027 | -c "Use of CID extension negotiated" \ |
| 2028 | -s "Copy CIDs into SSL transform" \ |
| 2029 | -c "Copy CIDs into SSL transform" \ |
| 2030 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2031 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2032 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2033 | -c "Use of Connection ID has been negotiated" \ |
| 2034 | -c "ignoring unexpected CID" \ |
| 2035 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2036 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2037 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2038 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2039 | -p "$P_PXY mtu=800" \ |
| 2040 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2041 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2042 | 0 \ |
| 2043 | -c "Enable use of CID extension." \ |
| 2044 | -s "Enable use of CID extension." \ |
| 2045 | -c "client hello, adding CID extension" \ |
| 2046 | -s "found CID extension" \ |
| 2047 | -s "Use of CID extension negotiated" \ |
| 2048 | -s "server hello, adding CID extension" \ |
| 2049 | -c "found CID extension" \ |
| 2050 | -c "Use of CID extension negotiated" \ |
| 2051 | -s "Copy CIDs into SSL transform" \ |
| 2052 | -c "Copy CIDs into SSL transform" \ |
| 2053 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2054 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2055 | -s "Use of Connection ID has been negotiated" \ |
| 2056 | -c "Use of Connection ID has been negotiated" |
| 2057 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2058 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2059 | 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] | 2060 | -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] | 2061 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2062 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2063 | 0 \ |
| 2064 | -c "Enable use of CID extension." \ |
| 2065 | -s "Enable use of CID extension." \ |
| 2066 | -c "client hello, adding CID extension" \ |
| 2067 | -s "found CID extension" \ |
| 2068 | -s "Use of CID extension negotiated" \ |
| 2069 | -s "server hello, adding CID extension" \ |
| 2070 | -c "found CID extension" \ |
| 2071 | -c "Use of CID extension negotiated" \ |
| 2072 | -s "Copy CIDs into SSL transform" \ |
| 2073 | -c "Copy CIDs into SSL transform" \ |
| 2074 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2075 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2076 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2077 | -c "Use of Connection ID has been negotiated" \ |
| 2078 | -c "ignoring unexpected CID" \ |
| 2079 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2080 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2081 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2082 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2083 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2084 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2085 | 0 \ |
| 2086 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2087 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2088 | -c "client hello, adding CID extension" \ |
| 2089 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2090 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2091 | -s "server hello, adding CID extension" \ |
| 2092 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2093 | -c "Use of CID extension negotiated" \ |
| 2094 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2095 | -c "Copy CIDs into SSL transform" \ |
| 2096 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2097 | -s "Peer CID (length 0 Bytes):" \ |
| 2098 | -s "Use of Connection ID has been negotiated" \ |
| 2099 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2100 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2101 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2102 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2103 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2104 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2105 | 0 \ |
| 2106 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2107 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2108 | -c "client hello, adding CID extension" \ |
| 2109 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2110 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2111 | -s "server hello, adding CID extension" \ |
| 2112 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2113 | -c "Use of CID extension negotiated" \ |
| 2114 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2115 | -c "Copy CIDs into SSL transform" \ |
| 2116 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2117 | -c "Peer CID (length 0 Bytes):" \ |
| 2118 | -s "Use of Connection ID has been negotiated" \ |
| 2119 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2120 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2121 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2122 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2123 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2124 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2125 | 0 \ |
| 2126 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2127 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2128 | -c "client hello, adding CID extension" \ |
| 2129 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2130 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2131 | -s "server hello, adding CID extension" \ |
| 2132 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2133 | -c "Use of CID extension negotiated" \ |
| 2134 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2135 | -c "Copy CIDs into SSL transform" \ |
| 2136 | -S "Use of Connection ID has been negotiated" \ |
| 2137 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2138 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2139 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2140 | 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] | 2141 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2142 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2143 | 0 \ |
| 2144 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2145 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2146 | -c "client hello, adding CID extension" \ |
| 2147 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2148 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2149 | -s "server hello, adding CID extension" \ |
| 2150 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2151 | -c "Use of CID extension negotiated" \ |
| 2152 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2153 | -c "Copy CIDs into SSL transform" \ |
| 2154 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2155 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2156 | -s "Use of Connection ID has been negotiated" \ |
| 2157 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2158 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2159 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2160 | 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] | 2161 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2162 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2163 | 0 \ |
| 2164 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2165 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2166 | -c "client hello, adding CID extension" \ |
| 2167 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2168 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2169 | -s "server hello, adding CID extension" \ |
| 2170 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2171 | -c "Use of CID extension negotiated" \ |
| 2172 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2173 | -c "Copy CIDs into SSL transform" \ |
| 2174 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2175 | -s "Peer CID (length 0 Bytes):" \ |
| 2176 | -s "Use of Connection ID has been negotiated" \ |
| 2177 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2178 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2179 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2180 | 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] | 2181 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2182 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2183 | 0 \ |
| 2184 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2185 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2186 | -c "client hello, adding CID extension" \ |
| 2187 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2188 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2189 | -s "server hello, adding CID extension" \ |
| 2190 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2191 | -c "Use of CID extension negotiated" \ |
| 2192 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2193 | -c "Copy CIDs into SSL transform" \ |
| 2194 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2195 | -c "Peer CID (length 0 Bytes):" \ |
| 2196 | -s "Use of Connection ID has been negotiated" \ |
| 2197 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2198 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2199 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2200 | 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] | 2201 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2202 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2203 | 0 \ |
| 2204 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2205 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2206 | -c "client hello, adding CID extension" \ |
| 2207 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2208 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2209 | -s "server hello, adding CID extension" \ |
| 2210 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2211 | -c "Use of CID extension negotiated" \ |
| 2212 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2213 | -c "Copy CIDs into SSL transform" \ |
| 2214 | -S "Use of Connection ID has been negotiated" \ |
| 2215 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2216 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2217 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2218 | 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] | 2219 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2220 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2221 | 0 \ |
| 2222 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2223 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2224 | -c "client hello, adding CID extension" \ |
| 2225 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2226 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2227 | -s "server hello, adding CID extension" \ |
| 2228 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2229 | -c "Use of CID extension negotiated" \ |
| 2230 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2231 | -c "Copy CIDs into SSL transform" \ |
| 2232 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2233 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2234 | -s "Use of Connection ID has been negotiated" \ |
| 2235 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2236 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2237 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2238 | 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] | 2239 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2240 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2241 | 0 \ |
| 2242 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2243 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2244 | -c "client hello, adding CID extension" \ |
| 2245 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2246 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2247 | -s "server hello, adding CID extension" \ |
| 2248 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2249 | -c "Use of CID extension negotiated" \ |
| 2250 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2251 | -c "Copy CIDs into SSL transform" \ |
| 2252 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2253 | -s "Peer CID (length 0 Bytes):" \ |
| 2254 | -s "Use of Connection ID has been negotiated" \ |
| 2255 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2256 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2257 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2258 | 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] | 2259 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2260 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2261 | 0 \ |
| 2262 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2263 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2264 | -c "client hello, adding CID extension" \ |
| 2265 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2266 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2267 | -s "server hello, adding CID extension" \ |
| 2268 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2269 | -c "Use of CID extension negotiated" \ |
| 2270 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2271 | -c "Copy CIDs into SSL transform" \ |
| 2272 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2273 | -c "Peer CID (length 0 Bytes):" \ |
| 2274 | -s "Use of Connection ID has been negotiated" \ |
| 2275 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2276 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2277 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2278 | 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] | 2279 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2280 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2281 | 0 \ |
| 2282 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2283 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2284 | -c "client hello, adding CID extension" \ |
| 2285 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2286 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2287 | -s "server hello, adding CID extension" \ |
| 2288 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2289 | -c "Use of CID extension negotiated" \ |
| 2290 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2291 | -c "Copy CIDs into SSL transform" \ |
| 2292 | -S "Use of Connection ID has been negotiated" \ |
| 2293 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2294 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2297 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2298 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2299 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2300 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2301 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2302 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2303 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2304 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2305 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2306 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2307 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2308 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2309 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2310 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2312 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2313 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2314 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2315 | 0 \ |
| 2316 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2317 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2318 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2319 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2320 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2321 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2322 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2323 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2324 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2325 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2326 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2327 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2328 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2329 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2330 | 0 \ |
| 2331 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2332 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2333 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2334 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2335 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2336 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2337 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2338 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2339 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2340 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2341 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2342 | 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] | 2343 | -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] | 2344 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2345 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2346 | 0 \ |
| 2347 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2348 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2349 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2350 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2351 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2352 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2353 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2354 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2355 | -c "ignoring unexpected CID" \ |
| 2356 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2357 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2358 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2359 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2360 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2361 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2362 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2363 | 0 \ |
| 2364 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2365 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2366 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2367 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2368 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2369 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2370 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2371 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2372 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2373 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2374 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2375 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2376 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2377 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2378 | 0 \ |
| 2379 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2380 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2381 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2382 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2383 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2384 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2385 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2386 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2387 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2388 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2390 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2391 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2392 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2393 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2394 | 0 \ |
| 2395 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2396 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2397 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2398 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2399 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2400 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2401 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2402 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2403 | -c "ignoring unexpected CID" \ |
| 2404 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2405 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2407 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2408 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2409 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2410 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2411 | 0 \ |
| 2412 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2413 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2414 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2415 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2416 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2417 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2418 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2419 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2420 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2421 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2422 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2423 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2424 | 0 \ |
| 2425 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2426 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2427 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2428 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2429 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2430 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2431 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2432 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2433 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2434 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2435 | -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] | 2436 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2437 | "$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" \ |
| 2438 | 0 \ |
| 2439 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2440 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2441 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2442 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2443 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2444 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2445 | -c "ignoring unexpected CID" \ |
| 2446 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2447 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2448 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2449 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2450 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2451 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2452 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2453 | 0 \ |
| 2454 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2455 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2456 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2457 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2458 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2459 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2460 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2461 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2462 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2463 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2464 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2465 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2466 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2467 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2468 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2469 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2470 | 0 \ |
| 2471 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2472 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2473 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2474 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2475 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2476 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2477 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2478 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2479 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2480 | -c "ignoring unexpected CID" \ |
| 2481 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2482 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2483 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2485 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2486 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2487 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2488 | 0 \ |
| 2489 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2490 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2491 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2492 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2493 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2494 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2495 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2496 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2497 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2498 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2499 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2500 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2501 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2502 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2503 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2504 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2505 | 0 \ |
| 2506 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2507 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2508 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2509 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2510 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2511 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2512 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2513 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2514 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2515 | -c "ignoring unexpected CID" \ |
| 2516 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2517 | |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2518 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
| 2519 | # tests check that the buffer contents are reallocated when the message is |
| 2520 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2521 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2522 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2523 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2524 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2525 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2526 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2527 | 0 \ |
| 2528 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2529 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2530 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2531 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2532 | -s "Reallocating in_buf" \ |
| 2533 | -s "Reallocating out_buf" |
| 2534 | |
| 2535 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2536 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2537 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2538 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2539 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2540 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2541 | 0 \ |
| 2542 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2543 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2544 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2545 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2546 | -s "Reallocating in_buf" \ |
| 2547 | -s "Reallocating out_buf" |
| 2548 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2549 | # Tests for Encrypt-then-MAC extension |
| 2550 | |
| 2551 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2552 | "$P_SRV debug_level=3 \ |
| 2553 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2554 | "$P_CLI debug_level=3" \ |
| 2555 | 0 \ |
| 2556 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2557 | -s "found encrypt then mac extension" \ |
| 2558 | -s "server hello, adding encrypt then mac extension" \ |
| 2559 | -c "found encrypt_then_mac extension" \ |
| 2560 | -c "using encrypt then mac" \ |
| 2561 | -s "using encrypt then mac" |
| 2562 | |
| 2563 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2564 | "$P_SRV debug_level=3 etm=0 \ |
| 2565 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2566 | "$P_CLI debug_level=3 etm=1" \ |
| 2567 | 0 \ |
| 2568 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2569 | -s "found encrypt then mac extension" \ |
| 2570 | -S "server hello, adding encrypt then mac extension" \ |
| 2571 | -C "found encrypt_then_mac extension" \ |
| 2572 | -C "using encrypt then mac" \ |
| 2573 | -S "using encrypt then mac" |
| 2574 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2575 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2576 | "$P_SRV debug_level=3 etm=1 \ |
| 2577 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2578 | "$P_CLI debug_level=3 etm=1" \ |
| 2579 | 0 \ |
| 2580 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2581 | -s "found encrypt then mac extension" \ |
| 2582 | -S "server hello, adding encrypt then mac extension" \ |
| 2583 | -C "found encrypt_then_mac extension" \ |
| 2584 | -C "using encrypt then mac" \ |
| 2585 | -S "using encrypt then mac" |
| 2586 | |
| 2587 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2588 | "$P_SRV debug_level=3 etm=1 \ |
| 2589 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2590 | "$P_CLI debug_level=3 etm=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2591 | 0 \ |
| 2592 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2593 | -s "found encrypt then mac extension" \ |
| 2594 | -S "server hello, adding encrypt then mac extension" \ |
| 2595 | -C "found encrypt_then_mac extension" \ |
| 2596 | -C "using encrypt then mac" \ |
| 2597 | -S "using encrypt then mac" |
| 2598 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2599 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2600 | "$P_SRV debug_level=3 etm=1 \ |
| 2601 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2602 | "$P_CLI debug_level=3 etm=0" \ |
| 2603 | 0 \ |
| 2604 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2605 | -S "found encrypt then mac extension" \ |
| 2606 | -S "server hello, adding encrypt then mac extension" \ |
| 2607 | -C "found encrypt_then_mac extension" \ |
| 2608 | -C "using encrypt then mac" \ |
| 2609 | -S "using encrypt then mac" |
| 2610 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2611 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2612 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2613 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2614 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2615 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2616 | 0 \ |
| 2617 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2618 | -S "found encrypt then mac extension" \ |
| 2619 | -S "server hello, adding encrypt then mac extension" \ |
| 2620 | -C "found encrypt_then_mac extension" \ |
| 2621 | -C "using encrypt then mac" \ |
| 2622 | -S "using encrypt then mac" |
| 2623 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2624 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2625 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2626 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2627 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2628 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2629 | 0 \ |
| 2630 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2631 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2632 | -S "server hello, adding encrypt then mac extension" \ |
| 2633 | -C "found encrypt_then_mac extension" \ |
| 2634 | -C "using encrypt then mac" \ |
| 2635 | -S "using encrypt then mac" |
| 2636 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2637 | # Tests for Extended Master Secret extension |
| 2638 | |
| 2639 | run_test "Extended Master Secret: default" \ |
| 2640 | "$P_SRV debug_level=3" \ |
| 2641 | "$P_CLI debug_level=3" \ |
| 2642 | 0 \ |
| 2643 | -c "client hello, adding extended_master_secret extension" \ |
| 2644 | -s "found extended master secret extension" \ |
| 2645 | -s "server hello, adding extended master secret extension" \ |
| 2646 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2647 | -c "session hash for extended master secret" \ |
| 2648 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2649 | |
| 2650 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2651 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2652 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2653 | 0 \ |
| 2654 | -c "client hello, adding extended_master_secret extension" \ |
| 2655 | -s "found extended master secret extension" \ |
| 2656 | -S "server hello, adding extended master secret extension" \ |
| 2657 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2658 | -C "session hash for extended master secret" \ |
| 2659 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2660 | |
| 2661 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2662 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2663 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2664 | 0 \ |
| 2665 | -C "client hello, adding extended_master_secret extension" \ |
| 2666 | -S "found extended master secret extension" \ |
| 2667 | -S "server hello, adding extended master secret extension" \ |
| 2668 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2669 | -C "session hash for extended master secret" \ |
| 2670 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2671 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2672 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2673 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2674 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2675 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2676 | 0 \ |
| 2677 | -C "client hello, adding extended_master_secret extension" \ |
| 2678 | -S "found extended master secret extension" \ |
| 2679 | -S "server hello, adding extended master secret extension" \ |
| 2680 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2681 | -C "session hash for extended master secret" \ |
| 2682 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2683 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2684 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2685 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2686 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2687 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2688 | 0 \ |
| 2689 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2690 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2691 | -S "server hello, adding extended master secret extension" \ |
| 2692 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2693 | -C "session hash for extended master secret" \ |
| 2694 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2695 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2696 | # Tests for FALLBACK_SCSV |
| 2697 | |
| 2698 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2699 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2700 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2701 | 0 \ |
| 2702 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2703 | -S "received FALLBACK_SCSV" \ |
| 2704 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2705 | -C "is a fatal alert message (msg 86)" |
| 2706 | |
| 2707 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2708 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2709 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2710 | 0 \ |
| 2711 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2712 | -S "received FALLBACK_SCSV" \ |
| 2713 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2714 | -C "is a fatal alert message (msg 86)" |
| 2715 | |
| 2716 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2717 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2718 | "$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] | 2719 | 1 \ |
| 2720 | -c "adding FALLBACK_SCSV" \ |
| 2721 | -s "received FALLBACK_SCSV" \ |
| 2722 | -s "inapropriate fallback" \ |
| 2723 | -c "is a fatal alert message (msg 86)" |
| 2724 | |
| 2725 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2726 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2727 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2728 | 0 \ |
| 2729 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2730 | -s "received FALLBACK_SCSV" \ |
| 2731 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2732 | -C "is a fatal alert message (msg 86)" |
| 2733 | |
| 2734 | requires_openssl_with_fallback_scsv |
| 2735 | run_test "Fallback SCSV: default, openssl server" \ |
| 2736 | "$O_SRV" \ |
| 2737 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2738 | 0 \ |
| 2739 | -C "adding FALLBACK_SCSV" \ |
| 2740 | -C "is a fatal alert message (msg 86)" |
| 2741 | |
| 2742 | requires_openssl_with_fallback_scsv |
| 2743 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2744 | "$O_SRV" \ |
| 2745 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2746 | 1 \ |
| 2747 | -c "adding FALLBACK_SCSV" \ |
| 2748 | -c "is a fatal alert message (msg 86)" |
| 2749 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2750 | requires_openssl_with_fallback_scsv |
| 2751 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2752 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2753 | "$O_CLI -tls1_1" \ |
| 2754 | 0 \ |
| 2755 | -S "received FALLBACK_SCSV" \ |
| 2756 | -S "inapropriate fallback" |
| 2757 | |
| 2758 | requires_openssl_with_fallback_scsv |
| 2759 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2760 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2761 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2762 | 1 \ |
| 2763 | -s "received FALLBACK_SCSV" \ |
| 2764 | -s "inapropriate fallback" |
| 2765 | |
| 2766 | requires_openssl_with_fallback_scsv |
| 2767 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2768 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2769 | "$O_CLI -fallback_scsv" \ |
| 2770 | 0 \ |
| 2771 | -s "received FALLBACK_SCSV" \ |
| 2772 | -S "inapropriate fallback" |
| 2773 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2774 | # Test sending and receiving empty application data records |
| 2775 | |
| 2776 | run_test "Encrypt then MAC: empty application data record" \ |
| 2777 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2778 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2779 | 0 \ |
| 2780 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2781 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2782 | -c "0 bytes written in 1 fragments" |
| 2783 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2784 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2785 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2786 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2787 | 0 \ |
| 2788 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2789 | -c "0 bytes written in 1 fragments" |
| 2790 | |
| 2791 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2792 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2793 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2794 | 0 \ |
| 2795 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2796 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2797 | -c "0 bytes written in 1 fragments" |
| 2798 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2799 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2800 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2801 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2802 | 0 \ |
| 2803 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2804 | -c "0 bytes written in 1 fragments" |
| 2805 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2806 | ## ClientHello generated with |
| 2807 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2808 | ## then manually twiddling the ciphersuite list. |
| 2809 | ## The ClientHello content is spelled out below as a hex string as |
| 2810 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2811 | ## The expected response is an inappropriate_fallback alert. |
| 2812 | requires_openssl_with_fallback_scsv |
| 2813 | run_test "Fallback SCSV: beginning of list" \ |
| 2814 | "$P_SRV debug_level=2" \ |
| 2815 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2816 | 0 \ |
| 2817 | -s "received FALLBACK_SCSV" \ |
| 2818 | -s "inapropriate fallback" |
| 2819 | |
| 2820 | requires_openssl_with_fallback_scsv |
| 2821 | run_test "Fallback SCSV: end of list" \ |
| 2822 | "$P_SRV debug_level=2" \ |
| 2823 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2824 | 0 \ |
| 2825 | -s "received FALLBACK_SCSV" \ |
| 2826 | -s "inapropriate fallback" |
| 2827 | |
| 2828 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2829 | requires_openssl_with_fallback_scsv |
| 2830 | run_test "Fallback SCSV: not in list" \ |
| 2831 | "$P_SRV debug_level=2" \ |
| 2832 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2833 | 0 \ |
| 2834 | -S "received FALLBACK_SCSV" \ |
| 2835 | -S "inapropriate fallback" |
| 2836 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2837 | # Tests for CBC 1/n-1 record splitting |
| 2838 | |
| 2839 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2840 | "$P_SRV" \ |
| 2841 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2842 | request_size=123 force_version=tls1_2" \ |
| 2843 | 0 \ |
| 2844 | -s "Read from client: 123 bytes read" \ |
| 2845 | -S "Read from client: 1 bytes read" \ |
| 2846 | -S "122 bytes read" |
| 2847 | |
| 2848 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2849 | "$P_SRV" \ |
| 2850 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2851 | request_size=123 force_version=tls1_1" \ |
| 2852 | 0 \ |
| 2853 | -s "Read from client: 123 bytes read" \ |
| 2854 | -S "Read from client: 1 bytes read" \ |
| 2855 | -S "122 bytes read" |
| 2856 | |
| 2857 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2858 | "$P_SRV" \ |
| 2859 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2860 | request_size=123 force_version=tls1" \ |
| 2861 | 0 \ |
| 2862 | -S "Read from client: 123 bytes read" \ |
| 2863 | -s "Read from client: 1 bytes read" \ |
| 2864 | -s "122 bytes read" |
| 2865 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2866 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2867 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2868 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2869 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2870 | request_size=123 force_version=ssl3" \ |
| 2871 | 0 \ |
| 2872 | -S "Read from client: 123 bytes read" \ |
| 2873 | -s "Read from client: 1 bytes read" \ |
| 2874 | -s "122 bytes read" |
| 2875 | |
| 2876 | run_test "CBC Record splitting: TLS 1.0 RC4, no splitting" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2877 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2878 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2879 | request_size=123 force_version=tls1" \ |
| 2880 | 0 \ |
| 2881 | -s "Read from client: 123 bytes read" \ |
| 2882 | -S "Read from client: 1 bytes read" \ |
| 2883 | -S "122 bytes read" |
| 2884 | |
| 2885 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2886 | "$P_SRV" \ |
| 2887 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2888 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2889 | 0 \ |
| 2890 | -s "Read from client: 123 bytes read" \ |
| 2891 | -S "Read from client: 1 bytes read" \ |
| 2892 | -S "122 bytes read" |
| 2893 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2894 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2895 | "$P_SRV nbio=2" \ |
| 2896 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2897 | request_size=123 force_version=tls1" \ |
| 2898 | 0 \ |
| 2899 | -S "Read from client: 123 bytes read" \ |
| 2900 | -s "Read from client: 1 bytes read" \ |
| 2901 | -s "122 bytes read" |
| 2902 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2903 | # Tests for Session Tickets |
| 2904 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2905 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2906 | "$P_SRV debug_level=3 tickets=1" \ |
| 2907 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2908 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2909 | -c "client hello, adding session ticket extension" \ |
| 2910 | -s "found session ticket extension" \ |
| 2911 | -s "server hello, adding session ticket extension" \ |
| 2912 | -c "found session_ticket extension" \ |
| 2913 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2914 | -S "session successfully restored from cache" \ |
| 2915 | -s "session successfully restored from ticket" \ |
| 2916 | -s "a session has been resumed" \ |
| 2917 | -c "a session has been resumed" |
| 2918 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2919 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2920 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2921 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2922 | 0 \ |
| 2923 | -c "client hello, adding session ticket extension" \ |
| 2924 | -s "found session ticket extension" \ |
| 2925 | -s "server hello, adding session ticket extension" \ |
| 2926 | -c "found session_ticket extension" \ |
| 2927 | -c "parse new session ticket" \ |
| 2928 | -S "session successfully restored from cache" \ |
| 2929 | -s "session successfully restored from ticket" \ |
| 2930 | -s "a session has been resumed" \ |
| 2931 | -c "a session has been resumed" |
| 2932 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2933 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2934 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2935 | "$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] | 2936 | 0 \ |
| 2937 | -c "client hello, adding session ticket extension" \ |
| 2938 | -s "found session ticket extension" \ |
| 2939 | -s "server hello, adding session ticket extension" \ |
| 2940 | -c "found session_ticket extension" \ |
| 2941 | -c "parse new session ticket" \ |
| 2942 | -S "session successfully restored from cache" \ |
| 2943 | -S "session successfully restored from ticket" \ |
| 2944 | -S "a session has been resumed" \ |
| 2945 | -C "a session has been resumed" |
| 2946 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2947 | run_test "Session resume using tickets: session copy" \ |
| 2948 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2949 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2950 | 0 \ |
| 2951 | -c "client hello, adding session ticket extension" \ |
| 2952 | -s "found session ticket extension" \ |
| 2953 | -s "server hello, adding session ticket extension" \ |
| 2954 | -c "found session_ticket extension" \ |
| 2955 | -c "parse new session ticket" \ |
| 2956 | -S "session successfully restored from cache" \ |
| 2957 | -s "session successfully restored from ticket" \ |
| 2958 | -s "a session has been resumed" \ |
| 2959 | -c "a session has been resumed" |
| 2960 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2961 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2962 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2963 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2964 | 0 \ |
| 2965 | -c "client hello, adding session ticket extension" \ |
| 2966 | -c "found session_ticket extension" \ |
| 2967 | -c "parse new session ticket" \ |
| 2968 | -c "a session has been resumed" |
| 2969 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2970 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2971 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2972 | "( $O_CLI -sess_out $SESSION; \ |
| 2973 | $O_CLI -sess_in $SESSION; \ |
| 2974 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2975 | 0 \ |
| 2976 | -s "found session ticket extension" \ |
| 2977 | -s "server hello, adding session ticket extension" \ |
| 2978 | -S "session successfully restored from cache" \ |
| 2979 | -s "session successfully restored from ticket" \ |
| 2980 | -s "a session has been resumed" |
| 2981 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2982 | # Tests for Session Tickets with DTLS |
| 2983 | |
| 2984 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2985 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2986 | "$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] | 2987 | 0 \ |
| 2988 | -c "client hello, adding session ticket extension" \ |
| 2989 | -s "found session ticket extension" \ |
| 2990 | -s "server hello, adding session ticket extension" \ |
| 2991 | -c "found session_ticket extension" \ |
| 2992 | -c "parse new session ticket" \ |
| 2993 | -S "session successfully restored from cache" \ |
| 2994 | -s "session successfully restored from ticket" \ |
| 2995 | -s "a session has been resumed" \ |
| 2996 | -c "a session has been resumed" |
| 2997 | |
| 2998 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2999 | "$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] | 3000 | "$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] | 3001 | 0 \ |
| 3002 | -c "client hello, adding session ticket extension" \ |
| 3003 | -s "found session ticket extension" \ |
| 3004 | -s "server hello, adding session ticket extension" \ |
| 3005 | -c "found session_ticket extension" \ |
| 3006 | -c "parse new session ticket" \ |
| 3007 | -S "session successfully restored from cache" \ |
| 3008 | -s "session successfully restored from ticket" \ |
| 3009 | -s "a session has been resumed" \ |
| 3010 | -c "a session has been resumed" |
| 3011 | |
| 3012 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3013 | "$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] | 3014 | "$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] | 3015 | 0 \ |
| 3016 | -c "client hello, adding session ticket extension" \ |
| 3017 | -s "found session ticket extension" \ |
| 3018 | -s "server hello, adding session ticket extension" \ |
| 3019 | -c "found session_ticket extension" \ |
| 3020 | -c "parse new session ticket" \ |
| 3021 | -S "session successfully restored from cache" \ |
| 3022 | -S "session successfully restored from ticket" \ |
| 3023 | -S "a session has been resumed" \ |
| 3024 | -C "a session has been resumed" |
| 3025 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3026 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3027 | "$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] | 3028 | "$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] | 3029 | 0 \ |
| 3030 | -c "client hello, adding session ticket extension" \ |
| 3031 | -s "found session ticket extension" \ |
| 3032 | -s "server hello, adding session ticket extension" \ |
| 3033 | -c "found session_ticket extension" \ |
| 3034 | -c "parse new session ticket" \ |
| 3035 | -S "session successfully restored from cache" \ |
| 3036 | -s "session successfully restored from ticket" \ |
| 3037 | -s "a session has been resumed" \ |
| 3038 | -c "a session has been resumed" |
| 3039 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3040 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3041 | "$O_SRV -dtls1" \ |
| 3042 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3043 | 0 \ |
| 3044 | -c "client hello, adding session ticket extension" \ |
| 3045 | -c "found session_ticket extension" \ |
| 3046 | -c "parse new session ticket" \ |
| 3047 | -c "a session has been resumed" |
| 3048 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3049 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 7ca2f39 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 3050 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3051 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3052 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3053 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3054 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3055 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3056 | rm -f $SESSION )" \ |
| 3057 | 0 \ |
| 3058 | -s "found session ticket extension" \ |
| 3059 | -s "server hello, adding session ticket extension" \ |
| 3060 | -S "session successfully restored from cache" \ |
| 3061 | -s "session successfully restored from ticket" \ |
| 3062 | -s "a session has been resumed" |
| 3063 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3064 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3065 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3066 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3067 | "$P_SRV debug_level=3 tickets=0" \ |
| 3068 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3069 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3070 | -c "client hello, adding session ticket extension" \ |
| 3071 | -s "found session ticket extension" \ |
| 3072 | -S "server hello, adding session ticket extension" \ |
| 3073 | -C "found session_ticket extension" \ |
| 3074 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3075 | -s "session successfully restored from cache" \ |
| 3076 | -S "session successfully restored from ticket" \ |
| 3077 | -s "a session has been resumed" \ |
| 3078 | -c "a session has been resumed" |
| 3079 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3080 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3081 | "$P_SRV debug_level=3 tickets=1" \ |
| 3082 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3083 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3084 | -C "client hello, adding session ticket extension" \ |
| 3085 | -S "found session ticket extension" \ |
| 3086 | -S "server hello, adding session ticket extension" \ |
| 3087 | -C "found session_ticket extension" \ |
| 3088 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3089 | -s "session successfully restored from cache" \ |
| 3090 | -S "session successfully restored from ticket" \ |
| 3091 | -s "a session has been resumed" \ |
| 3092 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3093 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3094 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3095 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3096 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3097 | 0 \ |
| 3098 | -S "session successfully restored from cache" \ |
| 3099 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3100 | -S "a session has been resumed" \ |
| 3101 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3102 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3103 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3104 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3105 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3106 | 0 \ |
| 3107 | -s "session successfully restored from cache" \ |
| 3108 | -S "session successfully restored from ticket" \ |
| 3109 | -s "a session has been resumed" \ |
| 3110 | -c "a session has been resumed" |
| 3111 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3112 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3113 | "$P_SRV debug_level=3 tickets=0" \ |
| 3114 | "$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] | 3115 | 0 \ |
| 3116 | -s "session successfully restored from cache" \ |
| 3117 | -S "session successfully restored from ticket" \ |
| 3118 | -s "a session has been resumed" \ |
| 3119 | -c "a session has been resumed" |
| 3120 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3121 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3122 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3123 | "$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] | 3124 | 0 \ |
| 3125 | -S "session successfully restored from cache" \ |
| 3126 | -S "session successfully restored from ticket" \ |
| 3127 | -S "a session has been resumed" \ |
| 3128 | -C "a session has been resumed" |
| 3129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3130 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3131 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3132 | "$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] | 3133 | 0 \ |
| 3134 | -s "session successfully restored from cache" \ |
| 3135 | -S "session successfully restored from ticket" \ |
| 3136 | -s "a session has been resumed" \ |
| 3137 | -c "a session has been resumed" |
| 3138 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3139 | run_test "Session resume using cache: session copy" \ |
| 3140 | "$P_SRV debug_level=3 tickets=0" \ |
| 3141 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3142 | 0 \ |
| 3143 | -s "session successfully restored from cache" \ |
| 3144 | -S "session successfully restored from ticket" \ |
| 3145 | -s "a session has been resumed" \ |
| 3146 | -c "a session has been resumed" |
| 3147 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3148 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3149 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3150 | "( $O_CLI -sess_out $SESSION; \ |
| 3151 | $O_CLI -sess_in $SESSION; \ |
| 3152 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3153 | 0 \ |
| 3154 | -s "found session ticket extension" \ |
| 3155 | -S "server hello, adding session ticket extension" \ |
| 3156 | -s "session successfully restored from cache" \ |
| 3157 | -S "session successfully restored from ticket" \ |
| 3158 | -s "a session has been resumed" |
| 3159 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3160 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3161 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3162 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3163 | 0 \ |
| 3164 | -C "found session_ticket extension" \ |
| 3165 | -C "parse new session ticket" \ |
| 3166 | -c "a session has been resumed" |
| 3167 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3168 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3169 | |
| 3170 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3171 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3172 | "$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] | 3173 | 0 \ |
| 3174 | -c "client hello, adding session ticket extension" \ |
| 3175 | -s "found session ticket extension" \ |
| 3176 | -S "server hello, adding session ticket extension" \ |
| 3177 | -C "found session_ticket extension" \ |
| 3178 | -C "parse new session ticket" \ |
| 3179 | -s "session successfully restored from cache" \ |
| 3180 | -S "session successfully restored from ticket" \ |
| 3181 | -s "a session has been resumed" \ |
| 3182 | -c "a session has been resumed" |
| 3183 | |
| 3184 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3185 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3186 | "$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] | 3187 | 0 \ |
| 3188 | -C "client hello, adding session ticket extension" \ |
| 3189 | -S "found session ticket extension" \ |
| 3190 | -S "server hello, adding session ticket extension" \ |
| 3191 | -C "found session_ticket extension" \ |
| 3192 | -C "parse new session ticket" \ |
| 3193 | -s "session successfully restored from cache" \ |
| 3194 | -S "session successfully restored from ticket" \ |
| 3195 | -s "a session has been resumed" \ |
| 3196 | -c "a session has been resumed" |
| 3197 | |
| 3198 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3199 | "$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] | 3200 | "$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] | 3201 | 0 \ |
| 3202 | -S "session successfully restored from cache" \ |
| 3203 | -S "session successfully restored from ticket" \ |
| 3204 | -S "a session has been resumed" \ |
| 3205 | -C "a session has been resumed" |
| 3206 | |
| 3207 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3208 | "$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] | 3209 | "$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] | 3210 | 0 \ |
| 3211 | -s "session successfully restored from cache" \ |
| 3212 | -S "session successfully restored from ticket" \ |
| 3213 | -s "a session has been resumed" \ |
| 3214 | -c "a session has been resumed" |
| 3215 | |
| 3216 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3217 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3218 | "$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] | 3219 | 0 \ |
| 3220 | -s "session successfully restored from cache" \ |
| 3221 | -S "session successfully restored from ticket" \ |
| 3222 | -s "a session has been resumed" \ |
| 3223 | -c "a session has been resumed" |
| 3224 | |
| 3225 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3226 | "$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] | 3227 | "$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] | 3228 | 0 \ |
| 3229 | -S "session successfully restored from cache" \ |
| 3230 | -S "session successfully restored from ticket" \ |
| 3231 | -S "a session has been resumed" \ |
| 3232 | -C "a session has been resumed" |
| 3233 | |
| 3234 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3235 | "$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] | 3236 | "$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] | 3237 | 0 \ |
| 3238 | -s "session successfully restored from cache" \ |
| 3239 | -S "session successfully restored from ticket" \ |
| 3240 | -s "a session has been resumed" \ |
| 3241 | -c "a session has been resumed" |
| 3242 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3243 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3244 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3245 | "$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] | 3246 | 0 \ |
| 3247 | -s "session successfully restored from cache" \ |
| 3248 | -S "session successfully restored from ticket" \ |
| 3249 | -s "a session has been resumed" \ |
| 3250 | -c "a session has been resumed" |
| 3251 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3252 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 7ca2f39 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 3253 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3254 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3255 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3256 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3257 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3258 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3259 | rm -f $SESSION )" \ |
| 3260 | 0 \ |
| 3261 | -s "found session ticket extension" \ |
| 3262 | -S "server hello, adding session ticket extension" \ |
| 3263 | -s "session successfully restored from cache" \ |
| 3264 | -S "session successfully restored from ticket" \ |
| 3265 | -s "a session has been resumed" |
| 3266 | |
| 3267 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3268 | "$O_SRV -dtls1" \ |
| 3269 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3270 | 0 \ |
| 3271 | -C "found session_ticket extension" \ |
| 3272 | -C "parse new session ticket" \ |
| 3273 | -c "a session has been resumed" |
| 3274 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3275 | # Tests for Max Fragment Length extension |
| 3276 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3277 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3278 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3279 | "$P_SRV debug_level=3" \ |
| 3280 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3281 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3282 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3283 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3284 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3285 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3286 | -C "client hello, adding max_fragment_length extension" \ |
| 3287 | -S "found max fragment length extension" \ |
| 3288 | -S "server hello, max_fragment_length extension" \ |
| 3289 | -C "found max_fragment_length extension" |
| 3290 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3291 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3292 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3293 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3294 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3295 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3296 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3297 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3298 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3299 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3300 | -C "client hello, adding max_fragment_length extension" \ |
| 3301 | -S "found max fragment length extension" \ |
| 3302 | -S "server hello, max_fragment_length extension" \ |
| 3303 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3304 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3305 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3306 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3307 | |
| 3308 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3309 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3310 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3311 | "$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] | 3312 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3313 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3314 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3315 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3316 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3317 | -C "client hello, adding max_fragment_length extension" \ |
| 3318 | -S "found max fragment length extension" \ |
| 3319 | -S "server hello, max_fragment_length extension" \ |
| 3320 | -C "found max_fragment_length extension" \ |
| 3321 | -c "fragment larger than.*maximum " |
| 3322 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3323 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3324 | # (session fragment length will be 16384 regardless of mbedtls |
| 3325 | # content length configuration.) |
| 3326 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3327 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3328 | run_test "Max fragment length: disabled, larger message" \ |
| 3329 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3330 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3331 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3332 | -C "Maximum input fragment length is 16384" \ |
| 3333 | -C "Maximum output fragment length is 16384" \ |
| 3334 | -S "Maximum input fragment length is 16384" \ |
| 3335 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3336 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3337 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3338 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3339 | |
| 3340 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3341 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3342 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3343 | "$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] | 3344 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3345 | -C "Maximum input fragment length is 16384" \ |
| 3346 | -C "Maximum output fragment length is 16384" \ |
| 3347 | -S "Maximum input fragment length is 16384" \ |
| 3348 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3349 | -c "fragment larger than.*maximum " |
| 3350 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3351 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3352 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3353 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3354 | "$P_SRV debug_level=3" \ |
| 3355 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3356 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3357 | -c "Maximum input fragment length is 4096" \ |
| 3358 | -c "Maximum output fragment length is 4096" \ |
| 3359 | -s "Maximum input fragment length is 4096" \ |
| 3360 | -s "Maximum output fragment length is 4096" \ |
| 3361 | -c "client hello, adding max_fragment_length extension" \ |
| 3362 | -s "found max fragment length extension" \ |
| 3363 | -s "server hello, max_fragment_length extension" \ |
| 3364 | -c "found max_fragment_length extension" |
| 3365 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3366 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3367 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3368 | run_test "Max fragment length: client 512, server 1024" \ |
| 3369 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3370 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3371 | 0 \ |
| 3372 | -c "Maximum input fragment length is 512" \ |
| 3373 | -c "Maximum output fragment length is 512" \ |
| 3374 | -s "Maximum input fragment length is 512" \ |
| 3375 | -s "Maximum output fragment length is 512" \ |
| 3376 | -c "client hello, adding max_fragment_length extension" \ |
| 3377 | -s "found max fragment length extension" \ |
| 3378 | -s "server hello, max_fragment_length extension" \ |
| 3379 | -c "found max_fragment_length extension" |
| 3380 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3381 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3382 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3383 | run_test "Max fragment length: client 512, server 2048" \ |
| 3384 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3385 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3386 | 0 \ |
| 3387 | -c "Maximum input fragment length is 512" \ |
| 3388 | -c "Maximum output fragment length is 512" \ |
| 3389 | -s "Maximum input fragment length is 512" \ |
| 3390 | -s "Maximum output fragment length is 512" \ |
| 3391 | -c "client hello, adding max_fragment_length extension" \ |
| 3392 | -s "found max fragment length extension" \ |
| 3393 | -s "server hello, max_fragment_length extension" \ |
| 3394 | -c "found max_fragment_length extension" |
| 3395 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3396 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3397 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3398 | run_test "Max fragment length: client 512, server 4096" \ |
| 3399 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3400 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3401 | 0 \ |
| 3402 | -c "Maximum input fragment length is 512" \ |
| 3403 | -c "Maximum output fragment length is 512" \ |
| 3404 | -s "Maximum input fragment length is 512" \ |
| 3405 | -s "Maximum output fragment length is 512" \ |
| 3406 | -c "client hello, adding max_fragment_length extension" \ |
| 3407 | -s "found max fragment length extension" \ |
| 3408 | -s "server hello, max_fragment_length extension" \ |
| 3409 | -c "found max_fragment_length extension" |
| 3410 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3411 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3412 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3413 | run_test "Max fragment length: client 1024, server 512" \ |
| 3414 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3415 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3416 | 0 \ |
| 3417 | -c "Maximum input fragment length is 1024" \ |
| 3418 | -c "Maximum output fragment length is 1024" \ |
| 3419 | -s "Maximum input fragment length is 1024" \ |
| 3420 | -s "Maximum output fragment length is 512" \ |
| 3421 | -c "client hello, adding max_fragment_length extension" \ |
| 3422 | -s "found max fragment length extension" \ |
| 3423 | -s "server hello, max_fragment_length extension" \ |
| 3424 | -c "found max_fragment_length extension" |
| 3425 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3426 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3427 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3428 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3429 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3430 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3431 | 0 \ |
| 3432 | -c "Maximum input fragment length is 1024" \ |
| 3433 | -c "Maximum output fragment length is 1024" \ |
| 3434 | -s "Maximum input fragment length is 1024" \ |
| 3435 | -s "Maximum output fragment length is 1024" \ |
| 3436 | -c "client hello, adding max_fragment_length extension" \ |
| 3437 | -s "found max fragment length extension" \ |
| 3438 | -s "server hello, max_fragment_length extension" \ |
| 3439 | -c "found max_fragment_length extension" |
| 3440 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3441 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3442 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3443 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3444 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3445 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3446 | 0 \ |
| 3447 | -c "Maximum input fragment length is 1024" \ |
| 3448 | -c "Maximum output fragment length is 1024" \ |
| 3449 | -s "Maximum input fragment length is 1024" \ |
| 3450 | -s "Maximum output fragment length is 1024" \ |
| 3451 | -c "client hello, adding max_fragment_length extension" \ |
| 3452 | -s "found max fragment length extension" \ |
| 3453 | -s "server hello, max_fragment_length extension" \ |
| 3454 | -c "found max_fragment_length extension" |
| 3455 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3456 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3457 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3458 | run_test "Max fragment length: client 2048, server 512" \ |
| 3459 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3460 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3461 | 0 \ |
| 3462 | -c "Maximum input fragment length is 2048" \ |
| 3463 | -c "Maximum output fragment length is 2048" \ |
| 3464 | -s "Maximum input fragment length is 2048" \ |
| 3465 | -s "Maximum output fragment length is 512" \ |
| 3466 | -c "client hello, adding max_fragment_length extension" \ |
| 3467 | -s "found max fragment length extension" \ |
| 3468 | -s "server hello, max_fragment_length extension" \ |
| 3469 | -c "found max_fragment_length extension" |
| 3470 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3471 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3472 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3473 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3474 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3475 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3476 | 0 \ |
| 3477 | -c "Maximum input fragment length is 2048" \ |
| 3478 | -c "Maximum output fragment length is 2048" \ |
| 3479 | -s "Maximum input fragment length is 2048" \ |
| 3480 | -s "Maximum output fragment length is 1024" \ |
| 3481 | -c "client hello, adding max_fragment_length extension" \ |
| 3482 | -s "found max fragment length extension" \ |
| 3483 | -s "server hello, max_fragment_length extension" \ |
| 3484 | -c "found max_fragment_length extension" |
| 3485 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3486 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3487 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3488 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3489 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3490 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3491 | 0 \ |
| 3492 | -c "Maximum input fragment length is 2048" \ |
| 3493 | -c "Maximum output fragment length is 2048" \ |
| 3494 | -s "Maximum input fragment length is 2048" \ |
| 3495 | -s "Maximum output fragment length is 2048" \ |
| 3496 | -c "client hello, adding max_fragment_length extension" \ |
| 3497 | -s "found max fragment length extension" \ |
| 3498 | -s "server hello, max_fragment_length extension" \ |
| 3499 | -c "found max_fragment_length extension" |
| 3500 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3501 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3502 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3503 | run_test "Max fragment length: client 4096, server 512" \ |
| 3504 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3505 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3506 | 0 \ |
| 3507 | -c "Maximum input fragment length is 4096" \ |
| 3508 | -c "Maximum output fragment length is 4096" \ |
| 3509 | -s "Maximum input fragment length is 4096" \ |
| 3510 | -s "Maximum output fragment length is 512" \ |
| 3511 | -c "client hello, adding max_fragment_length extension" \ |
| 3512 | -s "found max fragment length extension" \ |
| 3513 | -s "server hello, max_fragment_length extension" \ |
| 3514 | -c "found max_fragment_length extension" |
| 3515 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3516 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3517 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3518 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3519 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3520 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3521 | 0 \ |
| 3522 | -c "Maximum input fragment length is 4096" \ |
| 3523 | -c "Maximum output fragment length is 4096" \ |
| 3524 | -s "Maximum input fragment length is 4096" \ |
| 3525 | -s "Maximum output fragment length is 1024" \ |
| 3526 | -c "client hello, adding max_fragment_length extension" \ |
| 3527 | -s "found max fragment length extension" \ |
| 3528 | -s "server hello, max_fragment_length extension" \ |
| 3529 | -c "found max_fragment_length extension" |
| 3530 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3531 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3532 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3533 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3534 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3535 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3536 | 0 \ |
| 3537 | -c "Maximum input fragment length is 4096" \ |
| 3538 | -c "Maximum output fragment length is 4096" \ |
| 3539 | -s "Maximum input fragment length is 4096" \ |
| 3540 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3541 | -c "client hello, adding max_fragment_length extension" \ |
| 3542 | -s "found max fragment length extension" \ |
| 3543 | -s "server hello, max_fragment_length extension" \ |
| 3544 | -c "found max_fragment_length extension" |
| 3545 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3546 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3547 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3548 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3549 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3550 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3551 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3552 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3553 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3554 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3555 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3556 | -C "client hello, adding max_fragment_length extension" \ |
| 3557 | -S "found max fragment length extension" \ |
| 3558 | -S "server hello, max_fragment_length extension" \ |
| 3559 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3560 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3561 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3562 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3563 | requires_gnutls |
| 3564 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3565 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3566 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3567 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3568 | -c "Maximum input fragment length is 4096" \ |
| 3569 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3570 | -c "client hello, adding max_fragment_length extension" \ |
| 3571 | -c "found max_fragment_length extension" |
| 3572 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3573 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3574 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3575 | run_test "Max fragment length: client, message just fits" \ |
| 3576 | "$P_SRV debug_level=3" \ |
| 3577 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3578 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3579 | -c "Maximum input fragment length is 2048" \ |
| 3580 | -c "Maximum output fragment length is 2048" \ |
| 3581 | -s "Maximum input fragment length is 2048" \ |
| 3582 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3583 | -c "client hello, adding max_fragment_length extension" \ |
| 3584 | -s "found max fragment length extension" \ |
| 3585 | -s "server hello, max_fragment_length extension" \ |
| 3586 | -c "found max_fragment_length extension" \ |
| 3587 | -c "2048 bytes written in 1 fragments" \ |
| 3588 | -s "2048 bytes read" |
| 3589 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3590 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3591 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3592 | run_test "Max fragment length: client, larger message" \ |
| 3593 | "$P_SRV debug_level=3" \ |
| 3594 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3595 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3596 | -c "Maximum input fragment length is 2048" \ |
| 3597 | -c "Maximum output fragment length is 2048" \ |
| 3598 | -s "Maximum input fragment length is 2048" \ |
| 3599 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3600 | -c "client hello, adding max_fragment_length extension" \ |
| 3601 | -s "found max fragment length extension" \ |
| 3602 | -s "server hello, max_fragment_length extension" \ |
| 3603 | -c "found max_fragment_length extension" \ |
| 3604 | -c "2345 bytes written in 2 fragments" \ |
| 3605 | -s "2048 bytes read" \ |
| 3606 | -s "297 bytes read" |
| 3607 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3608 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3609 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3610 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3611 | "$P_SRV debug_level=3 dtls=1" \ |
| 3612 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3613 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3614 | -c "Maximum input fragment length is 2048" \ |
| 3615 | -c "Maximum output fragment length is 2048" \ |
| 3616 | -s "Maximum input fragment length is 2048" \ |
| 3617 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3618 | -c "client hello, adding max_fragment_length extension" \ |
| 3619 | -s "found max fragment length extension" \ |
| 3620 | -s "server hello, max_fragment_length extension" \ |
| 3621 | -c "found max_fragment_length extension" \ |
| 3622 | -c "fragment larger than.*maximum" |
| 3623 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3624 | # Tests for renegotiation |
| 3625 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3626 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3627 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3628 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3629 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3630 | 0 \ |
| 3631 | -C "client hello, adding renegotiation extension" \ |
| 3632 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3633 | -S "found renegotiation extension" \ |
| 3634 | -s "server hello, secure renegotiation extension" \ |
| 3635 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3636 | -C "=> renegotiate" \ |
| 3637 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3638 | -S "write hello request" |
| 3639 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3640 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3641 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3642 | "$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] | 3643 | "$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] | 3644 | 0 \ |
| 3645 | -c "client hello, adding renegotiation extension" \ |
| 3646 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3647 | -s "found renegotiation extension" \ |
| 3648 | -s "server hello, secure renegotiation extension" \ |
| 3649 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3650 | -c "=> renegotiate" \ |
| 3651 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3652 | -S "write hello request" |
| 3653 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3654 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3655 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3656 | "$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] | 3657 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3658 | 0 \ |
| 3659 | -c "client hello, adding renegotiation extension" \ |
| 3660 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3661 | -s "found renegotiation extension" \ |
| 3662 | -s "server hello, secure renegotiation extension" \ |
| 3663 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3664 | -c "=> renegotiate" \ |
| 3665 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3666 | -s "write hello request" |
| 3667 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3668 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3669 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3670 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3671 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3672 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3673 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3674 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3675 | 0 \ |
| 3676 | -c "client hello, adding renegotiation extension" \ |
| 3677 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3678 | -s "found renegotiation extension" \ |
| 3679 | -s "server hello, secure renegotiation extension" \ |
| 3680 | -c "found renegotiation extension" \ |
| 3681 | -c "=> renegotiate" \ |
| 3682 | -s "=> renegotiate" \ |
| 3683 | -S "write hello request" \ |
| 3684 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3685 | |
| 3686 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3687 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3688 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3689 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3690 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3691 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3692 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3693 | 0 \ |
| 3694 | -c "client hello, adding renegotiation extension" \ |
| 3695 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3696 | -s "found renegotiation extension" \ |
| 3697 | -s "server hello, secure renegotiation extension" \ |
| 3698 | -c "found renegotiation extension" \ |
| 3699 | -c "=> renegotiate" \ |
| 3700 | -s "=> renegotiate" \ |
| 3701 | -s "write hello request" \ |
| 3702 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3703 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3704 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3705 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3706 | "$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] | 3707 | "$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] | 3708 | 0 \ |
| 3709 | -c "client hello, adding renegotiation extension" \ |
| 3710 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3711 | -s "found renegotiation extension" \ |
| 3712 | -s "server hello, secure renegotiation extension" \ |
| 3713 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3714 | -c "=> renegotiate" \ |
| 3715 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3716 | -s "write hello request" |
| 3717 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3718 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3719 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3720 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3721 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3722 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3723 | "$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" \ |
| 3724 | 0 \ |
| 3725 | -c "Maximum input fragment length is 2048" \ |
| 3726 | -c "Maximum output fragment length is 2048" \ |
| 3727 | -s "Maximum input fragment length is 2048" \ |
| 3728 | -s "Maximum output fragment length is 512" \ |
| 3729 | -c "client hello, adding max_fragment_length extension" \ |
| 3730 | -s "found max fragment length extension" \ |
| 3731 | -s "server hello, max_fragment_length extension" \ |
| 3732 | -c "found max_fragment_length extension" \ |
| 3733 | -c "client hello, adding renegotiation extension" \ |
| 3734 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3735 | -s "found renegotiation extension" \ |
| 3736 | -s "server hello, secure renegotiation extension" \ |
| 3737 | -c "found renegotiation extension" \ |
| 3738 | -c "=> renegotiate" \ |
| 3739 | -s "=> renegotiate" \ |
| 3740 | -s "write hello request" |
| 3741 | |
| 3742 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3743 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3744 | "$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] | 3745 | "$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] | 3746 | 1 \ |
| 3747 | -c "client hello, adding renegotiation extension" \ |
| 3748 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3749 | -S "found renegotiation extension" \ |
| 3750 | -s "server hello, secure renegotiation extension" \ |
| 3751 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3752 | -c "=> renegotiate" \ |
| 3753 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3754 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3755 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3756 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3757 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3758 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3759 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3760 | "$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] | 3761 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3762 | 0 \ |
| 3763 | -C "client hello, adding renegotiation extension" \ |
| 3764 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3765 | -S "found renegotiation extension" \ |
| 3766 | -s "server hello, secure renegotiation extension" \ |
| 3767 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3768 | -C "=> renegotiate" \ |
| 3769 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3770 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3771 | -S "SSL - An unexpected message was received from our peer" \ |
| 3772 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3773 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3774 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3775 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3776 | "$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] | 3777 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3778 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3779 | 0 \ |
| 3780 | -C "client hello, adding renegotiation extension" \ |
| 3781 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3782 | -S "found renegotiation extension" \ |
| 3783 | -s "server hello, secure renegotiation extension" \ |
| 3784 | -c "found renegotiation extension" \ |
| 3785 | -C "=> renegotiate" \ |
| 3786 | -S "=> renegotiate" \ |
| 3787 | -s "write hello request" \ |
| 3788 | -S "SSL - An unexpected message was received from our peer" \ |
| 3789 | -S "failed" |
| 3790 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3791 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3792 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3793 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3794 | "$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] | 3795 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3796 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3797 | 0 \ |
| 3798 | -C "client hello, adding renegotiation extension" \ |
| 3799 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3800 | -S "found renegotiation extension" \ |
| 3801 | -s "server hello, secure renegotiation extension" \ |
| 3802 | -c "found renegotiation extension" \ |
| 3803 | -C "=> renegotiate" \ |
| 3804 | -S "=> renegotiate" \ |
| 3805 | -s "write hello request" \ |
| 3806 | -S "SSL - An unexpected message was received from our peer" \ |
| 3807 | -S "failed" |
| 3808 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3809 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3810 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3811 | "$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] | 3812 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3813 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3814 | 0 \ |
| 3815 | -C "client hello, adding renegotiation extension" \ |
| 3816 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3817 | -S "found renegotiation extension" \ |
| 3818 | -s "server hello, secure renegotiation extension" \ |
| 3819 | -c "found renegotiation extension" \ |
| 3820 | -C "=> renegotiate" \ |
| 3821 | -S "=> renegotiate" \ |
| 3822 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3823 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3824 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3825 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3826 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3827 | "$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] | 3828 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3829 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3830 | 0 \ |
| 3831 | -c "client hello, adding renegotiation extension" \ |
| 3832 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3833 | -s "found renegotiation extension" \ |
| 3834 | -s "server hello, secure renegotiation extension" \ |
| 3835 | -c "found renegotiation extension" \ |
| 3836 | -c "=> renegotiate" \ |
| 3837 | -s "=> renegotiate" \ |
| 3838 | -s "write hello request" \ |
| 3839 | -S "SSL - An unexpected message was received from our peer" \ |
| 3840 | -S "failed" |
| 3841 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3842 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3843 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3844 | "$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] | 3845 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3846 | 0 \ |
| 3847 | -C "client hello, adding renegotiation extension" \ |
| 3848 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3849 | -S "found renegotiation extension" \ |
| 3850 | -s "server hello, secure renegotiation extension" \ |
| 3851 | -c "found renegotiation extension" \ |
| 3852 | -S "record counter limit reached: renegotiate" \ |
| 3853 | -C "=> renegotiate" \ |
| 3854 | -S "=> renegotiate" \ |
| 3855 | -S "write hello request" \ |
| 3856 | -S "SSL - An unexpected message was received from our peer" \ |
| 3857 | -S "failed" |
| 3858 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3859 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3860 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3861 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3862 | "$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] | 3863 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3864 | 0 \ |
| 3865 | -c "client hello, adding renegotiation extension" \ |
| 3866 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3867 | -s "found renegotiation extension" \ |
| 3868 | -s "server hello, secure renegotiation extension" \ |
| 3869 | -c "found renegotiation extension" \ |
| 3870 | -s "record counter limit reached: renegotiate" \ |
| 3871 | -c "=> renegotiate" \ |
| 3872 | -s "=> renegotiate" \ |
| 3873 | -s "write hello request" \ |
| 3874 | -S "SSL - An unexpected message was received from our peer" \ |
| 3875 | -S "failed" |
| 3876 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3877 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3878 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3879 | "$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] | 3880 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3881 | 0 \ |
| 3882 | -c "client hello, adding renegotiation extension" \ |
| 3883 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3884 | -s "found renegotiation extension" \ |
| 3885 | -s "server hello, secure renegotiation extension" \ |
| 3886 | -c "found renegotiation extension" \ |
| 3887 | -s "record counter limit reached: renegotiate" \ |
| 3888 | -c "=> renegotiate" \ |
| 3889 | -s "=> renegotiate" \ |
| 3890 | -s "write hello request" \ |
| 3891 | -S "SSL - An unexpected message was received from our peer" \ |
| 3892 | -S "failed" |
| 3893 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3894 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3895 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3896 | "$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] | 3897 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3898 | 0 \ |
| 3899 | -C "client hello, adding renegotiation extension" \ |
| 3900 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3901 | -S "found renegotiation extension" \ |
| 3902 | -s "server hello, secure renegotiation extension" \ |
| 3903 | -c "found renegotiation extension" \ |
| 3904 | -S "record counter limit reached: renegotiate" \ |
| 3905 | -C "=> renegotiate" \ |
| 3906 | -S "=> renegotiate" \ |
| 3907 | -S "write hello request" \ |
| 3908 | -S "SSL - An unexpected message was received from our peer" \ |
| 3909 | -S "failed" |
| 3910 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3911 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3912 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3913 | "$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] | 3914 | "$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] | 3915 | 0 \ |
| 3916 | -c "client hello, adding renegotiation extension" \ |
| 3917 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3918 | -s "found renegotiation extension" \ |
| 3919 | -s "server hello, secure renegotiation extension" \ |
| 3920 | -c "found renegotiation extension" \ |
| 3921 | -c "=> renegotiate" \ |
| 3922 | -s "=> renegotiate" \ |
| 3923 | -S "write hello request" |
| 3924 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3925 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3926 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3927 | "$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] | 3928 | "$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] | 3929 | 0 \ |
| 3930 | -c "client hello, adding renegotiation extension" \ |
| 3931 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3932 | -s "found renegotiation extension" \ |
| 3933 | -s "server hello, secure renegotiation extension" \ |
| 3934 | -c "found renegotiation extension" \ |
| 3935 | -c "=> renegotiate" \ |
| 3936 | -s "=> renegotiate" \ |
| 3937 | -s "write hello request" |
| 3938 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3939 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3940 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3941 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3942 | "$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] | 3943 | 0 \ |
| 3944 | -c "client hello, adding renegotiation extension" \ |
| 3945 | -c "found renegotiation extension" \ |
| 3946 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3947 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3948 | -C "error" \ |
| 3949 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3950 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3951 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3952 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3953 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3954 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3955 | "$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] | 3956 | 0 \ |
| 3957 | -c "client hello, adding renegotiation extension" \ |
| 3958 | -c "found renegotiation extension" \ |
| 3959 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3960 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3961 | -C "error" \ |
| 3962 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3963 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3964 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3965 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3966 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3967 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3968 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3969 | 1 \ |
| 3970 | -c "client hello, adding renegotiation extension" \ |
| 3971 | -C "found renegotiation extension" \ |
| 3972 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3973 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3974 | -c "error" \ |
| 3975 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3976 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3977 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3978 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3979 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3980 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3981 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3982 | allow_legacy=0" \ |
| 3983 | 1 \ |
| 3984 | -c "client hello, adding renegotiation extension" \ |
| 3985 | -C "found renegotiation extension" \ |
| 3986 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3987 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3988 | -c "error" \ |
| 3989 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3990 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3991 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3992 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3993 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3994 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3995 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3996 | allow_legacy=1" \ |
| 3997 | 0 \ |
| 3998 | -c "client hello, adding renegotiation extension" \ |
| 3999 | -C "found renegotiation extension" \ |
| 4000 | -c "=> renegotiate" \ |
| 4001 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4002 | -C "error" \ |
| 4003 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4004 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4005 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4006 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4007 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4008 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4009 | 0 \ |
| 4010 | -c "client hello, adding renegotiation extension" \ |
| 4011 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4012 | -s "found renegotiation extension" \ |
| 4013 | -s "server hello, secure renegotiation extension" \ |
| 4014 | -c "found renegotiation extension" \ |
| 4015 | -c "=> renegotiate" \ |
| 4016 | -s "=> renegotiate" \ |
| 4017 | -S "write hello request" |
| 4018 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4019 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4020 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4021 | "$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] | 4022 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4023 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4024 | 0 \ |
| 4025 | -c "client hello, adding renegotiation extension" \ |
| 4026 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4027 | -s "found renegotiation extension" \ |
| 4028 | -s "server hello, secure renegotiation extension" \ |
| 4029 | -c "found renegotiation extension" \ |
| 4030 | -c "=> renegotiate" \ |
| 4031 | -s "=> renegotiate" \ |
| 4032 | -s "write hello request" |
| 4033 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4035 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4036 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4037 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4038 | 0 \ |
| 4039 | -c "client hello, adding renegotiation extension" \ |
| 4040 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4041 | -s "found renegotiation extension" \ |
| 4042 | -s "server hello, secure renegotiation extension" \ |
| 4043 | -s "record counter limit reached: renegotiate" \ |
| 4044 | -c "=> renegotiate" \ |
| 4045 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4046 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4047 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4048 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4049 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4050 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4051 | "$G_SRV -u --mtu 4096" \ |
| 4052 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4053 | 0 \ |
| 4054 | -c "client hello, adding renegotiation extension" \ |
| 4055 | -c "found renegotiation extension" \ |
| 4056 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4057 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4058 | -C "error" \ |
| 4059 | -s "Extra-header:" |
| 4060 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4061 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4062 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4063 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4064 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4065 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4066 | "$P_CLI debug_level=3" \ |
| 4067 | 0 \ |
| 4068 | -c "found renegotiation extension" \ |
| 4069 | -C "error" \ |
| 4070 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4071 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4072 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4073 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4074 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4075 | "$P_CLI debug_level=3" \ |
| 4076 | 0 \ |
| 4077 | -C "found renegotiation extension" \ |
| 4078 | -C "error" \ |
| 4079 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4080 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4081 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4082 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4083 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4084 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4085 | 1 \ |
| 4086 | -C "found renegotiation extension" \ |
| 4087 | -c "error" \ |
| 4088 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4089 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4090 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4091 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4092 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4093 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4094 | 0 \ |
| 4095 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4096 | -s "server hello, secure renegotiation extension" |
| 4097 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4098 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4099 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4100 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4101 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4102 | 0 \ |
| 4103 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4104 | -S "server hello, secure renegotiation extension" |
| 4105 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4106 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4107 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4108 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4109 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4110 | 1 \ |
| 4111 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4112 | -S "server hello, secure renegotiation extension" |
| 4113 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4114 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4115 | |
| 4116 | requires_gnutls |
| 4117 | run_test "DER format: no trailing bytes" \ |
| 4118 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4119 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4120 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4121 | 0 \ |
| 4122 | -c "Handshake was completed" \ |
| 4123 | |
| 4124 | requires_gnutls |
| 4125 | run_test "DER format: with a trailing zero byte" \ |
| 4126 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4127 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4128 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4129 | 0 \ |
| 4130 | -c "Handshake was completed" \ |
| 4131 | |
| 4132 | requires_gnutls |
| 4133 | run_test "DER format: with a trailing random byte" \ |
| 4134 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4135 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4136 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4137 | 0 \ |
| 4138 | -c "Handshake was completed" \ |
| 4139 | |
| 4140 | requires_gnutls |
| 4141 | run_test "DER format: with 2 trailing random bytes" \ |
| 4142 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4143 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4144 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4145 | 0 \ |
| 4146 | -c "Handshake was completed" \ |
| 4147 | |
| 4148 | requires_gnutls |
| 4149 | run_test "DER format: with 4 trailing random bytes" \ |
| 4150 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4151 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4152 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4153 | 0 \ |
| 4154 | -c "Handshake was completed" \ |
| 4155 | |
| 4156 | requires_gnutls |
| 4157 | run_test "DER format: with 8 trailing random bytes" \ |
| 4158 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4159 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4160 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4161 | 0 \ |
| 4162 | -c "Handshake was completed" \ |
| 4163 | |
| 4164 | requires_gnutls |
| 4165 | run_test "DER format: with 9 trailing random bytes" \ |
| 4166 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4167 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4168 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4169 | 0 \ |
| 4170 | -c "Handshake was completed" \ |
| 4171 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4172 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4173 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4174 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4175 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4176 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4177 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4178 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4179 | 1 \ |
| 4180 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4181 | -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] | 4182 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4183 | -c "X509 - Certificate verification failed" |
| 4184 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4185 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4186 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4187 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4188 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4189 | 0 \ |
| 4190 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4191 | -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] | 4192 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4193 | -C "X509 - Certificate verification failed" |
| 4194 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4195 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4196 | "$P_SRV" \ |
| 4197 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4198 | 0 \ |
| 4199 | -c "x509_verify_cert() returned" \ |
| 4200 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4201 | -c "! Certificate verification flags"\ |
| 4202 | -C "! mbedtls_ssl_handshake returned" \ |
| 4203 | -C "X509 - Certificate verification failed" \ |
| 4204 | -C "SSL - No CA Chain is set, but required to operate" |
| 4205 | |
| 4206 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4207 | "$P_SRV" \ |
| 4208 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4209 | 1 \ |
| 4210 | -c "x509_verify_cert() returned" \ |
| 4211 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4212 | -c "! Certificate verification flags"\ |
| 4213 | -c "! mbedtls_ssl_handshake returned" \ |
| 4214 | -c "SSL - No CA Chain is set, but required to operate" |
| 4215 | |
| 4216 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4217 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4218 | # the client informs the server about the supported curves - it does, though, in the |
| 4219 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4220 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4221 | # different means to have the server ignoring the client's supported curve list. |
| 4222 | |
| 4223 | requires_config_enabled MBEDTLS_ECP_C |
| 4224 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4225 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4226 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4227 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4228 | 1 \ |
| 4229 | -c "bad certificate (EC key curve)"\ |
| 4230 | -c "! Certificate verification flags"\ |
| 4231 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4232 | |
| 4233 | requires_config_enabled MBEDTLS_ECP_C |
| 4234 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4235 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4236 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4237 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4238 | 1 \ |
| 4239 | -c "bad certificate (EC key curve)"\ |
| 4240 | -c "! Certificate verification flags"\ |
| 4241 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4242 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4243 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4244 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4245 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4246 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4247 | 0 \ |
| 4248 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4249 | -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] | 4250 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4251 | -C "X509 - Certificate verification failed" |
| 4252 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4253 | run_test "Authentication: client SHA256, server required" \ |
| 4254 | "$P_SRV auth_mode=required" \ |
| 4255 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4256 | key_file=data_files/server6.key \ |
| 4257 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4258 | 0 \ |
| 4259 | -c "Supported Signature Algorithm found: 4," \ |
| 4260 | -c "Supported Signature Algorithm found: 5," |
| 4261 | |
| 4262 | run_test "Authentication: client SHA384, server required" \ |
| 4263 | "$P_SRV auth_mode=required" \ |
| 4264 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4265 | key_file=data_files/server6.key \ |
| 4266 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4267 | 0 \ |
| 4268 | -c "Supported Signature Algorithm found: 4," \ |
| 4269 | -c "Supported Signature Algorithm found: 5," |
| 4270 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4271 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4272 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4273 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4274 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4275 | key_file=data_files/server5.key" \ |
| 4276 | 1 \ |
| 4277 | -S "skip write certificate request" \ |
| 4278 | -C "skip parse certificate request" \ |
| 4279 | -c "got a certificate request" \ |
| 4280 | -c "got no certificate to send" \ |
| 4281 | -S "x509_verify_cert() returned" \ |
| 4282 | -s "client has no certificate" \ |
| 4283 | -s "! mbedtls_ssl_handshake returned" \ |
| 4284 | -c "! mbedtls_ssl_handshake returned" \ |
| 4285 | -s "No client certification received from the client, but required by the authentication mode" |
| 4286 | |
| 4287 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4288 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4289 | "$P_CLI debug_level=3 crt_file=none \ |
| 4290 | key_file=data_files/server5.key" \ |
| 4291 | 1 \ |
| 4292 | -S "skip write certificate request" \ |
| 4293 | -C "skip parse certificate request" \ |
| 4294 | -c "got a certificate request" \ |
| 4295 | -c "= write certificate$" \ |
| 4296 | -C "skip write certificate$" \ |
| 4297 | -S "x509_verify_cert() returned" \ |
| 4298 | -s "client has no certificate" \ |
| 4299 | -s "! mbedtls_ssl_handshake returned" \ |
| 4300 | -c "! mbedtls_ssl_handshake returned" \ |
| 4301 | -s "No client certification received from the client, but required by the authentication mode" |
| 4302 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4303 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4304 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4305 | "$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] | 4306 | key_file=data_files/server5.key" \ |
| 4307 | 1 \ |
| 4308 | -S "skip write certificate request" \ |
| 4309 | -C "skip parse certificate request" \ |
| 4310 | -c "got a certificate request" \ |
| 4311 | -C "skip write certificate" \ |
| 4312 | -C "skip write certificate verify" \ |
| 4313 | -S "skip parse certificate verify" \ |
| 4314 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4315 | -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] | 4316 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4317 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4318 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4319 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4320 | # We don't check that the client receives the alert because it might |
| 4321 | # detect that its write end of the connection is closed and abort |
| 4322 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4323 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4324 | run_test "Authentication: client cert not trusted, server required" \ |
| 4325 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4326 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4327 | key_file=data_files/server5.key" \ |
| 4328 | 1 \ |
| 4329 | -S "skip write certificate request" \ |
| 4330 | -C "skip parse certificate request" \ |
| 4331 | -c "got a certificate request" \ |
| 4332 | -C "skip write certificate" \ |
| 4333 | -C "skip write certificate verify" \ |
| 4334 | -S "skip parse certificate verify" \ |
| 4335 | -s "x509_verify_cert() returned" \ |
| 4336 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4337 | -s "! mbedtls_ssl_handshake returned" \ |
| 4338 | -c "! mbedtls_ssl_handshake returned" \ |
| 4339 | -s "X509 - Certificate verification failed" |
| 4340 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4341 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4342 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4343 | "$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] | 4344 | key_file=data_files/server5.key" \ |
| 4345 | 0 \ |
| 4346 | -S "skip write certificate request" \ |
| 4347 | -C "skip parse certificate request" \ |
| 4348 | -c "got a certificate request" \ |
| 4349 | -C "skip write certificate" \ |
| 4350 | -C "skip write certificate verify" \ |
| 4351 | -S "skip parse certificate verify" \ |
| 4352 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4353 | -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] | 4354 | -S "! mbedtls_ssl_handshake returned" \ |
| 4355 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4356 | -S "X509 - Certificate verification failed" |
| 4357 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4358 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4359 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4360 | "$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] | 4361 | key_file=data_files/server5.key" \ |
| 4362 | 0 \ |
| 4363 | -s "skip write certificate request" \ |
| 4364 | -C "skip parse certificate request" \ |
| 4365 | -c "got no certificate request" \ |
| 4366 | -c "skip write certificate" \ |
| 4367 | -c "skip write certificate verify" \ |
| 4368 | -s "skip parse certificate verify" \ |
| 4369 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4370 | -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] | 4371 | -S "! mbedtls_ssl_handshake returned" \ |
| 4372 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4373 | -S "X509 - Certificate verification failed" |
| 4374 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4375 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4376 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4377 | "$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] | 4378 | 0 \ |
| 4379 | -S "skip write certificate request" \ |
| 4380 | -C "skip parse certificate request" \ |
| 4381 | -c "got a certificate request" \ |
| 4382 | -C "skip write certificate$" \ |
| 4383 | -C "got no certificate to send" \ |
| 4384 | -S "SSLv3 client has no certificate" \ |
| 4385 | -c "skip write certificate verify" \ |
| 4386 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4387 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4388 | -S "! mbedtls_ssl_handshake returned" \ |
| 4389 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4390 | -S "X509 - Certificate verification failed" |
| 4391 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4392 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4393 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4394 | "$O_CLI" \ |
| 4395 | 0 \ |
| 4396 | -S "skip write certificate request" \ |
| 4397 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4398 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4399 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4400 | -S "X509 - Certificate verification failed" |
| 4401 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4402 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4403 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4404 | "$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] | 4405 | 0 \ |
| 4406 | -C "skip parse certificate request" \ |
| 4407 | -c "got a certificate request" \ |
| 4408 | -C "skip write certificate$" \ |
| 4409 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4410 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4411 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4412 | run_test "Authentication: client no cert, openssl server required" \ |
| 4413 | "$O_SRV -Verify 10" \ |
| 4414 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4415 | 1 \ |
| 4416 | -C "skip parse certificate request" \ |
| 4417 | -c "got a certificate request" \ |
| 4418 | -C "skip write certificate$" \ |
| 4419 | -c "skip write certificate verify" \ |
| 4420 | -c "! mbedtls_ssl_handshake returned" |
| 4421 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4422 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4423 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4424 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4425 | "$P_CLI debug_level=3 crt_file=none key_file=none min_version=ssl3" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4426 | 0 \ |
| 4427 | -S "skip write certificate request" \ |
| 4428 | -C "skip parse certificate request" \ |
| 4429 | -c "got a certificate request" \ |
| 4430 | -C "skip write certificate$" \ |
| 4431 | -c "skip write certificate verify" \ |
| 4432 | -c "got no certificate to send" \ |
| 4433 | -s "SSLv3 client has no certificate" \ |
| 4434 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4435 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4436 | -S "! mbedtls_ssl_handshake returned" \ |
| 4437 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4438 | -S "X509 - Certificate verification failed" |
| 4439 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4440 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4441 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4442 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4443 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4444 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4445 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4446 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4447 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4448 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4449 | # are in place so that the semantics are consistent with the test description. |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4450 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4451 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4452 | run_test "Authentication: server max_int chain, client default" \ |
| 4453 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4454 | key_file=data_files/dir-maxpath/09.key" \ |
| 4455 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4456 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4457 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4458 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4459 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4460 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4461 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4462 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4463 | key_file=data_files/dir-maxpath/10.key" \ |
| 4464 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4465 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4466 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4467 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4468 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4469 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4470 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4471 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4472 | key_file=data_files/dir-maxpath/10.key" \ |
| 4473 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4474 | auth_mode=optional" \ |
| 4475 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4476 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4477 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4478 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4479 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4480 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4481 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4482 | key_file=data_files/dir-maxpath/10.key" \ |
| 4483 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4484 | auth_mode=none" \ |
| 4485 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4486 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4487 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4488 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4489 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4490 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4491 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4492 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4493 | key_file=data_files/dir-maxpath/10.key" \ |
| 4494 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4495 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4496 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4497 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4498 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4499 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4500 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4501 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4502 | key_file=data_files/dir-maxpath/10.key" \ |
| 4503 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4504 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4505 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4506 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4507 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4508 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4509 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4510 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4511 | key_file=data_files/dir-maxpath/10.key" \ |
| 4512 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4513 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4514 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4515 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4516 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4517 | run_test "Authentication: client max_int chain, server required" \ |
| 4518 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4519 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4520 | key_file=data_files/dir-maxpath/09.key" \ |
| 4521 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4522 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4523 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4524 | # Tests for CA list in CertificateRequest messages |
| 4525 | |
| 4526 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4527 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4528 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4529 | key_file=data_files/server6.key" \ |
| 4530 | 0 \ |
| 4531 | -s "requested DN" |
| 4532 | |
| 4533 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4534 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4535 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4536 | key_file=data_files/server6.key" \ |
| 4537 | 0 \ |
| 4538 | -S "requested DN" |
| 4539 | |
| 4540 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4541 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4542 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4543 | key_file=data_files/server5.key" \ |
| 4544 | 1 \ |
| 4545 | -S "requested DN" \ |
| 4546 | -s "x509_verify_cert() returned" \ |
| 4547 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4548 | -s "! mbedtls_ssl_handshake returned" \ |
| 4549 | -c "! mbedtls_ssl_handshake returned" \ |
| 4550 | -s "X509 - Certificate verification failed" |
| 4551 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4552 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4553 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4554 | |
| 4555 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4556 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4557 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4558 | key_file=data_files/server5.key" \ |
| 4559 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4560 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4561 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4562 | -c "x509_verify_cert() returned" \ |
| 4563 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4564 | -c "! mbedtls_ssl_handshake returned" \ |
| 4565 | -c "X509 - Certificate verification failed" |
| 4566 | |
| 4567 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4568 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4569 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4570 | key_file=data_files/server5.key" \ |
| 4571 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4572 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4573 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4574 | -c "x509_verify_cert() returned" \ |
| 4575 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4576 | -C "! mbedtls_ssl_handshake returned" \ |
| 4577 | -C "X509 - Certificate verification failed" |
| 4578 | |
| 4579 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4580 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4581 | # the client informs the server about the supported curves - it does, though, in the |
| 4582 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4583 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4584 | # different means to have the server ignoring the client's supported curve list. |
| 4585 | |
| 4586 | requires_config_enabled MBEDTLS_ECP_C |
| 4587 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4588 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4589 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4590 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4591 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4592 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4593 | -c "use CA callback for X.509 CRT verification" \ |
| 4594 | -c "bad certificate (EC key curve)" \ |
| 4595 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4596 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4597 | |
| 4598 | requires_config_enabled MBEDTLS_ECP_C |
| 4599 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4600 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4601 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4602 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4603 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4604 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4605 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4606 | -c "bad certificate (EC key curve)"\ |
| 4607 | -c "! Certificate verification flags"\ |
| 4608 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4609 | |
| 4610 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4611 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4612 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4613 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4614 | key_file=data_files/server6.key \ |
| 4615 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4616 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4617 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4618 | -c "Supported Signature Algorithm found: 4," \ |
| 4619 | -c "Supported Signature Algorithm found: 5," |
| 4620 | |
| 4621 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4622 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4623 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4624 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4625 | key_file=data_files/server6.key \ |
| 4626 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4627 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4628 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4629 | -c "Supported Signature Algorithm found: 4," \ |
| 4630 | -c "Supported Signature Algorithm found: 5," |
| 4631 | |
| 4632 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4633 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4634 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4635 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4636 | key_file=data_files/server5.key" \ |
| 4637 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4638 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4639 | -S "skip write certificate request" \ |
| 4640 | -C "skip parse certificate request" \ |
| 4641 | -c "got a certificate request" \ |
| 4642 | -C "skip write certificate" \ |
| 4643 | -C "skip write certificate verify" \ |
| 4644 | -S "skip parse certificate verify" \ |
| 4645 | -s "x509_verify_cert() returned" \ |
| 4646 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4647 | -s "! mbedtls_ssl_handshake returned" \ |
| 4648 | -s "send alert level=2 message=48" \ |
| 4649 | -c "! mbedtls_ssl_handshake returned" \ |
| 4650 | -s "X509 - Certificate verification failed" |
| 4651 | # We don't check that the client receives the alert because it might |
| 4652 | # detect that its write end of the connection is closed and abort |
| 4653 | # before reading the alert message. |
| 4654 | |
| 4655 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4656 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4657 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4658 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4659 | key_file=data_files/server5.key" \ |
| 4660 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4661 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4662 | -S "skip write certificate request" \ |
| 4663 | -C "skip parse certificate request" \ |
| 4664 | -c "got a certificate request" \ |
| 4665 | -C "skip write certificate" \ |
| 4666 | -C "skip write certificate verify" \ |
| 4667 | -S "skip parse certificate verify" \ |
| 4668 | -s "x509_verify_cert() returned" \ |
| 4669 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4670 | -s "! mbedtls_ssl_handshake returned" \ |
| 4671 | -c "! mbedtls_ssl_handshake returned" \ |
| 4672 | -s "X509 - Certificate verification failed" |
| 4673 | |
| 4674 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4675 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4676 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4677 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4678 | key_file=data_files/server5.key" \ |
| 4679 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4680 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4681 | -S "skip write certificate request" \ |
| 4682 | -C "skip parse certificate request" \ |
| 4683 | -c "got a certificate request" \ |
| 4684 | -C "skip write certificate" \ |
| 4685 | -C "skip write certificate verify" \ |
| 4686 | -S "skip parse certificate verify" \ |
| 4687 | -s "x509_verify_cert() returned" \ |
| 4688 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4689 | -S "! mbedtls_ssl_handshake returned" \ |
| 4690 | -C "! mbedtls_ssl_handshake returned" \ |
| 4691 | -S "X509 - Certificate verification failed" |
| 4692 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4693 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4694 | requires_full_size_output_buffer |
| 4695 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4696 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4697 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4698 | key_file=data_files/dir-maxpath/09.key" \ |
| 4699 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4700 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4701 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4702 | -C "X509 - A fatal error occurred" |
| 4703 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4704 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4705 | requires_full_size_output_buffer |
| 4706 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4707 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4708 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4709 | key_file=data_files/dir-maxpath/10.key" \ |
| 4710 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4711 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4712 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4713 | -c "X509 - A fatal error occurred" |
| 4714 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4715 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4716 | requires_full_size_output_buffer |
| 4717 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4718 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4719 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4720 | key_file=data_files/dir-maxpath/10.key" \ |
| 4721 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4722 | debug_level=3 auth_mode=optional" \ |
| 4723 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4724 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4725 | -c "X509 - A fatal error occurred" |
| 4726 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4727 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4728 | requires_full_size_output_buffer |
| 4729 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4730 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4731 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4732 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4733 | key_file=data_files/dir-maxpath/10.key" \ |
| 4734 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4735 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4736 | -s "X509 - A fatal error occurred" |
| 4737 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4738 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4739 | requires_full_size_output_buffer |
| 4740 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4741 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4742 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4743 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4744 | key_file=data_files/dir-maxpath/10.key" \ |
| 4745 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4746 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4747 | -s "X509 - A fatal error occurred" |
| 4748 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4749 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4750 | requires_full_size_output_buffer |
| 4751 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4752 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4753 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4754 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4755 | key_file=data_files/dir-maxpath/09.key" \ |
| 4756 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4757 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4758 | -S "X509 - A fatal error occurred" |
| 4759 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4760 | # Tests for certificate selection based on SHA verson |
| 4761 | |
| 4762 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4763 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4764 | key_file=data_files/server5.key \ |
| 4765 | crt_file2=data_files/server5-sha1.crt \ |
| 4766 | key_file2=data_files/server5.key" \ |
| 4767 | "$P_CLI force_version=tls1_2" \ |
| 4768 | 0 \ |
| 4769 | -c "signed using.*ECDSA with SHA256" \ |
| 4770 | -C "signed using.*ECDSA with SHA1" |
| 4771 | |
| 4772 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4773 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4774 | key_file=data_files/server5.key \ |
| 4775 | crt_file2=data_files/server5-sha1.crt \ |
| 4776 | key_file2=data_files/server5.key" \ |
| 4777 | "$P_CLI force_version=tls1_1" \ |
| 4778 | 0 \ |
| 4779 | -C "signed using.*ECDSA with SHA256" \ |
| 4780 | -c "signed using.*ECDSA with SHA1" |
| 4781 | |
| 4782 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4783 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4784 | key_file=data_files/server5.key \ |
| 4785 | crt_file2=data_files/server5-sha1.crt \ |
| 4786 | key_file2=data_files/server5.key" \ |
| 4787 | "$P_CLI force_version=tls1" \ |
| 4788 | 0 \ |
| 4789 | -C "signed using.*ECDSA with SHA256" \ |
| 4790 | -c "signed using.*ECDSA with SHA1" |
| 4791 | |
| 4792 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4793 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4794 | key_file=data_files/server5.key \ |
| 4795 | crt_file2=data_files/server6.crt \ |
| 4796 | key_file2=data_files/server6.key" \ |
| 4797 | "$P_CLI force_version=tls1_1" \ |
| 4798 | 0 \ |
| 4799 | -c "serial number.*09" \ |
| 4800 | -c "signed using.*ECDSA with SHA256" \ |
| 4801 | -C "signed using.*ECDSA with SHA1" |
| 4802 | |
| 4803 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4804 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4805 | key_file=data_files/server6.key \ |
| 4806 | crt_file2=data_files/server5.crt \ |
| 4807 | key_file2=data_files/server5.key" \ |
| 4808 | "$P_CLI force_version=tls1_1" \ |
| 4809 | 0 \ |
| 4810 | -c "serial number.*0A" \ |
| 4811 | -c "signed using.*ECDSA with SHA256" \ |
| 4812 | -C "signed using.*ECDSA with SHA1" |
| 4813 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4814 | # tests for SNI |
| 4815 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4816 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4817 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4818 | 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] | 4819 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4820 | 0 \ |
| 4821 | -S "parse ServerName extension" \ |
| 4822 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4823 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4824 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4825 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4826 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4827 | 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] | 4828 | 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] | 4829 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4830 | 0 \ |
| 4831 | -s "parse ServerName extension" \ |
| 4832 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4833 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4835 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4836 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4837 | 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] | 4838 | 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] | 4839 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4840 | 0 \ |
| 4841 | -s "parse ServerName extension" \ |
| 4842 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4843 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4844 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4845 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4846 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4847 | 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] | 4848 | 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] | 4849 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4850 | 1 \ |
| 4851 | -s "parse ServerName extension" \ |
| 4852 | -s "ssl_sni_wrapper() returned" \ |
| 4853 | -s "mbedtls_ssl_handshake returned" \ |
| 4854 | -c "mbedtls_ssl_handshake returned" \ |
| 4855 | -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] | 4856 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4857 | run_test "SNI: client auth no override: optional" \ |
| 4858 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4859 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4860 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4861 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4862 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4863 | -S "skip write certificate request" \ |
| 4864 | -C "skip parse certificate request" \ |
| 4865 | -c "got a certificate request" \ |
| 4866 | -C "skip write certificate" \ |
| 4867 | -C "skip write certificate verify" \ |
| 4868 | -S "skip parse certificate verify" |
| 4869 | |
| 4870 | run_test "SNI: client auth override: none -> optional" \ |
| 4871 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4872 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4873 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4874 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4875 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4876 | -S "skip write certificate request" \ |
| 4877 | -C "skip parse certificate request" \ |
| 4878 | -c "got a certificate request" \ |
| 4879 | -C "skip write certificate" \ |
| 4880 | -C "skip write certificate verify" \ |
| 4881 | -S "skip parse certificate verify" |
| 4882 | |
| 4883 | run_test "SNI: client auth override: optional -> none" \ |
| 4884 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4885 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4886 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4887 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4888 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4889 | -s "skip write certificate request" \ |
| 4890 | -C "skip parse certificate request" \ |
| 4891 | -c "got no certificate request" \ |
| 4892 | -c "skip write certificate" \ |
| 4893 | -c "skip write certificate verify" \ |
| 4894 | -s "skip parse certificate verify" |
| 4895 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4896 | run_test "SNI: CA no override" \ |
| 4897 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4898 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4899 | ca_file=data_files/test-ca.crt \ |
| 4900 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4901 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4902 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4903 | 1 \ |
| 4904 | -S "skip write certificate request" \ |
| 4905 | -C "skip parse certificate request" \ |
| 4906 | -c "got a certificate request" \ |
| 4907 | -C "skip write certificate" \ |
| 4908 | -C "skip write certificate verify" \ |
| 4909 | -S "skip parse certificate verify" \ |
| 4910 | -s "x509_verify_cert() returned" \ |
| 4911 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4912 | -S "The certificate has been revoked (is on a CRL)" |
| 4913 | |
| 4914 | run_test "SNI: CA override" \ |
| 4915 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4916 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4917 | ca_file=data_files/test-ca.crt \ |
| 4918 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4919 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4920 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4921 | 0 \ |
| 4922 | -S "skip write certificate request" \ |
| 4923 | -C "skip parse certificate request" \ |
| 4924 | -c "got a certificate request" \ |
| 4925 | -C "skip write certificate" \ |
| 4926 | -C "skip write certificate verify" \ |
| 4927 | -S "skip parse certificate verify" \ |
| 4928 | -S "x509_verify_cert() returned" \ |
| 4929 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4930 | -S "The certificate has been revoked (is on a CRL)" |
| 4931 | |
| 4932 | run_test "SNI: CA override with CRL" \ |
| 4933 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4934 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4935 | ca_file=data_files/test-ca.crt \ |
| 4936 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4937 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4938 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4939 | 1 \ |
| 4940 | -S "skip write certificate request" \ |
| 4941 | -C "skip parse certificate request" \ |
| 4942 | -c "got a certificate request" \ |
| 4943 | -C "skip write certificate" \ |
| 4944 | -C "skip write certificate verify" \ |
| 4945 | -S "skip parse certificate verify" \ |
| 4946 | -s "x509_verify_cert() returned" \ |
| 4947 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4948 | -s "The certificate has been revoked (is on a CRL)" |
| 4949 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4950 | # Tests for SNI and DTLS |
| 4951 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4952 | run_test "SNI: DTLS, no SNI callback" \ |
| 4953 | "$P_SRV debug_level=3 dtls=1 \ |
| 4954 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4955 | "$P_CLI server_name=localhost dtls=1" \ |
| 4956 | 0 \ |
| 4957 | -S "parse ServerName extension" \ |
| 4958 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4959 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4960 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4961 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4962 | "$P_SRV debug_level=3 dtls=1 \ |
| 4963 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4964 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4965 | "$P_CLI server_name=localhost dtls=1" \ |
| 4966 | 0 \ |
| 4967 | -s "parse ServerName extension" \ |
| 4968 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4969 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4970 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4971 | run_test "SNI: DTLS, matching cert 2" \ |
| 4972 | "$P_SRV debug_level=3 dtls=1 \ |
| 4973 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4974 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4975 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4976 | 0 \ |
| 4977 | -s "parse ServerName extension" \ |
| 4978 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4979 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4980 | |
| 4981 | run_test "SNI: DTLS, no matching cert" \ |
| 4982 | "$P_SRV debug_level=3 dtls=1 \ |
| 4983 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4984 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4985 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4986 | 1 \ |
| 4987 | -s "parse ServerName extension" \ |
| 4988 | -s "ssl_sni_wrapper() returned" \ |
| 4989 | -s "mbedtls_ssl_handshake returned" \ |
| 4990 | -c "mbedtls_ssl_handshake returned" \ |
| 4991 | -c "SSL - A fatal alert message was received from our peer" |
| 4992 | |
| 4993 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4994 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4995 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4996 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4997 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4998 | 0 \ |
| 4999 | -S "skip write certificate request" \ |
| 5000 | -C "skip parse certificate request" \ |
| 5001 | -c "got a certificate request" \ |
| 5002 | -C "skip write certificate" \ |
| 5003 | -C "skip write certificate verify" \ |
| 5004 | -S "skip parse certificate verify" |
| 5005 | |
| 5006 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5007 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5008 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5009 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5010 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5011 | 0 \ |
| 5012 | -S "skip write certificate request" \ |
| 5013 | -C "skip parse certificate request" \ |
| 5014 | -c "got a certificate request" \ |
| 5015 | -C "skip write certificate" \ |
| 5016 | -C "skip write certificate verify" \ |
| 5017 | -S "skip parse certificate verify" |
| 5018 | |
| 5019 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5020 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5021 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5022 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5023 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5024 | 0 \ |
| 5025 | -s "skip write certificate request" \ |
| 5026 | -C "skip parse certificate request" \ |
| 5027 | -c "got no certificate request" \ |
| 5028 | -c "skip write certificate" \ |
| 5029 | -c "skip write certificate verify" \ |
| 5030 | -s "skip parse certificate verify" |
| 5031 | |
| 5032 | run_test "SNI: DTLS, CA no override" \ |
| 5033 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5034 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5035 | ca_file=data_files/test-ca.crt \ |
| 5036 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5037 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5038 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5039 | 1 \ |
| 5040 | -S "skip write certificate request" \ |
| 5041 | -C "skip parse certificate request" \ |
| 5042 | -c "got a certificate request" \ |
| 5043 | -C "skip write certificate" \ |
| 5044 | -C "skip write certificate verify" \ |
| 5045 | -S "skip parse certificate verify" \ |
| 5046 | -s "x509_verify_cert() returned" \ |
| 5047 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5048 | -S "The certificate has been revoked (is on a CRL)" |
| 5049 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5050 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5051 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5052 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5053 | ca_file=data_files/test-ca.crt \ |
| 5054 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5055 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5056 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5057 | 0 \ |
| 5058 | -S "skip write certificate request" \ |
| 5059 | -C "skip parse certificate request" \ |
| 5060 | -c "got a certificate request" \ |
| 5061 | -C "skip write certificate" \ |
| 5062 | -C "skip write certificate verify" \ |
| 5063 | -S "skip parse certificate verify" \ |
| 5064 | -S "x509_verify_cert() returned" \ |
| 5065 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5066 | -S "The certificate has been revoked (is on a CRL)" |
| 5067 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5068 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5069 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5070 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5071 | ca_file=data_files/test-ca.crt \ |
| 5072 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5073 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5074 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5075 | 1 \ |
| 5076 | -S "skip write certificate request" \ |
| 5077 | -C "skip parse certificate request" \ |
| 5078 | -c "got a certificate request" \ |
| 5079 | -C "skip write certificate" \ |
| 5080 | -C "skip write certificate verify" \ |
| 5081 | -S "skip parse certificate verify" \ |
| 5082 | -s "x509_verify_cert() returned" \ |
| 5083 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5084 | -s "The certificate has been revoked (is on a CRL)" |
| 5085 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5086 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5087 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5088 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5089 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5090 | "$P_CLI nbio=2 tickets=0" \ |
| 5091 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5092 | -S "mbedtls_ssl_handshake returned" \ |
| 5093 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5094 | -c "Read from server: .* bytes read" |
| 5095 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5096 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5097 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5098 | "$P_CLI nbio=2 tickets=0" \ |
| 5099 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5100 | -S "mbedtls_ssl_handshake returned" \ |
| 5101 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5102 | -c "Read from server: .* bytes read" |
| 5103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5104 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5105 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5106 | "$P_CLI nbio=2 tickets=1" \ |
| 5107 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5108 | -S "mbedtls_ssl_handshake returned" \ |
| 5109 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5110 | -c "Read from server: .* bytes read" |
| 5111 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5112 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5113 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5114 | "$P_CLI nbio=2 tickets=1" \ |
| 5115 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5116 | -S "mbedtls_ssl_handshake returned" \ |
| 5117 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5118 | -c "Read from server: .* bytes read" |
| 5119 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5120 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5121 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5122 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5123 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5124 | -S "mbedtls_ssl_handshake returned" \ |
| 5125 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5126 | -c "Read from server: .* bytes read" |
| 5127 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5128 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5129 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5130 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5131 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5132 | -S "mbedtls_ssl_handshake returned" \ |
| 5133 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5134 | -c "Read from server: .* bytes read" |
| 5135 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5136 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5137 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5138 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5139 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5140 | -S "mbedtls_ssl_handshake returned" \ |
| 5141 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5142 | -c "Read from server: .* bytes read" |
| 5143 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5144 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5145 | |
| 5146 | run_test "Event-driven I/O: basic handshake" \ |
| 5147 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5148 | "$P_CLI event=1 tickets=0" \ |
| 5149 | 0 \ |
| 5150 | -S "mbedtls_ssl_handshake returned" \ |
| 5151 | -C "mbedtls_ssl_handshake returned" \ |
| 5152 | -c "Read from server: .* bytes read" |
| 5153 | |
| 5154 | run_test "Event-driven I/O: client auth" \ |
| 5155 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5156 | "$P_CLI event=1 tickets=0" \ |
| 5157 | 0 \ |
| 5158 | -S "mbedtls_ssl_handshake returned" \ |
| 5159 | -C "mbedtls_ssl_handshake returned" \ |
| 5160 | -c "Read from server: .* bytes read" |
| 5161 | |
| 5162 | run_test "Event-driven I/O: ticket" \ |
| 5163 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5164 | "$P_CLI event=1 tickets=1" \ |
| 5165 | 0 \ |
| 5166 | -S "mbedtls_ssl_handshake returned" \ |
| 5167 | -C "mbedtls_ssl_handshake returned" \ |
| 5168 | -c "Read from server: .* bytes read" |
| 5169 | |
| 5170 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5171 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5172 | "$P_CLI event=1 tickets=1" \ |
| 5173 | 0 \ |
| 5174 | -S "mbedtls_ssl_handshake returned" \ |
| 5175 | -C "mbedtls_ssl_handshake returned" \ |
| 5176 | -c "Read from server: .* bytes read" |
| 5177 | |
| 5178 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5179 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5180 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5181 | 0 \ |
| 5182 | -S "mbedtls_ssl_handshake returned" \ |
| 5183 | -C "mbedtls_ssl_handshake returned" \ |
| 5184 | -c "Read from server: .* bytes read" |
| 5185 | |
| 5186 | run_test "Event-driven I/O: ticket + resume" \ |
| 5187 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5188 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5189 | 0 \ |
| 5190 | -S "mbedtls_ssl_handshake returned" \ |
| 5191 | -C "mbedtls_ssl_handshake returned" \ |
| 5192 | -c "Read from server: .* bytes read" |
| 5193 | |
| 5194 | run_test "Event-driven I/O: session-id resume" \ |
| 5195 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5196 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5197 | 0 \ |
| 5198 | -S "mbedtls_ssl_handshake returned" \ |
| 5199 | -C "mbedtls_ssl_handshake returned" \ |
| 5200 | -c "Read from server: .* bytes read" |
| 5201 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5202 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5203 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5204 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5205 | 0 \ |
| 5206 | -c "Read from server: .* bytes read" |
| 5207 | |
| 5208 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5209 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5210 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5211 | 0 \ |
| 5212 | -c "Read from server: .* bytes read" |
| 5213 | |
| 5214 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5215 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5216 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5217 | 0 \ |
| 5218 | -c "Read from server: .* bytes read" |
| 5219 | |
| 5220 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5221 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5222 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5223 | 0 \ |
| 5224 | -c "Read from server: .* bytes read" |
| 5225 | |
| 5226 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5227 | "$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] | 5228 | "$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] | 5229 | 0 \ |
| 5230 | -c "Read from server: .* bytes read" |
| 5231 | |
| 5232 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5233 | "$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] | 5234 | "$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] | 5235 | 0 \ |
| 5236 | -c "Read from server: .* bytes read" |
| 5237 | |
| 5238 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5239 | "$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] | 5240 | "$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] | 5241 | 0 \ |
| 5242 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5243 | |
| 5244 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5245 | # During session resumption, the client will send its ApplicationData record |
| 5246 | # within the same datagram as the Finished messages. In this situation, the |
| 5247 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5248 | # because the ApplicationData request has already been queued internally. |
| 5249 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5250 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5251 | "$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] | 5252 | "$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] | 5253 | 0 \ |
| 5254 | -c "Read from server: .* bytes read" |
| 5255 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5256 | # Tests for version negotiation |
| 5257 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5258 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5259 | "$P_SRV" \ |
| 5260 | "$P_CLI" \ |
| 5261 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5262 | -S "mbedtls_ssl_handshake returned" \ |
| 5263 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5264 | -s "Protocol is TLSv1.2" \ |
| 5265 | -c "Protocol is TLSv1.2" |
| 5266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5267 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5268 | "$P_SRV" \ |
| 5269 | "$P_CLI max_version=tls1_1" \ |
| 5270 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5271 | -S "mbedtls_ssl_handshake returned" \ |
| 5272 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5273 | -s "Protocol is TLSv1.1" \ |
| 5274 | -c "Protocol is TLSv1.1" |
| 5275 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5276 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5277 | "$P_SRV max_version=tls1_1" \ |
| 5278 | "$P_CLI" \ |
| 5279 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5280 | -S "mbedtls_ssl_handshake returned" \ |
| 5281 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5282 | -s "Protocol is TLSv1.1" \ |
| 5283 | -c "Protocol is TLSv1.1" |
| 5284 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5285 | 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] | 5286 | "$P_SRV max_version=tls1_1" \ |
| 5287 | "$P_CLI max_version=tls1_1" \ |
| 5288 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5289 | -S "mbedtls_ssl_handshake returned" \ |
| 5290 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5291 | -s "Protocol is TLSv1.1" \ |
| 5292 | -c "Protocol is TLSv1.1" |
| 5293 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5294 | 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] | 5295 | "$P_SRV min_version=tls1_1" \ |
| 5296 | "$P_CLI max_version=tls1_1" \ |
| 5297 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5298 | -S "mbedtls_ssl_handshake returned" \ |
| 5299 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5300 | -s "Protocol is TLSv1.1" \ |
| 5301 | -c "Protocol is TLSv1.1" |
| 5302 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5303 | 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] | 5304 | "$P_SRV max_version=tls1_1" \ |
| 5305 | "$P_CLI min_version=tls1_1" \ |
| 5306 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5307 | -S "mbedtls_ssl_handshake returned" \ |
| 5308 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5309 | -s "Protocol is TLSv1.1" \ |
| 5310 | -c "Protocol is TLSv1.1" |
| 5311 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5312 | 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] | 5313 | "$P_SRV max_version=tls1_1" \ |
| 5314 | "$P_CLI min_version=tls1_2" \ |
| 5315 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5316 | -s "mbedtls_ssl_handshake returned" \ |
| 5317 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5318 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5319 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5320 | 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] | 5321 | "$P_SRV min_version=tls1_2" \ |
| 5322 | "$P_CLI max_version=tls1_1" \ |
| 5323 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5324 | -s "mbedtls_ssl_handshake returned" \ |
| 5325 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5326 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5327 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5328 | # Tests for ALPN extension |
| 5329 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5330 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5331 | "$P_SRV debug_level=3" \ |
| 5332 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5333 | 0 \ |
| 5334 | -C "client hello, adding alpn extension" \ |
| 5335 | -S "found alpn extension" \ |
| 5336 | -C "got an alert message, type: \\[2:120]" \ |
| 5337 | -S "server hello, adding alpn extension" \ |
| 5338 | -C "found alpn extension " \ |
| 5339 | -C "Application Layer Protocol is" \ |
| 5340 | -S "Application Layer Protocol is" |
| 5341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5342 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5343 | "$P_SRV debug_level=3" \ |
| 5344 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5345 | 0 \ |
| 5346 | -c "client hello, adding alpn extension" \ |
| 5347 | -s "found alpn extension" \ |
| 5348 | -C "got an alert message, type: \\[2:120]" \ |
| 5349 | -S "server hello, adding alpn extension" \ |
| 5350 | -C "found alpn extension " \ |
| 5351 | -c "Application Layer Protocol is (none)" \ |
| 5352 | -S "Application Layer Protocol is" |
| 5353 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5354 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5355 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5356 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5357 | 0 \ |
| 5358 | -C "client hello, adding alpn extension" \ |
| 5359 | -S "found alpn extension" \ |
| 5360 | -C "got an alert message, type: \\[2:120]" \ |
| 5361 | -S "server hello, adding alpn extension" \ |
| 5362 | -C "found alpn extension " \ |
| 5363 | -C "Application Layer Protocol is" \ |
| 5364 | -s "Application Layer Protocol is (none)" |
| 5365 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5366 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5367 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5368 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5369 | 0 \ |
| 5370 | -c "client hello, adding alpn extension" \ |
| 5371 | -s "found alpn extension" \ |
| 5372 | -C "got an alert message, type: \\[2:120]" \ |
| 5373 | -s "server hello, adding alpn extension" \ |
| 5374 | -c "found alpn extension" \ |
| 5375 | -c "Application Layer Protocol is abc" \ |
| 5376 | -s "Application Layer Protocol is abc" |
| 5377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5378 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5379 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5380 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5381 | 0 \ |
| 5382 | -c "client hello, adding alpn extension" \ |
| 5383 | -s "found alpn extension" \ |
| 5384 | -C "got an alert message, type: \\[2:120]" \ |
| 5385 | -s "server hello, adding alpn extension" \ |
| 5386 | -c "found alpn extension" \ |
| 5387 | -c "Application Layer Protocol is abc" \ |
| 5388 | -s "Application Layer Protocol is abc" |
| 5389 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5390 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5391 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5392 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5393 | 0 \ |
| 5394 | -c "client hello, adding alpn extension" \ |
| 5395 | -s "found alpn extension" \ |
| 5396 | -C "got an alert message, type: \\[2:120]" \ |
| 5397 | -s "server hello, adding alpn extension" \ |
| 5398 | -c "found alpn extension" \ |
| 5399 | -c "Application Layer Protocol is 1234" \ |
| 5400 | -s "Application Layer Protocol is 1234" |
| 5401 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5402 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5403 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5404 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5405 | 1 \ |
| 5406 | -c "client hello, adding alpn extension" \ |
| 5407 | -s "found alpn extension" \ |
| 5408 | -c "got an alert message, type: \\[2:120]" \ |
| 5409 | -S "server hello, adding alpn extension" \ |
| 5410 | -C "found alpn extension" \ |
| 5411 | -C "Application Layer Protocol is 1234" \ |
| 5412 | -S "Application Layer Protocol is 1234" |
| 5413 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5414 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5415 | # Tests for keyUsage in leaf certificates, part 1: |
| 5416 | # server-side certificate/suite selection |
| 5417 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5418 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5419 | "$P_SRV key_file=data_files/server2.key \ |
| 5420 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5421 | "$P_CLI" \ |
| 5422 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5423 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5424 | |
| 5425 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5426 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5427 | "$P_SRV key_file=data_files/server2.key \ |
| 5428 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5429 | "$P_CLI" \ |
| 5430 | 0 \ |
| 5431 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5432 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5433 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5434 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5435 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5436 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5437 | 1 \ |
| 5438 | -C "Ciphersuite is " |
| 5439 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5440 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5441 | "$P_SRV key_file=data_files/server5.key \ |
| 5442 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5443 | "$P_CLI" \ |
| 5444 | 0 \ |
| 5445 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5446 | |
| 5447 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5448 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5449 | "$P_SRV key_file=data_files/server5.key \ |
| 5450 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5451 | "$P_CLI" \ |
| 5452 | 0 \ |
| 5453 | -c "Ciphersuite is TLS-ECDH-" |
| 5454 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5455 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5456 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5457 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5458 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5459 | 1 \ |
| 5460 | -C "Ciphersuite is " |
| 5461 | |
| 5462 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5463 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5465 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5466 | "$O_SRV -key data_files/server2.key \ |
| 5467 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5468 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5469 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5470 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5471 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5472 | -C "Processing of the Certificate handshake message failed" \ |
| 5473 | -c "Ciphersuite is TLS-" |
| 5474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5475 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5476 | "$O_SRV -key data_files/server2.key \ |
| 5477 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5478 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5479 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5480 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5481 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5482 | -C "Processing of the Certificate handshake message failed" \ |
| 5483 | -c "Ciphersuite is TLS-" |
| 5484 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5485 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5486 | "$O_SRV -key data_files/server2.key \ |
| 5487 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5488 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5489 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5490 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5491 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5492 | -C "Processing of the Certificate handshake message failed" \ |
| 5493 | -c "Ciphersuite is TLS-" |
| 5494 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5495 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5496 | "$O_SRV -key data_files/server2.key \ |
| 5497 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5498 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5499 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5500 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5501 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5502 | -c "Processing of the Certificate handshake message failed" \ |
| 5503 | -C "Ciphersuite is TLS-" |
| 5504 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5505 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5506 | "$O_SRV -key data_files/server2.key \ |
| 5507 | -cert data_files/server2.ku-ke.crt" \ |
| 5508 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5509 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5510 | 0 \ |
| 5511 | -c "bad certificate (usage extensions)" \ |
| 5512 | -C "Processing of the Certificate handshake message failed" \ |
| 5513 | -c "Ciphersuite is TLS-" \ |
| 5514 | -c "! Usage does not match the keyUsage extension" |
| 5515 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5516 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5517 | "$O_SRV -key data_files/server2.key \ |
| 5518 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5519 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5520 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5521 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5522 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5523 | -C "Processing of the Certificate handshake message failed" \ |
| 5524 | -c "Ciphersuite is TLS-" |
| 5525 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5526 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5527 | "$O_SRV -key data_files/server2.key \ |
| 5528 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5529 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5530 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5531 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5532 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5533 | -c "Processing of the Certificate handshake message failed" \ |
| 5534 | -C "Ciphersuite is TLS-" |
| 5535 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5536 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5537 | "$O_SRV -key data_files/server2.key \ |
| 5538 | -cert data_files/server2.ku-ds.crt" \ |
| 5539 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5540 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5541 | 0 \ |
| 5542 | -c "bad certificate (usage extensions)" \ |
| 5543 | -C "Processing of the Certificate handshake message failed" \ |
| 5544 | -c "Ciphersuite is TLS-" \ |
| 5545 | -c "! Usage does not match the keyUsage extension" |
| 5546 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5547 | # Tests for keyUsage in leaf certificates, part 3: |
| 5548 | # server-side checking of client cert |
| 5549 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5550 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5551 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5552 | "$O_CLI -key data_files/server2.key \ |
| 5553 | -cert data_files/server2.ku-ds.crt" \ |
| 5554 | 0 \ |
| 5555 | -S "bad certificate (usage extensions)" \ |
| 5556 | -S "Processing of the Certificate handshake message failed" |
| 5557 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5558 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5559 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5560 | "$O_CLI -key data_files/server2.key \ |
| 5561 | -cert data_files/server2.ku-ke.crt" \ |
| 5562 | 0 \ |
| 5563 | -s "bad certificate (usage extensions)" \ |
| 5564 | -S "Processing of the Certificate handshake message failed" |
| 5565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5566 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5567 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5568 | "$O_CLI -key data_files/server2.key \ |
| 5569 | -cert data_files/server2.ku-ke.crt" \ |
| 5570 | 1 \ |
| 5571 | -s "bad certificate (usage extensions)" \ |
| 5572 | -s "Processing of the Certificate handshake message failed" |
| 5573 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5574 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5575 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5576 | "$O_CLI -key data_files/server5.key \ |
| 5577 | -cert data_files/server5.ku-ds.crt" \ |
| 5578 | 0 \ |
| 5579 | -S "bad certificate (usage extensions)" \ |
| 5580 | -S "Processing of the Certificate handshake message failed" |
| 5581 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5582 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5583 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5584 | "$O_CLI -key data_files/server5.key \ |
| 5585 | -cert data_files/server5.ku-ka.crt" \ |
| 5586 | 0 \ |
| 5587 | -s "bad certificate (usage extensions)" \ |
| 5588 | -S "Processing of the Certificate handshake message failed" |
| 5589 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5590 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5591 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5592 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5593 | "$P_SRV key_file=data_files/server5.key \ |
| 5594 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5595 | "$P_CLI" \ |
| 5596 | 0 |
| 5597 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5598 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5599 | "$P_SRV key_file=data_files/server5.key \ |
| 5600 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5601 | "$P_CLI" \ |
| 5602 | 0 |
| 5603 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5604 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5605 | "$P_SRV key_file=data_files/server5.key \ |
| 5606 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5607 | "$P_CLI" \ |
| 5608 | 0 |
| 5609 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5610 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5611 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5612 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5613 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5614 | 1 |
| 5615 | |
| 5616 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5617 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5618 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5619 | "$O_SRV -key data_files/server5.key \ |
| 5620 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5621 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5622 | 0 \ |
| 5623 | -C "bad certificate (usage extensions)" \ |
| 5624 | -C "Processing of the Certificate handshake message failed" \ |
| 5625 | -c "Ciphersuite is TLS-" |
| 5626 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5627 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5628 | "$O_SRV -key data_files/server5.key \ |
| 5629 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5630 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5631 | 0 \ |
| 5632 | -C "bad certificate (usage extensions)" \ |
| 5633 | -C "Processing of the Certificate handshake message failed" \ |
| 5634 | -c "Ciphersuite is TLS-" |
| 5635 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5636 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5637 | "$O_SRV -key data_files/server5.key \ |
| 5638 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5639 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5640 | 0 \ |
| 5641 | -C "bad certificate (usage extensions)" \ |
| 5642 | -C "Processing of the Certificate handshake message failed" \ |
| 5643 | -c "Ciphersuite is TLS-" |
| 5644 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5645 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5646 | "$O_SRV -key data_files/server5.key \ |
| 5647 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5648 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5649 | 1 \ |
| 5650 | -c "bad certificate (usage extensions)" \ |
| 5651 | -c "Processing of the Certificate handshake message failed" \ |
| 5652 | -C "Ciphersuite is TLS-" |
| 5653 | |
| 5654 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5655 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5656 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5657 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5658 | "$O_CLI -key data_files/server5.key \ |
| 5659 | -cert data_files/server5.eku-cli.crt" \ |
| 5660 | 0 \ |
| 5661 | -S "bad certificate (usage extensions)" \ |
| 5662 | -S "Processing of the Certificate handshake message failed" |
| 5663 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5664 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5665 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5666 | "$O_CLI -key data_files/server5.key \ |
| 5667 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5668 | 0 \ |
| 5669 | -S "bad certificate (usage extensions)" \ |
| 5670 | -S "Processing of the Certificate handshake message failed" |
| 5671 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5672 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5673 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5674 | "$O_CLI -key data_files/server5.key \ |
| 5675 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5676 | 0 \ |
| 5677 | -S "bad certificate (usage extensions)" \ |
| 5678 | -S "Processing of the Certificate handshake message failed" |
| 5679 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5680 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5681 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5682 | "$O_CLI -key data_files/server5.key \ |
| 5683 | -cert data_files/server5.eku-cs.crt" \ |
| 5684 | 0 \ |
| 5685 | -s "bad certificate (usage extensions)" \ |
| 5686 | -S "Processing of the Certificate handshake message failed" |
| 5687 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5688 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5689 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5690 | "$O_CLI -key data_files/server5.key \ |
| 5691 | -cert data_files/server5.eku-cs.crt" \ |
| 5692 | 1 \ |
| 5693 | -s "bad certificate (usage extensions)" \ |
| 5694 | -s "Processing of the Certificate handshake message failed" |
| 5695 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5696 | # Tests for DHM parameters loading |
| 5697 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5698 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5699 | "$P_SRV" \ |
| 5700 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5701 | debug_level=3" \ |
| 5702 | 0 \ |
| 5703 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5704 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5706 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5707 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5708 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5709 | debug_level=3" \ |
| 5710 | 0 \ |
| 5711 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5712 | -c "value of 'DHM: G ' (2 bits)" |
| 5713 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5714 | # Tests for DHM client-side size checking |
| 5715 | |
| 5716 | run_test "DHM size: server default, client default, OK" \ |
| 5717 | "$P_SRV" \ |
| 5718 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5719 | debug_level=1" \ |
| 5720 | 0 \ |
| 5721 | -C "DHM prime too short:" |
| 5722 | |
| 5723 | run_test "DHM size: server default, client 2048, OK" \ |
| 5724 | "$P_SRV" \ |
| 5725 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5726 | debug_level=1 dhmlen=2048" \ |
| 5727 | 0 \ |
| 5728 | -C "DHM prime too short:" |
| 5729 | |
| 5730 | run_test "DHM size: server 1024, client default, OK" \ |
| 5731 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5732 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5733 | debug_level=1" \ |
| 5734 | 0 \ |
| 5735 | -C "DHM prime too short:" |
| 5736 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5737 | run_test "DHM size: server 999, client 999, OK" \ |
| 5738 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5739 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5740 | debug_level=1 dhmlen=999" \ |
| 5741 | 0 \ |
| 5742 | -C "DHM prime too short:" |
| 5743 | |
| 5744 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5745 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5746 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5747 | debug_level=1 dhmlen=1000" \ |
| 5748 | 0 \ |
| 5749 | -C "DHM prime too short:" |
| 5750 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5751 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5752 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5753 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5754 | debug_level=1" \ |
| 5755 | 1 \ |
| 5756 | -c "DHM prime too short:" |
| 5757 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5758 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5759 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5760 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5761 | debug_level=1 dhmlen=1001" \ |
| 5762 | 1 \ |
| 5763 | -c "DHM prime too short:" |
| 5764 | |
| 5765 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5766 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5767 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5768 | debug_level=1 dhmlen=1000" \ |
| 5769 | 1 \ |
| 5770 | -c "DHM prime too short:" |
| 5771 | |
| 5772 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5773 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5774 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5775 | debug_level=1 dhmlen=999" \ |
| 5776 | 1 \ |
| 5777 | -c "DHM prime too short:" |
| 5778 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5779 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5780 | "$P_SRV" \ |
| 5781 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5782 | debug_level=1 dhmlen=2049" \ |
| 5783 | 1 \ |
| 5784 | -c "DHM prime too short:" |
| 5785 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5786 | # Tests for PSK callback |
| 5787 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5788 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5789 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5790 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5791 | psk_identity=foo psk=abc123" \ |
| 5792 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5793 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5794 | -S "SSL - Unknown identity received" \ |
| 5795 | -S "SSL - Verification of the message MAC failed" |
| 5796 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5797 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5798 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5799 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5800 | "$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] | 5801 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5802 | 0 \ |
| 5803 | -c "skip PMS generation for opaque PSK"\ |
| 5804 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5805 | -C "session hash for extended master secret"\ |
| 5806 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5807 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5808 | -S "SSL - Unknown identity received" \ |
| 5809 | -S "SSL - Verification of the message MAC failed" |
| 5810 | |
| 5811 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5812 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5813 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5814 | "$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] | 5815 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5816 | 0 \ |
| 5817 | -c "skip PMS generation for opaque PSK"\ |
| 5818 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5819 | -C "session hash for extended master secret"\ |
| 5820 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5821 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5822 | -S "SSL - Unknown identity received" \ |
| 5823 | -S "SSL - Verification of the message MAC failed" |
| 5824 | |
| 5825 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5826 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5827 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5828 | "$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] | 5829 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5830 | 0 \ |
| 5831 | -c "skip PMS generation for opaque PSK"\ |
| 5832 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5833 | -c "session hash for extended master secret"\ |
| 5834 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5835 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5836 | -S "SSL - Unknown identity received" \ |
| 5837 | -S "SSL - Verification of the message MAC failed" |
| 5838 | |
| 5839 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5840 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5841 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5842 | "$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] | 5843 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5844 | 0 \ |
| 5845 | -c "skip PMS generation for opaque PSK"\ |
| 5846 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5847 | -c "session hash for extended master secret"\ |
| 5848 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5849 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5850 | -S "SSL - Unknown identity received" \ |
| 5851 | -S "SSL - Verification of the message MAC failed" |
| 5852 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5853 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5854 | 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] | 5855 | "$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] | 5856 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5857 | psk_identity=foo psk=abc123" \ |
| 5858 | 0 \ |
| 5859 | -C "skip PMS generation for opaque PSK"\ |
| 5860 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5861 | -C "session hash for extended master secret"\ |
| 5862 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5863 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5864 | -S "SSL - Unknown identity received" \ |
| 5865 | -S "SSL - Verification of the message MAC failed" |
| 5866 | |
| 5867 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5868 | 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] | 5869 | "$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] | 5870 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5871 | psk_identity=foo psk=abc123" \ |
| 5872 | 0 \ |
| 5873 | -C "skip PMS generation for opaque PSK"\ |
| 5874 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5875 | -C "session hash for extended master secret"\ |
| 5876 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5877 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5878 | -S "SSL - Unknown identity received" \ |
| 5879 | -S "SSL - Verification of the message MAC failed" |
| 5880 | |
| 5881 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5882 | 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] | 5883 | "$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] | 5884 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5885 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5886 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5887 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5888 | -c "session hash for extended master secret"\ |
| 5889 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5890 | -C "skip PMS generation for opaque PSK"\ |
| 5891 | -s "skip PMS generation for opaque PSK"\ |
| 5892 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5893 | -S "SSL - Unknown identity received" \ |
| 5894 | -S "SSL - Verification of the message MAC failed" |
| 5895 | |
| 5896 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5897 | 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] | 5898 | "$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] | 5899 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5900 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5901 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5902 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5903 | -c "session hash for extended master secret"\ |
| 5904 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5905 | -C "skip PMS generation for opaque PSK"\ |
| 5906 | -s "skip PMS generation for opaque PSK"\ |
| 5907 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5908 | -S "SSL - Unknown identity received" \ |
| 5909 | -S "SSL - Verification of the message MAC failed" |
| 5910 | |
| 5911 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5912 | 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] | 5913 | "$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] | 5914 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5915 | psk_identity=def psk=beef" \ |
| 5916 | 0 \ |
| 5917 | -C "skip PMS generation for opaque PSK"\ |
| 5918 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5919 | -C "session hash for extended master secret"\ |
| 5920 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5921 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5922 | -S "SSL - Unknown identity received" \ |
| 5923 | -S "SSL - Verification of the message MAC failed" |
| 5924 | |
| 5925 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5926 | 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] | 5927 | "$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] | 5928 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5929 | psk_identity=def psk=beef" \ |
| 5930 | 0 \ |
| 5931 | -C "skip PMS generation for opaque PSK"\ |
| 5932 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5933 | -C "session hash for extended master secret"\ |
| 5934 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5935 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5936 | -S "SSL - Unknown identity received" \ |
| 5937 | -S "SSL - Verification of the message MAC failed" |
| 5938 | |
| 5939 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5940 | 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] | 5941 | "$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] | 5942 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5943 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5944 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5945 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5946 | -c "session hash for extended master secret"\ |
| 5947 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5948 | -C "skip PMS generation for opaque PSK"\ |
| 5949 | -s "skip PMS generation for opaque PSK"\ |
| 5950 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5951 | -S "SSL - Unknown identity received" \ |
| 5952 | -S "SSL - Verification of the message MAC failed" |
| 5953 | |
| 5954 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5955 | 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] | 5956 | "$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] | 5957 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5958 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5959 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5960 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5961 | -c "session hash for extended master secret"\ |
| 5962 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5963 | -C "skip PMS generation for opaque PSK"\ |
| 5964 | -s "skip PMS generation for opaque PSK"\ |
| 5965 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5966 | -S "SSL - Unknown identity received" \ |
| 5967 | -S "SSL - Verification of the message MAC failed" |
| 5968 | |
| 5969 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5970 | 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] | 5971 | "$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] | 5972 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5973 | psk_identity=def psk=beef" \ |
| 5974 | 0 \ |
| 5975 | -C "skip PMS generation for opaque PSK"\ |
| 5976 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5977 | -C "session hash for extended master secret"\ |
| 5978 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5979 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5980 | -S "SSL - Unknown identity received" \ |
| 5981 | -S "SSL - Verification of the message MAC failed" |
| 5982 | |
| 5983 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5984 | 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] | 5985 | "$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] | 5986 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5987 | psk_identity=def psk=beef" \ |
| 5988 | 0 \ |
| 5989 | -C "skip PMS generation for opaque PSK"\ |
| 5990 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5991 | -C "session hash for extended master secret"\ |
| 5992 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5993 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5994 | -S "SSL - Unknown identity received" \ |
| 5995 | -S "SSL - Verification of the message MAC failed" |
| 5996 | |
| 5997 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5998 | 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] | 5999 | "$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] | 6000 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6001 | psk_identity=def psk=beef" \ |
| 6002 | 0 \ |
| 6003 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6004 | -C "session hash for extended master secret"\ |
| 6005 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6006 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6007 | -S "SSL - Unknown identity received" \ |
| 6008 | -S "SSL - Verification of the message MAC failed" |
| 6009 | |
| 6010 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6011 | 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] | 6012 | "$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] | 6013 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6014 | psk_identity=def psk=beef" \ |
| 6015 | 0 \ |
| 6016 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6017 | -C "session hash for extended master secret"\ |
| 6018 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6019 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6020 | -S "SSL - Unknown identity received" \ |
| 6021 | -S "SSL - Verification of the message MAC failed" |
| 6022 | |
| 6023 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6024 | 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] | 6025 | "$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] | 6026 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6027 | psk_identity=def psk=beef" \ |
| 6028 | 1 \ |
| 6029 | -s "SSL - Verification of the message MAC failed" |
| 6030 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6031 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6032 | "$P_SRV" \ |
| 6033 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6034 | psk_identity=foo psk=abc123" \ |
| 6035 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6036 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6037 | -S "SSL - Unknown identity received" \ |
| 6038 | -S "SSL - Verification of the message MAC failed" |
| 6039 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6040 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6041 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6042 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6043 | psk_identity=foo psk=abc123" \ |
| 6044 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6045 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6046 | -s "SSL - Unknown identity received" \ |
| 6047 | -S "SSL - Verification of the message MAC failed" |
| 6048 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6049 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6050 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6051 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6052 | psk_identity=abc psk=dead" \ |
| 6053 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6054 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6055 | -S "SSL - Unknown identity received" \ |
| 6056 | -S "SSL - Verification of the message MAC failed" |
| 6057 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6058 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6059 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6060 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6061 | psk_identity=def psk=beef" \ |
| 6062 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6063 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6064 | -S "SSL - Unknown identity received" \ |
| 6065 | -S "SSL - Verification of the message MAC failed" |
| 6066 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6067 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6068 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6069 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6070 | psk_identity=ghi psk=beef" \ |
| 6071 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6072 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6073 | -s "SSL - Unknown identity received" \ |
| 6074 | -S "SSL - Verification of the message MAC failed" |
| 6075 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6076 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6077 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6078 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6079 | psk_identity=abc psk=beef" \ |
| 6080 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6081 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6082 | -S "SSL - Unknown identity received" \ |
| 6083 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6084 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6085 | # Tests for EC J-PAKE |
| 6086 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6087 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6088 | run_test "ECJPAKE: client not configured" \ |
| 6089 | "$P_SRV debug_level=3" \ |
| 6090 | "$P_CLI debug_level=3" \ |
| 6091 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6092 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6093 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6094 | -S "found ecjpake kkpp extension" \ |
| 6095 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6096 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6097 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6098 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6099 | -S "None of the common ciphersuites is usable" |
| 6100 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6101 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6102 | run_test "ECJPAKE: server not configured" \ |
| 6103 | "$P_SRV debug_level=3" \ |
| 6104 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6105 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6106 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6107 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6108 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6109 | -s "found ecjpake kkpp extension" \ |
| 6110 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6111 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6112 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6113 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6114 | -s "None of the common ciphersuites is usable" |
| 6115 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6116 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6117 | run_test "ECJPAKE: working, TLS" \ |
| 6118 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6119 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6120 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6121 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6122 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6123 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6124 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6125 | -s "found ecjpake kkpp extension" \ |
| 6126 | -S "skip ecjpake kkpp extension" \ |
| 6127 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6128 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6129 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6130 | -S "None of the common ciphersuites is usable" \ |
| 6131 | -S "SSL - Verification of the message MAC failed" |
| 6132 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6133 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6134 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6135 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6136 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6137 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6138 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6139 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6140 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6141 | -s "SSL - Verification of the message MAC failed" |
| 6142 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6143 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6144 | run_test "ECJPAKE: working, DTLS" \ |
| 6145 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6146 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6147 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6148 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6149 | -c "re-using cached ecjpake parameters" \ |
| 6150 | -S "SSL - Verification of the message MAC failed" |
| 6151 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6152 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6153 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6154 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6155 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6156 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6157 | 0 \ |
| 6158 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6159 | -S "SSL - Verification of the message MAC failed" |
| 6160 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6161 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6162 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6163 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6164 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6165 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6166 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6167 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6168 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6169 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6170 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6171 | # for tests with configs/config-thread.h |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6172 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6173 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6174 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6175 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6176 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6177 | 0 |
| 6178 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6179 | # Tests for ciphersuites per version |
| 6180 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6181 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6182 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6183 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6184 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6185 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6186 | "$P_CLI force_version=ssl3" \ |
| 6187 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6188 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6189 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 6191 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6192 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6193 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6194 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 6195 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6196 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6197 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6198 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6199 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6200 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6201 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6202 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6203 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6204 | "$P_CLI force_version=tls1_1" \ |
| 6205 | 0 \ |
| 6206 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 6207 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6208 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6209 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6210 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6211 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6212 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6213 | "$P_CLI force_version=tls1_2" \ |
| 6214 | 0 \ |
| 6215 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 6216 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6217 | # Test for ClientHello without extensions |
| 6218 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6219 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6220 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6221 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6222 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6223 | 0 \ |
| 6224 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6225 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6226 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6227 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6228 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6229 | "$P_SRV" \ |
| 6230 | "$P_CLI request_size=100" \ |
| 6231 | 0 \ |
| 6232 | -s "Read from client: 100 bytes read$" |
| 6233 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6234 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6235 | "$P_SRV" \ |
| 6236 | "$P_CLI request_size=500" \ |
| 6237 | 0 \ |
| 6238 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6239 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6240 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6241 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6242 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6243 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6244 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6245 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6246 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6247 | 0 \ |
| 6248 | -s "Read from client: 1 bytes read" |
| 6249 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6250 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6251 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6252 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6253 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6254 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6255 | 0 \ |
| 6256 | -s "Read from client: 1 bytes read" |
| 6257 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6258 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6259 | "$P_SRV" \ |
| 6260 | "$P_CLI request_size=1 force_version=tls1 \ |
| 6261 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6262 | 0 \ |
| 6263 | -s "Read from client: 1 bytes read" |
| 6264 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6265 | 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] | 6266 | "$P_SRV" \ |
| 6267 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 6268 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6269 | 0 \ |
| 6270 | -s "Read from client: 1 bytes read" |
| 6271 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6272 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6273 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6274 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6275 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6276 | 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] | 6277 | 0 \ |
| 6278 | -s "Read from client: 1 bytes read" |
| 6279 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6280 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6281 | 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] | 6282 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6283 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6284 | 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] | 6285 | 0 \ |
| 6286 | -s "Read from client: 1 bytes read" |
| 6287 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6288 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6289 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6290 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6291 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6292 | 0 \ |
| 6293 | -s "Read from client: 1 bytes read" |
| 6294 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6295 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6296 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6297 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6298 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6299 | 0 \ |
| 6300 | -s "Read from client: 1 bytes read" |
| 6301 | |
| 6302 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6303 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6304 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6305 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6306 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6307 | 0 \ |
| 6308 | -s "Read from client: 1 bytes read" |
| 6309 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6310 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6311 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6312 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6313 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6314 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6315 | 0 \ |
| 6316 | -s "Read from client: 1 bytes read" |
| 6317 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6318 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6319 | "$P_SRV" \ |
| 6320 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6321 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6322 | 0 \ |
| 6323 | -s "Read from client: 1 bytes read" |
| 6324 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6325 | 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] | 6326 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6327 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6328 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6329 | 0 \ |
| 6330 | -s "Read from client: 1 bytes read" |
| 6331 | |
| 6332 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6333 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6334 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6335 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6336 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6337 | 0 \ |
| 6338 | -s "Read from client: 1 bytes read" |
| 6339 | |
| 6340 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6341 | 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] | 6342 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6343 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6344 | 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] | 6345 | 0 \ |
| 6346 | -s "Read from client: 1 bytes read" |
| 6347 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6348 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6349 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6350 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6351 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6352 | 0 \ |
| 6353 | -s "Read from client: 1 bytes read" |
| 6354 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6355 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6356 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6357 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6358 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6359 | 0 \ |
| 6360 | -s "Read from client: 1 bytes read" |
| 6361 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6362 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6363 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6364 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6365 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6366 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6367 | 0 \ |
| 6368 | -s "Read from client: 1 bytes read" |
| 6369 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6370 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6371 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6372 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6373 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6374 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6375 | 0 \ |
| 6376 | -s "Read from client: 1 bytes read" |
| 6377 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6378 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6379 | "$P_SRV" \ |
| 6380 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6381 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6382 | 0 \ |
| 6383 | -s "Read from client: 1 bytes read" |
| 6384 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6385 | 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] | 6386 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6387 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6388 | 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] | 6389 | 0 \ |
| 6390 | -s "Read from client: 1 bytes read" |
| 6391 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6392 | 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] | 6393 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6394 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6395 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6396 | 0 \ |
| 6397 | -s "Read from client: 1 bytes read" |
| 6398 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6399 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6400 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6401 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6402 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6403 | 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] | 6404 | 0 \ |
| 6405 | -s "Read from client: 1 bytes read" |
| 6406 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6407 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6408 | 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] | 6409 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6410 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6411 | 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] | 6412 | 0 \ |
| 6413 | -s "Read from client: 1 bytes read" |
| 6414 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6415 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6416 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6417 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6418 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6419 | 0 \ |
| 6420 | -s "Read from client: 1 bytes read" |
| 6421 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6422 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6423 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6424 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6425 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6426 | 0 \ |
| 6427 | -s "Read from client: 1 bytes read" |
| 6428 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6429 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6430 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6431 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6432 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6433 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6434 | 0 \ |
| 6435 | -s "Read from client: 1 bytes read" |
| 6436 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6437 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6438 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6439 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6440 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6441 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6442 | 0 \ |
| 6443 | -s "Read from client: 1 bytes read" |
| 6444 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6445 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6446 | "$P_SRV" \ |
| 6447 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6448 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6449 | 0 \ |
| 6450 | -s "Read from client: 1 bytes read" |
| 6451 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6452 | 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] | 6453 | "$P_SRV" \ |
| 6454 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6455 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6456 | 0 \ |
| 6457 | -s "Read from client: 1 bytes read" |
| 6458 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6459 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6460 | |
| 6461 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6462 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6463 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6464 | "$P_CLI dtls=1 request_size=1 \ |
| 6465 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6466 | 0 \ |
| 6467 | -s "Read from client: 1 bytes read" |
| 6468 | |
| 6469 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6470 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6471 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6472 | "$P_CLI dtls=1 request_size=1 \ |
| 6473 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6474 | 0 \ |
| 6475 | -s "Read from client: 1 bytes read" |
| 6476 | |
| 6477 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6478 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6479 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6480 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6481 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6482 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6483 | 0 \ |
| 6484 | -s "Read from client: 1 bytes read" |
| 6485 | |
| 6486 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6487 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6488 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6489 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6490 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6491 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6492 | 0 \ |
| 6493 | -s "Read from client: 1 bytes read" |
| 6494 | |
| 6495 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6496 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6497 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 6498 | "$P_CLI dtls=1 request_size=1 \ |
| 6499 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6500 | 0 \ |
| 6501 | -s "Read from client: 1 bytes read" |
| 6502 | |
| 6503 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6504 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6505 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6506 | "$P_CLI dtls=1 request_size=1 \ |
| 6507 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6508 | 0 \ |
| 6509 | -s "Read from client: 1 bytes read" |
| 6510 | |
| 6511 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6512 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6513 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6514 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6515 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6516 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6517 | 0 \ |
| 6518 | -s "Read from client: 1 bytes read" |
| 6519 | |
| 6520 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6521 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6522 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6523 | "$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] | 6524 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6525 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6526 | 0 \ |
| 6527 | -s "Read from client: 1 bytes read" |
| 6528 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6529 | # Tests for small server packets |
| 6530 | |
| 6531 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6532 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6533 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6534 | "$P_CLI force_version=ssl3 \ |
| 6535 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6536 | 0 \ |
| 6537 | -c "Read from server: 1 bytes read" |
| 6538 | |
| 6539 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6540 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6541 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6542 | "$P_CLI force_version=ssl3 \ |
| 6543 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6544 | 0 \ |
| 6545 | -c "Read from server: 1 bytes read" |
| 6546 | |
| 6547 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6548 | "$P_SRV response_size=1" \ |
| 6549 | "$P_CLI force_version=tls1 \ |
| 6550 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6551 | 0 \ |
| 6552 | -c "Read from server: 1 bytes read" |
| 6553 | |
| 6554 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6555 | "$P_SRV response_size=1" \ |
| 6556 | "$P_CLI force_version=tls1 etm=0 \ |
| 6557 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6558 | 0 \ |
| 6559 | -c "Read from server: 1 bytes read" |
| 6560 | |
| 6561 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6562 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6563 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6564 | "$P_CLI force_version=tls1 \ |
| 6565 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6566 | 0 \ |
| 6567 | -c "Read from server: 1 bytes read" |
| 6568 | |
| 6569 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6570 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6571 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6572 | "$P_CLI force_version=tls1 \ |
| 6573 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6574 | 0 \ |
| 6575 | -c "Read from server: 1 bytes read" |
| 6576 | |
| 6577 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6578 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6579 | "$P_CLI force_version=tls1 \ |
| 6580 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6581 | 0 \ |
| 6582 | -c "Read from server: 1 bytes read" |
| 6583 | |
| 6584 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6585 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6586 | "$P_CLI force_version=tls1 \ |
| 6587 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6588 | 0 \ |
| 6589 | -c "Read from server: 1 bytes read" |
| 6590 | |
| 6591 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6592 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6593 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6594 | "$P_CLI force_version=tls1 \ |
| 6595 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6596 | 0 \ |
| 6597 | -c "Read from server: 1 bytes read" |
| 6598 | |
| 6599 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6600 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6601 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6602 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6603 | trunc_hmac=1 etm=0" \ |
| 6604 | 0 \ |
| 6605 | -c "Read from server: 1 bytes read" |
| 6606 | |
| 6607 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6608 | "$P_SRV response_size=1" \ |
| 6609 | "$P_CLI force_version=tls1_1 \ |
| 6610 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6611 | 0 \ |
| 6612 | -c "Read from server: 1 bytes read" |
| 6613 | |
| 6614 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6615 | "$P_SRV response_size=1" \ |
| 6616 | "$P_CLI force_version=tls1_1 \ |
| 6617 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6618 | 0 \ |
| 6619 | -c "Read from server: 1 bytes read" |
| 6620 | |
| 6621 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6622 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6623 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6624 | "$P_CLI force_version=tls1_1 \ |
| 6625 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6626 | 0 \ |
| 6627 | -c "Read from server: 1 bytes read" |
| 6628 | |
| 6629 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6630 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6631 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6632 | "$P_CLI force_version=tls1_1 \ |
| 6633 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6634 | 0 \ |
| 6635 | -c "Read from server: 1 bytes read" |
| 6636 | |
| 6637 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6638 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6639 | "$P_CLI force_version=tls1_1 \ |
| 6640 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6641 | 0 \ |
| 6642 | -c "Read from server: 1 bytes read" |
| 6643 | |
| 6644 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6645 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6646 | "$P_CLI force_version=tls1_1 \ |
| 6647 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6648 | 0 \ |
| 6649 | -c "Read from server: 1 bytes read" |
| 6650 | |
| 6651 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6652 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6653 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6654 | "$P_CLI force_version=tls1_1 \ |
| 6655 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6656 | 0 \ |
| 6657 | -c "Read from server: 1 bytes read" |
| 6658 | |
| 6659 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6660 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6661 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6662 | "$P_CLI force_version=tls1_1 \ |
| 6663 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6664 | 0 \ |
| 6665 | -c "Read from server: 1 bytes read" |
| 6666 | |
| 6667 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6668 | "$P_SRV response_size=1" \ |
| 6669 | "$P_CLI force_version=tls1_2 \ |
| 6670 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6671 | 0 \ |
| 6672 | -c "Read from server: 1 bytes read" |
| 6673 | |
| 6674 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6675 | "$P_SRV response_size=1" \ |
| 6676 | "$P_CLI force_version=tls1_2 \ |
| 6677 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6678 | 0 \ |
| 6679 | -c "Read from server: 1 bytes read" |
| 6680 | |
| 6681 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6682 | "$P_SRV response_size=1" \ |
| 6683 | "$P_CLI force_version=tls1_2 \ |
| 6684 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6685 | 0 \ |
| 6686 | -c "Read from server: 1 bytes read" |
| 6687 | |
| 6688 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6689 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6690 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6691 | "$P_CLI force_version=tls1_2 \ |
| 6692 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6693 | 0 \ |
| 6694 | -c "Read from server: 1 bytes read" |
| 6695 | |
| 6696 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6697 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6698 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6699 | "$P_CLI force_version=tls1_2 \ |
| 6700 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6701 | 0 \ |
| 6702 | -c "Read from server: 1 bytes read" |
| 6703 | |
| 6704 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6705 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6706 | "$P_CLI force_version=tls1_2 \ |
| 6707 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6708 | 0 \ |
| 6709 | -c "Read from server: 1 bytes read" |
| 6710 | |
| 6711 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6712 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6713 | "$P_CLI force_version=tls1_2 \ |
| 6714 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6715 | 0 \ |
| 6716 | -c "Read from server: 1 bytes read" |
| 6717 | |
| 6718 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6719 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6720 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6721 | "$P_CLI force_version=tls1_2 \ |
| 6722 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6723 | 0 \ |
| 6724 | -c "Read from server: 1 bytes read" |
| 6725 | |
| 6726 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6727 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6728 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6729 | "$P_CLI force_version=tls1_2 \ |
| 6730 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6731 | 0 \ |
| 6732 | -c "Read from server: 1 bytes read" |
| 6733 | |
| 6734 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6735 | "$P_SRV response_size=1" \ |
| 6736 | "$P_CLI force_version=tls1_2 \ |
| 6737 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6738 | 0 \ |
| 6739 | -c "Read from server: 1 bytes read" |
| 6740 | |
| 6741 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6742 | "$P_SRV response_size=1" \ |
| 6743 | "$P_CLI force_version=tls1_2 \ |
| 6744 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6745 | 0 \ |
| 6746 | -c "Read from server: 1 bytes read" |
| 6747 | |
| 6748 | # Tests for small server packets in DTLS |
| 6749 | |
| 6750 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6751 | run_test "Small server packet DTLS 1.0" \ |
| 6752 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6753 | "$P_CLI dtls=1 \ |
| 6754 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6755 | 0 \ |
| 6756 | -c "Read from server: 1 bytes read" |
| 6757 | |
| 6758 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6759 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6760 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6761 | "$P_CLI dtls=1 \ |
| 6762 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6763 | 0 \ |
| 6764 | -c "Read from server: 1 bytes read" |
| 6765 | |
| 6766 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6767 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6768 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6769 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6770 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6771 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6772 | 0 \ |
| 6773 | -c "Read from server: 1 bytes read" |
| 6774 | |
| 6775 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6776 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6777 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6778 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6779 | "$P_CLI dtls=1 \ |
| 6780 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6781 | 0 \ |
| 6782 | -c "Read from server: 1 bytes read" |
| 6783 | |
| 6784 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6785 | run_test "Small server packet DTLS 1.2" \ |
| 6786 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6787 | "$P_CLI dtls=1 \ |
| 6788 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6789 | 0 \ |
| 6790 | -c "Read from server: 1 bytes read" |
| 6791 | |
| 6792 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6793 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6794 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6795 | "$P_CLI dtls=1 \ |
| 6796 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6797 | 0 \ |
| 6798 | -c "Read from server: 1 bytes read" |
| 6799 | |
| 6800 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6801 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6802 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6803 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6804 | "$P_CLI dtls=1 \ |
| 6805 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6806 | 0 \ |
| 6807 | -c "Read from server: 1 bytes read" |
| 6808 | |
| 6809 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6810 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6811 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6812 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6813 | "$P_CLI dtls=1 \ |
| 6814 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6815 | 0 \ |
| 6816 | -c "Read from server: 1 bytes read" |
| 6817 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6818 | # A test for extensions in SSLv3 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6819 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6820 | requires_max_content_len 4096 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6821 | run_test "SSLv3 with extensions, server side" \ |
| 6822 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6823 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6824 | 0 \ |
| 6825 | -S "dumping 'client hello extensions'" \ |
| 6826 | -S "server hello, total extension length:" |
| 6827 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6828 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6829 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6830 | # How many fragments do we expect to write $1 bytes? |
| 6831 | fragments_for_write() { |
| 6832 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6833 | } |
| 6834 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6835 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6836 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6837 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6838 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6839 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6840 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6841 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6842 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6843 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6844 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6845 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6846 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6847 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6848 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6849 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6850 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6851 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6852 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6853 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6854 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6855 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6856 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6857 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6858 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6859 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6860 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6861 | 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] | 6862 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6863 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6864 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6865 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6866 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6867 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6868 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6869 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6870 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6871 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6872 | 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] | 6873 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6874 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6875 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6876 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6877 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6878 | 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] | 6879 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6880 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6881 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6882 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6883 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6884 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6885 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6886 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6887 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6888 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6889 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6890 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6891 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6892 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6893 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6894 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6895 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6896 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6897 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6898 | |
| 6899 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6900 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6901 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6902 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6903 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6904 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6905 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6906 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6907 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6908 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6909 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6910 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6911 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6912 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6913 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6914 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6915 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6916 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6917 | "$P_SRV" \ |
| 6918 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6919 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6920 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6921 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6922 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6923 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6924 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6925 | "$P_SRV" \ |
| 6926 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6927 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6928 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6929 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6930 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6931 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6932 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6933 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6934 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6935 | 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] | 6936 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6937 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6938 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6939 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6940 | 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] | 6941 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6942 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6943 | 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] | 6944 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6945 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6946 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6947 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6948 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6949 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6950 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6951 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6952 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6953 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6954 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6955 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6956 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6957 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6958 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6959 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6960 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6961 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6962 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6963 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6964 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6965 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6966 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6967 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6968 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6969 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6970 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6971 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6972 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6973 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6974 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6975 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6976 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6977 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6978 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6979 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6980 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6981 | "$P_SRV" \ |
| 6982 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6983 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6984 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6985 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6986 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6987 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6988 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6989 | "$P_SRV" \ |
| 6990 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6991 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6992 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6993 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6994 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6995 | 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] | 6996 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6997 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6998 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6999 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7000 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7001 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7002 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7003 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7004 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7005 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7006 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7007 | 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] | 7008 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7009 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7010 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7011 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7012 | 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] | 7013 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7014 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7015 | 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] | 7016 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7017 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7018 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7019 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7020 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7021 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7022 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 7023 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7024 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7025 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7026 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7027 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7028 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7029 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7030 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7031 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7032 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7033 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7034 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7035 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7036 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7037 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7038 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7039 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7040 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7041 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7042 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7043 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7044 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7045 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7046 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7047 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7048 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7049 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7050 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7051 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7052 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7053 | "$P_SRV" \ |
| 7054 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 7055 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7056 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7057 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7058 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7059 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7060 | 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] | 7061 | "$P_SRV" \ |
| 7062 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 7063 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7064 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7065 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7066 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7067 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7068 | # Test for large server packets |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7069 | # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384. |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7070 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 7071 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 7072 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7073 | "$P_CLI force_version=ssl3 \ |
| 7074 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7075 | 0 \ |
| 7076 | -c "Read from server: 16384 bytes read" |
| 7077 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 7078 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 7079 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 7080 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 7081 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 7082 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 7083 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7084 | 0 \ |
| 7085 | -c "Read from server: 1 bytes read"\ |
| 7086 | -c "16383 bytes read"\ |
| 7087 | -C "Read from server: 16384 bytes read" |
| 7088 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7089 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 7090 | "$P_SRV response_size=16384" \ |
| 7091 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7092 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7093 | 0 \ |
| 7094 | -c "Read from server: 1 bytes read"\ |
| 7095 | -c "16383 bytes read"\ |
| 7096 | -C "Read from server: 16384 bytes read" |
| 7097 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7098 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 7099 | "$P_SRV response_size=16384" \ |
| 7100 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 7101 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7102 | 0 \ |
| 7103 | -c "Read from server: 1 bytes read"\ |
| 7104 | -c "16383 bytes read"\ |
| 7105 | -C "Read from server: 16384 bytes read" |
| 7106 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7107 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7108 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 7109 | "$P_SRV response_size=16384" \ |
| 7110 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7111 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7112 | trunc_hmac=1" \ |
| 7113 | 0 \ |
| 7114 | -c "Read from server: 1 bytes read"\ |
| 7115 | -c "16383 bytes read"\ |
| 7116 | -C "Read from server: 16384 bytes read" |
| 7117 | |
| 7118 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7119 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 7120 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7121 | "$P_CLI force_version=tls1 \ |
| 7122 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7123 | trunc_hmac=1" \ |
| 7124 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7125 | -s "16384 bytes written in 1 fragments" \ |
| 7126 | -c "Read from server: 16384 bytes read" |
| 7127 | |
| 7128 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 7129 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7130 | "$P_CLI force_version=tls1 \ |
| 7131 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7132 | 0 \ |
| 7133 | -s "16384 bytes written in 1 fragments" \ |
| 7134 | -c "Read from server: 16384 bytes read" |
| 7135 | |
| 7136 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 7137 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7138 | "$P_CLI force_version=tls1 \ |
| 7139 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7140 | 0 \ |
| 7141 | -s "16384 bytes written in 1 fragments" \ |
| 7142 | -c "Read from server: 16384 bytes read" |
| 7143 | |
| 7144 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7145 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 7146 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7147 | "$P_CLI force_version=tls1 \ |
| 7148 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7149 | 0 \ |
| 7150 | -s "16384 bytes written in 1 fragments" \ |
| 7151 | -c "Read from server: 16384 bytes read" |
| 7152 | |
| 7153 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7154 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 7155 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7156 | "$P_CLI force_version=tls1 \ |
| 7157 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7158 | 0 \ |
| 7159 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7160 | -c "Read from server: 16384 bytes read" |
| 7161 | |
| 7162 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 7163 | "$P_SRV response_size=16384" \ |
| 7164 | "$P_CLI force_version=tls1_1 \ |
| 7165 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7166 | 0 \ |
| 7167 | -c "Read from server: 16384 bytes read" |
| 7168 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7169 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 7170 | "$P_SRV response_size=16384" \ |
| 7171 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 7172 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7173 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7174 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7175 | -c "Read from server: 16384 bytes read" |
| 7176 | |
| 7177 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7178 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 7179 | "$P_SRV response_size=16384" \ |
| 7180 | "$P_CLI force_version=tls1_1 \ |
| 7181 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7182 | trunc_hmac=1" \ |
| 7183 | 0 \ |
| 7184 | -c "Read from server: 16384 bytes read" |
| 7185 | |
| 7186 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7187 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 7188 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 7189 | "$P_CLI force_version=tls1_1 \ |
| 7190 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7191 | 0 \ |
| 7192 | -s "16384 bytes written in 1 fragments" \ |
| 7193 | -c "Read from server: 16384 bytes read" |
| 7194 | |
| 7195 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 7196 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7197 | "$P_CLI force_version=tls1_1 \ |
| 7198 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7199 | 0 \ |
| 7200 | -c "Read from server: 16384 bytes read" |
| 7201 | |
| 7202 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 7203 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7204 | "$P_CLI force_version=tls1_1 \ |
| 7205 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7206 | 0 \ |
| 7207 | -s "16384 bytes written in 1 fragments" \ |
| 7208 | -c "Read from server: 16384 bytes read" |
| 7209 | |
| 7210 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7211 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 7212 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7213 | "$P_CLI force_version=tls1_1 \ |
| 7214 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7215 | trunc_hmac=1" \ |
| 7216 | 0 \ |
| 7217 | -c "Read from server: 16384 bytes read" |
| 7218 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7219 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 7220 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7221 | "$P_CLI force_version=tls1_1 \ |
| 7222 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7223 | 0 \ |
| 7224 | -s "16384 bytes written in 1 fragments" \ |
| 7225 | -c "Read from server: 16384 bytes read" |
| 7226 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7227 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 7228 | "$P_SRV response_size=16384" \ |
| 7229 | "$P_CLI force_version=tls1_2 \ |
| 7230 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7231 | 0 \ |
| 7232 | -c "Read from server: 16384 bytes read" |
| 7233 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7234 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 7235 | "$P_SRV response_size=16384" \ |
| 7236 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 7237 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7238 | 0 \ |
| 7239 | -s "16384 bytes written in 1 fragments" \ |
| 7240 | -c "Read from server: 16384 bytes read" |
| 7241 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7242 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 7243 | "$P_SRV response_size=16384" \ |
| 7244 | "$P_CLI force_version=tls1_2 \ |
| 7245 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 7246 | 0 \ |
| 7247 | -c "Read from server: 16384 bytes read" |
| 7248 | |
| 7249 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7250 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 7251 | "$P_SRV response_size=16384" \ |
| 7252 | "$P_CLI force_version=tls1_2 \ |
| 7253 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7254 | trunc_hmac=1" \ |
| 7255 | 0 \ |
| 7256 | -c "Read from server: 16384 bytes read" |
| 7257 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7258 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 7259 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 7260 | "$P_CLI force_version=tls1_2 \ |
| 7261 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7262 | 0 \ |
| 7263 | -s "16384 bytes written in 1 fragments" \ |
| 7264 | -c "Read from server: 16384 bytes read" |
| 7265 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7266 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 7267 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7268 | "$P_CLI force_version=tls1_2 \ |
| 7269 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7270 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7271 | -s "16384 bytes written in 1 fragments" \ |
| 7272 | -c "Read from server: 16384 bytes read" |
| 7273 | |
| 7274 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 7275 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7276 | "$P_CLI force_version=tls1_2 \ |
| 7277 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7278 | 0 \ |
| 7279 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7280 | -c "Read from server: 16384 bytes read" |
| 7281 | |
| 7282 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7283 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 7284 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7285 | "$P_CLI force_version=tls1_2 \ |
| 7286 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7287 | trunc_hmac=1" \ |
| 7288 | 0 \ |
| 7289 | -c "Read from server: 16384 bytes read" |
| 7290 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7291 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7292 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7293 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7294 | "$P_CLI force_version=tls1_2 \ |
| 7295 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7296 | 0 \ |
| 7297 | -s "16384 bytes written in 1 fragments" \ |
| 7298 | -c "Read from server: 16384 bytes read" |
| 7299 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7300 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 7301 | "$P_SRV response_size=16384" \ |
| 7302 | "$P_CLI force_version=tls1_2 \ |
| 7303 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7304 | 0 \ |
| 7305 | -c "Read from server: 16384 bytes read" |
| 7306 | |
| 7307 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 7308 | "$P_SRV response_size=16384" \ |
| 7309 | "$P_CLI force_version=tls1_2 \ |
| 7310 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7311 | 0 \ |
| 7312 | -c "Read from server: 16384 bytes read" |
| 7313 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7314 | # Tests for restartable ECC |
| 7315 | |
| 7316 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7317 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7318 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7319 | "$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] | 7320 | 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] | 7321 | debug_level=1" \ |
| 7322 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7323 | -C "x509_verify_cert.*4b00" \ |
| 7324 | -C "mbedtls_pk_verify.*4b00" \ |
| 7325 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7326 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7327 | |
| 7328 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7329 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7330 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7331 | "$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] | 7332 | 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] | 7333 | debug_level=1 ec_max_ops=0" \ |
| 7334 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7335 | -C "x509_verify_cert.*4b00" \ |
| 7336 | -C "mbedtls_pk_verify.*4b00" \ |
| 7337 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7338 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7339 | |
| 7340 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7341 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7342 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7343 | "$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] | 7344 | 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] | 7345 | debug_level=1 ec_max_ops=65535" \ |
| 7346 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7347 | -C "x509_verify_cert.*4b00" \ |
| 7348 | -C "mbedtls_pk_verify.*4b00" \ |
| 7349 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7350 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7351 | |
| 7352 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7353 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7354 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7355 | "$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] | 7356 | 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] | 7357 | debug_level=1 ec_max_ops=1000" \ |
| 7358 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7359 | -c "x509_verify_cert.*4b00" \ |
| 7360 | -c "mbedtls_pk_verify.*4b00" \ |
| 7361 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7362 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7363 | |
| 7364 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7365 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7366 | "$P_SRV auth_mode=required \ |
| 7367 | crt_file=data_files/server5-badsign.crt \ |
| 7368 | key_file=data_files/server5.key" \ |
| 7369 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7370 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7371 | debug_level=1 ec_max_ops=1000" \ |
| 7372 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7373 | -c "x509_verify_cert.*4b00" \ |
| 7374 | -C "mbedtls_pk_verify.*4b00" \ |
| 7375 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7376 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7377 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7378 | -c "! mbedtls_ssl_handshake returned" \ |
| 7379 | -c "X509 - Certificate verification failed" |
| 7380 | |
| 7381 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7382 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7383 | "$P_SRV auth_mode=required \ |
| 7384 | crt_file=data_files/server5-badsign.crt \ |
| 7385 | key_file=data_files/server5.key" \ |
| 7386 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7387 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7388 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7389 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7390 | -c "x509_verify_cert.*4b00" \ |
| 7391 | -c "mbedtls_pk_verify.*4b00" \ |
| 7392 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7393 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7394 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7395 | -C "! mbedtls_ssl_handshake returned" \ |
| 7396 | -C "X509 - Certificate verification failed" |
| 7397 | |
| 7398 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7399 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7400 | "$P_SRV auth_mode=required \ |
| 7401 | crt_file=data_files/server5-badsign.crt \ |
| 7402 | key_file=data_files/server5.key" \ |
| 7403 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7404 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7405 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7406 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7407 | -C "x509_verify_cert.*4b00" \ |
| 7408 | -c "mbedtls_pk_verify.*4b00" \ |
| 7409 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7410 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7411 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7412 | -C "! mbedtls_ssl_handshake returned" \ |
| 7413 | -C "X509 - Certificate verification failed" |
| 7414 | |
| 7415 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7416 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7417 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7418 | "$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] | 7419 | 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] | 7420 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7421 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7422 | -c "x509_verify_cert.*4b00" \ |
| 7423 | -c "mbedtls_pk_verify.*4b00" \ |
| 7424 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7425 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7426 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7427 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7428 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7429 | "$P_SRV" \ |
| 7430 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7431 | debug_level=1 ec_max_ops=1000" \ |
| 7432 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7433 | -c "x509_verify_cert.*4b00" \ |
| 7434 | -c "mbedtls_pk_verify.*4b00" \ |
| 7435 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7436 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7437 | |
| 7438 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7439 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 7440 | "$P_SRV psk=abc123" \ |
| 7441 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7442 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7443 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7444 | -C "x509_verify_cert.*4b00" \ |
| 7445 | -C "mbedtls_pk_verify.*4b00" \ |
| 7446 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7447 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7448 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7449 | # Tests of asynchronous private key support in SSL |
| 7450 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7451 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7452 | run_test "SSL async private: sign, delay=0" \ |
| 7453 | "$P_SRV \ |
| 7454 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7455 | "$P_CLI" \ |
| 7456 | 0 \ |
| 7457 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7458 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7459 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7460 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7461 | run_test "SSL async private: sign, delay=1" \ |
| 7462 | "$P_SRV \ |
| 7463 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7464 | "$P_CLI" \ |
| 7465 | 0 \ |
| 7466 | -s "Async sign callback: using key slot " \ |
| 7467 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7468 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7469 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7470 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7471 | run_test "SSL async private: sign, delay=2" \ |
| 7472 | "$P_SRV \ |
| 7473 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7474 | "$P_CLI" \ |
| 7475 | 0 \ |
| 7476 | -s "Async sign callback: using key slot " \ |
| 7477 | -U "Async sign callback: using key slot " \ |
| 7478 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7479 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7480 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7481 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7482 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7483 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7484 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7486 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7487 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7488 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7489 | "$P_CLI force_version=tls1_1" \ |
| 7490 | 0 \ |
| 7491 | -s "Async sign callback: using key slot " \ |
| 7492 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7493 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7494 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7495 | run_test "SSL async private: sign, SNI" \ |
| 7496 | "$P_SRV debug_level=3 \ |
| 7497 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7498 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7499 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7500 | "$P_CLI server_name=polarssl.example" \ |
| 7501 | 0 \ |
| 7502 | -s "Async sign callback: using key slot " \ |
| 7503 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7504 | -s "parse ServerName extension" \ |
| 7505 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7506 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7507 | |
| 7508 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7509 | run_test "SSL async private: decrypt, delay=0" \ |
| 7510 | "$P_SRV \ |
| 7511 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7512 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7513 | 0 \ |
| 7514 | -s "Async decrypt callback: using key slot " \ |
| 7515 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7516 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7517 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7518 | run_test "SSL async private: decrypt, delay=1" \ |
| 7519 | "$P_SRV \ |
| 7520 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7521 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7522 | 0 \ |
| 7523 | -s "Async decrypt callback: using key slot " \ |
| 7524 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7525 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7526 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7527 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7528 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7529 | "$P_SRV psk=abc123 \ |
| 7530 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7531 | "$P_CLI psk=abc123 \ |
| 7532 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7533 | 0 \ |
| 7534 | -s "Async decrypt callback: using key slot " \ |
| 7535 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7536 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7537 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7538 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7539 | "$P_SRV psk=abc123 \ |
| 7540 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7541 | "$P_CLI psk=abc123 \ |
| 7542 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7543 | 0 \ |
| 7544 | -s "Async decrypt callback: using key slot " \ |
| 7545 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7546 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7547 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7548 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7549 | run_test "SSL async private: sign callback not present" \ |
| 7550 | "$P_SRV \ |
| 7551 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7552 | "$P_CLI; [ \$? -eq 1 ] && |
| 7553 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7554 | 0 \ |
| 7555 | -S "Async sign callback" \ |
| 7556 | -s "! mbedtls_ssl_handshake returned" \ |
| 7557 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7558 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7559 | -s "Successful connection" |
| 7560 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7561 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7562 | run_test "SSL async private: decrypt callback not present" \ |
| 7563 | "$P_SRV debug_level=1 \ |
| 7564 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7565 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7566 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7567 | 0 \ |
| 7568 | -S "Async decrypt callback" \ |
| 7569 | -s "! mbedtls_ssl_handshake returned" \ |
| 7570 | -s "got no RSA private key" \ |
| 7571 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7572 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7573 | |
| 7574 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7575 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7576 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7577 | "$P_SRV \ |
| 7578 | async_operations=s async_private_delay1=1 \ |
| 7579 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7580 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7581 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7582 | 0 \ |
| 7583 | -s "Async sign callback: using key slot 0," \ |
| 7584 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7585 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7586 | |
| 7587 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7588 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7589 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7590 | "$P_SRV \ |
| 7591 | async_operations=s async_private_delay2=1 \ |
| 7592 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7593 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7594 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7595 | 0 \ |
| 7596 | -s "Async sign callback: using key slot 0," \ |
| 7597 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7598 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7599 | |
| 7600 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7601 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7602 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7603 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7604 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7605 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7606 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7607 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7608 | 0 \ |
| 7609 | -s "Async sign callback: using key slot 1," \ |
| 7610 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7611 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7612 | |
| 7613 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7614 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7615 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7616 | "$P_SRV \ |
| 7617 | async_operations=s async_private_delay1=1 \ |
| 7618 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7619 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7620 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7621 | 0 \ |
| 7622 | -s "Async sign callback: no key matches this certificate." |
| 7623 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7624 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7625 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7626 | "$P_SRV \ |
| 7627 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7628 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7629 | "$P_CLI" \ |
| 7630 | 1 \ |
| 7631 | -s "Async sign callback: injected error" \ |
| 7632 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7633 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7634 | -s "! mbedtls_ssl_handshake returned" |
| 7635 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7636 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7637 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7638 | "$P_SRV \ |
| 7639 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7640 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7641 | "$P_CLI" \ |
| 7642 | 1 \ |
| 7643 | -s "Async sign callback: using key slot " \ |
| 7644 | -S "Async resume" \ |
| 7645 | -s "Async cancel" |
| 7646 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7647 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7648 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7649 | "$P_SRV \ |
| 7650 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7651 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7652 | "$P_CLI" \ |
| 7653 | 1 \ |
| 7654 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7655 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7656 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7657 | -s "! mbedtls_ssl_handshake returned" |
| 7658 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7659 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7660 | run_test "SSL async private: decrypt, error in start" \ |
| 7661 | "$P_SRV \ |
| 7662 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7663 | async_private_error=1" \ |
| 7664 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7665 | 1 \ |
| 7666 | -s "Async decrypt callback: injected error" \ |
| 7667 | -S "Async resume" \ |
| 7668 | -S "Async cancel" \ |
| 7669 | -s "! mbedtls_ssl_handshake returned" |
| 7670 | |
| 7671 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7672 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7673 | "$P_SRV \ |
| 7674 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7675 | async_private_error=2" \ |
| 7676 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7677 | 1 \ |
| 7678 | -s "Async decrypt callback: using key slot " \ |
| 7679 | -S "Async resume" \ |
| 7680 | -s "Async cancel" |
| 7681 | |
| 7682 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7683 | run_test "SSL async private: decrypt, error in resume" \ |
| 7684 | "$P_SRV \ |
| 7685 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7686 | async_private_error=3" \ |
| 7687 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7688 | 1 \ |
| 7689 | -s "Async decrypt callback: using key slot " \ |
| 7690 | -s "Async resume callback: decrypt done but injected error" \ |
| 7691 | -S "Async cancel" \ |
| 7692 | -s "! mbedtls_ssl_handshake returned" |
| 7693 | |
| 7694 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7695 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7696 | "$P_SRV \ |
| 7697 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7698 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7699 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7700 | 0 \ |
| 7701 | -s "Async cancel" \ |
| 7702 | -s "! mbedtls_ssl_handshake returned" \ |
| 7703 | -s "Async resume" \ |
| 7704 | -s "Successful connection" |
| 7705 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7706 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7707 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7708 | "$P_SRV \ |
| 7709 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7710 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7711 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7712 | 0 \ |
| 7713 | -s "! mbedtls_ssl_handshake returned" \ |
| 7714 | -s "Async resume" \ |
| 7715 | -s "Successful connection" |
| 7716 | |
| 7717 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7718 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7719 | 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] | 7720 | "$P_SRV \ |
| 7721 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7722 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7723 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7724 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7725 | [ \$? -eq 1 ] && |
| 7726 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7727 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7728 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7729 | -S "Async resume" \ |
| 7730 | -s "Async cancel" \ |
| 7731 | -s "! mbedtls_ssl_handshake returned" \ |
| 7732 | -s "Async sign callback: no key matches this certificate." \ |
| 7733 | -s "Successful connection" |
| 7734 | |
| 7735 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7736 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7737 | 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] | 7738 | "$P_SRV \ |
| 7739 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7740 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7741 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7742 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7743 | [ \$? -eq 1 ] && |
| 7744 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7745 | 0 \ |
| 7746 | -s "Async resume" \ |
| 7747 | -s "! mbedtls_ssl_handshake returned" \ |
| 7748 | -s "Async sign callback: no key matches this certificate." \ |
| 7749 | -s "Successful connection" |
| 7750 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7751 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7752 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7753 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7754 | "$P_SRV \ |
| 7755 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7756 | exchanges=2 renegotiation=1" \ |
| 7757 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7758 | 0 \ |
| 7759 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7760 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7761 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7762 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7763 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7764 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7765 | "$P_SRV \ |
| 7766 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7767 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7768 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7769 | 0 \ |
| 7770 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7771 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7772 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7773 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7774 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7775 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7776 | "$P_SRV \ |
| 7777 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7778 | exchanges=2 renegotiation=1" \ |
| 7779 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7780 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7781 | 0 \ |
| 7782 | -s "Async decrypt callback: using key slot " \ |
| 7783 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7784 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7785 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7786 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7787 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7788 | "$P_SRV \ |
| 7789 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7790 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7791 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7792 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7793 | 0 \ |
| 7794 | -s "Async decrypt callback: using key slot " \ |
| 7795 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7796 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7797 | # Tests for ECC extensions (rfc 4492) |
| 7798 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7799 | requires_config_enabled MBEDTLS_AES_C |
| 7800 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7801 | requires_config_enabled MBEDTLS_SHA256_C |
| 7802 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7803 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7804 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7805 | "$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] | 7806 | 0 \ |
| 7807 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7808 | -C "client hello, adding supported_point_formats extension" \ |
| 7809 | -S "found supported elliptic curves extension" \ |
| 7810 | -S "found supported point formats extension" |
| 7811 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7812 | requires_config_enabled MBEDTLS_AES_C |
| 7813 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7814 | requires_config_enabled MBEDTLS_SHA256_C |
| 7815 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7816 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7817 | "$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] | 7818 | "$P_CLI debug_level=3" \ |
| 7819 | 0 \ |
| 7820 | -C "found supported_point_formats extension" \ |
| 7821 | -S "server hello, supported_point_formats extension" |
| 7822 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7823 | requires_config_enabled MBEDTLS_AES_C |
| 7824 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7825 | requires_config_enabled MBEDTLS_SHA256_C |
| 7826 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7827 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7828 | "$P_SRV debug_level=3" \ |
| 7829 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7830 | 0 \ |
| 7831 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7832 | -c "client hello, adding supported_point_formats extension" \ |
| 7833 | -s "found supported elliptic curves extension" \ |
| 7834 | -s "found supported point formats extension" |
| 7835 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7836 | requires_config_enabled MBEDTLS_AES_C |
| 7837 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7838 | requires_config_enabled MBEDTLS_SHA256_C |
| 7839 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7840 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7841 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7842 | "$P_CLI debug_level=3" \ |
| 7843 | 0 \ |
| 7844 | -c "found supported_point_formats extension" \ |
| 7845 | -s "server hello, supported_point_formats extension" |
| 7846 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7847 | # Tests for DTLS HelloVerifyRequest |
| 7848 | |
| 7849 | run_test "DTLS cookie: enabled" \ |
| 7850 | "$P_SRV dtls=1 debug_level=2" \ |
| 7851 | "$P_CLI dtls=1 debug_level=2" \ |
| 7852 | 0 \ |
| 7853 | -s "cookie verification failed" \ |
| 7854 | -s "cookie verification passed" \ |
| 7855 | -S "cookie verification skipped" \ |
| 7856 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7857 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7858 | -S "SSL - The requested feature is not available" |
| 7859 | |
| 7860 | run_test "DTLS cookie: disabled" \ |
| 7861 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7862 | "$P_CLI dtls=1 debug_level=2" \ |
| 7863 | 0 \ |
| 7864 | -S "cookie verification failed" \ |
| 7865 | -S "cookie verification passed" \ |
| 7866 | -s "cookie verification skipped" \ |
| 7867 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7868 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7869 | -S "SSL - The requested feature is not available" |
| 7870 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7871 | run_test "DTLS cookie: default (failing)" \ |
| 7872 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7873 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7874 | 1 \ |
| 7875 | -s "cookie verification failed" \ |
| 7876 | -S "cookie verification passed" \ |
| 7877 | -S "cookie verification skipped" \ |
| 7878 | -C "received hello verify request" \ |
| 7879 | -S "hello verification requested" \ |
| 7880 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7881 | |
| 7882 | requires_ipv6 |
| 7883 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7884 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7885 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7886 | 0 \ |
| 7887 | -s "cookie verification failed" \ |
| 7888 | -s "cookie verification passed" \ |
| 7889 | -S "cookie verification skipped" \ |
| 7890 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7891 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7892 | -S "SSL - The requested feature is not available" |
| 7893 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7894 | run_test "DTLS cookie: enabled, nbio" \ |
| 7895 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7896 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7897 | 0 \ |
| 7898 | -s "cookie verification failed" \ |
| 7899 | -s "cookie verification passed" \ |
| 7900 | -S "cookie verification skipped" \ |
| 7901 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7902 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7903 | -S "SSL - The requested feature is not available" |
| 7904 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7905 | # Tests for client reconnecting from the same port with DTLS |
| 7906 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7907 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7908 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7909 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7910 | "$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] | 7911 | 0 \ |
| 7912 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7913 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7914 | -S "Client initiated reconnection from same port" |
| 7915 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7916 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7917 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7918 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7919 | "$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] | 7920 | 0 \ |
| 7921 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7922 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7923 | -s "Client initiated reconnection from same port" |
| 7924 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7925 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7926 | 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] | 7927 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7928 | "$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] | 7929 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7930 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7931 | -s "Client initiated reconnection from same port" |
| 7932 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7933 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7934 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7935 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7936 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7937 | 0 \ |
| 7938 | -S "The operation timed out" \ |
| 7939 | -s "Client initiated reconnection from same port" |
| 7940 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7941 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7942 | "$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] | 7943 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7944 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7945 | -s "The operation timed out" \ |
| 7946 | -S "Client initiated reconnection from same port" |
| 7947 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7948 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7949 | -p "$P_PXY inject_clihlo=1" \ |
| 7950 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7951 | "$P_CLI dtls=1 exchanges=2" \ |
| 7952 | 0 \ |
| 7953 | -s "possible client reconnect from the same port" \ |
| 7954 | -S "Client initiated reconnection from same port" |
| 7955 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7956 | # Tests for various cases of client authentication with DTLS |
| 7957 | # (focused on handshake flows and message parsing) |
| 7958 | |
| 7959 | run_test "DTLS client auth: required" \ |
| 7960 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7961 | "$P_CLI dtls=1" \ |
| 7962 | 0 \ |
| 7963 | -s "Verifying peer X.509 certificate... ok" |
| 7964 | |
| 7965 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7966 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7967 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7968 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7969 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7970 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7971 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7972 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7973 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7974 | 0 \ |
| 7975 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7976 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7977 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7978 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7979 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7980 | "$P_CLI dtls=1 psk=abc124" \ |
| 7981 | 1 \ |
| 7982 | -s "SSL - Verification of the message MAC failed" \ |
| 7983 | -c "SSL - A fatal alert message was received from our peer" |
| 7984 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7985 | # Tests for receiving fragmented handshake messages with DTLS |
| 7986 | |
| 7987 | requires_gnutls |
| 7988 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7989 | "$G_SRV -u --mtu 2048 -a" \ |
| 7990 | "$P_CLI dtls=1 debug_level=2" \ |
| 7991 | 0 \ |
| 7992 | -C "found fragmented DTLS handshake message" \ |
| 7993 | -C "error" |
| 7994 | |
| 7995 | requires_gnutls |
| 7996 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7997 | "$G_SRV -u --mtu 512" \ |
| 7998 | "$P_CLI dtls=1 debug_level=2" \ |
| 7999 | 0 \ |
| 8000 | -c "found fragmented DTLS handshake message" \ |
| 8001 | -C "error" |
| 8002 | |
| 8003 | requires_gnutls |
| 8004 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8005 | "$G_SRV -u --mtu 128" \ |
| 8006 | "$P_CLI dtls=1 debug_level=2" \ |
| 8007 | 0 \ |
| 8008 | -c "found fragmented DTLS handshake message" \ |
| 8009 | -C "error" |
| 8010 | |
| 8011 | requires_gnutls |
| 8012 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8013 | "$G_SRV -u --mtu 128" \ |
| 8014 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8015 | 0 \ |
| 8016 | -c "found fragmented DTLS handshake message" \ |
| 8017 | -C "error" |
| 8018 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8019 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8020 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8021 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8022 | "$G_SRV -u --mtu 256" \ |
| 8023 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8024 | 0 \ |
| 8025 | -c "found fragmented DTLS handshake message" \ |
| 8026 | -c "client hello, adding renegotiation extension" \ |
| 8027 | -c "found renegotiation extension" \ |
| 8028 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8029 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8030 | -C "error" \ |
| 8031 | -s "Extra-header:" |
| 8032 | |
| 8033 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8035 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8036 | "$G_SRV -u --mtu 256" \ |
| 8037 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8038 | 0 \ |
| 8039 | -c "found fragmented DTLS handshake message" \ |
| 8040 | -c "client hello, adding renegotiation extension" \ |
| 8041 | -c "found renegotiation extension" \ |
| 8042 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8043 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8044 | -C "error" \ |
| 8045 | -s "Extra-header:" |
| 8046 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8047 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8048 | "$O_SRV -dtls1 -mtu 2048" \ |
| 8049 | "$P_CLI dtls=1 debug_level=2" \ |
| 8050 | 0 \ |
| 8051 | -C "found fragmented DTLS handshake message" \ |
| 8052 | -C "error" |
| 8053 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8054 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 8055 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8056 | "$P_CLI dtls=1 debug_level=2" \ |
| 8057 | 0 \ |
| 8058 | -c "found fragmented DTLS handshake message" \ |
| 8059 | -C "error" |
| 8060 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8061 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8062 | "$O_SRV -dtls1 -mtu 256" \ |
| 8063 | "$P_CLI dtls=1 debug_level=2" \ |
| 8064 | 0 \ |
| 8065 | -c "found fragmented DTLS handshake message" \ |
| 8066 | -C "error" |
| 8067 | |
| 8068 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 8069 | "$O_SRV -dtls1 -mtu 256" \ |
| 8070 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8071 | 0 \ |
| 8072 | -c "found fragmented DTLS handshake message" \ |
| 8073 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8074 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8075 | # Tests for sending fragmented handshake messages with DTLS |
| 8076 | # |
| 8077 | # Use client auth when we need the client to send large messages, |
| 8078 | # and use large cert chains on both sides too (the long chains we have all use |
| 8079 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 8080 | # Sizes reached (UDP payload): |
| 8081 | # - 2037B for server certificate |
| 8082 | # - 1542B for client certificate |
| 8083 | # - 1013B for newsessionticket |
| 8084 | # - all others below 512B |
| 8085 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 8086 | |
| 8087 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8088 | requires_config_enabled MBEDTLS_RSA_C |
| 8089 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8090 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8091 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8092 | run_test "DTLS fragmenting: none (for reference)" \ |
| 8093 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8094 | crt_file=data_files/server7_int-ca.crt \ |
| 8095 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8096 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8097 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8098 | "$P_CLI dtls=1 debug_level=2 \ |
| 8099 | crt_file=data_files/server8_int-ca2.crt \ |
| 8100 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8101 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8102 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8103 | 0 \ |
| 8104 | -S "found fragmented DTLS handshake message" \ |
| 8105 | -C "found fragmented DTLS handshake message" \ |
| 8106 | -C "error" |
| 8107 | |
| 8108 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8109 | requires_config_enabled MBEDTLS_RSA_C |
| 8110 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8111 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8112 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8113 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8114 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8115 | crt_file=data_files/server7_int-ca.crt \ |
| 8116 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8117 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8118 | max_frag_len=1024" \ |
| 8119 | "$P_CLI dtls=1 debug_level=2 \ |
| 8120 | crt_file=data_files/server8_int-ca2.crt \ |
| 8121 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8122 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8123 | max_frag_len=2048" \ |
| 8124 | 0 \ |
| 8125 | -S "found fragmented DTLS handshake message" \ |
| 8126 | -c "found fragmented DTLS handshake message" \ |
| 8127 | -C "error" |
| 8128 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8129 | # With the MFL extension, the server has no way of forcing |
| 8130 | # the client to not exceed a certain MTU; hence, the following |
| 8131 | # test can't be replicated with an MTU proxy such as the one |
| 8132 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8133 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8134 | requires_config_enabled MBEDTLS_RSA_C |
| 8135 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8136 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8137 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8138 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8139 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8140 | crt_file=data_files/server7_int-ca.crt \ |
| 8141 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8142 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8143 | max_frag_len=512" \ |
| 8144 | "$P_CLI dtls=1 debug_level=2 \ |
| 8145 | crt_file=data_files/server8_int-ca2.crt \ |
| 8146 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8147 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8148 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8149 | 0 \ |
| 8150 | -S "found fragmented DTLS handshake message" \ |
| 8151 | -c "found fragmented DTLS handshake message" \ |
| 8152 | -C "error" |
| 8153 | |
| 8154 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8155 | requires_config_enabled MBEDTLS_RSA_C |
| 8156 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8157 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8158 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8159 | 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] | 8160 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8161 | crt_file=data_files/server7_int-ca.crt \ |
| 8162 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8163 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8164 | max_frag_len=2048" \ |
| 8165 | "$P_CLI dtls=1 debug_level=2 \ |
| 8166 | crt_file=data_files/server8_int-ca2.crt \ |
| 8167 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8168 | hs_timeout=2500-60000 \ |
| 8169 | max_frag_len=1024" \ |
| 8170 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8171 | -S "found fragmented DTLS handshake message" \ |
| 8172 | -c "found fragmented DTLS handshake message" \ |
| 8173 | -C "error" |
| 8174 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8175 | # While not required by the standard defining the MFL extension |
| 8176 | # (according to which it only applies to records, not to datagrams), |
| 8177 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8178 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8179 | # to the peer. |
| 8180 | # The next test checks that no datagrams significantly larger than the |
| 8181 | # negotiated MFL are sent. |
| 8182 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8183 | requires_config_enabled MBEDTLS_RSA_C |
| 8184 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8185 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8186 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8187 | 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] | 8188 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8189 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8190 | crt_file=data_files/server7_int-ca.crt \ |
| 8191 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8192 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8193 | max_frag_len=2048" \ |
| 8194 | "$P_CLI dtls=1 debug_level=2 \ |
| 8195 | crt_file=data_files/server8_int-ca2.crt \ |
| 8196 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8197 | hs_timeout=2500-60000 \ |
| 8198 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8199 | 0 \ |
| 8200 | -S "found fragmented DTLS handshake message" \ |
| 8201 | -c "found fragmented DTLS handshake message" \ |
| 8202 | -C "error" |
| 8203 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8204 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8205 | requires_config_enabled MBEDTLS_RSA_C |
| 8206 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8207 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8208 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8209 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8210 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8211 | crt_file=data_files/server7_int-ca.crt \ |
| 8212 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8213 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8214 | max_frag_len=2048" \ |
| 8215 | "$P_CLI dtls=1 debug_level=2 \ |
| 8216 | crt_file=data_files/server8_int-ca2.crt \ |
| 8217 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8218 | hs_timeout=2500-60000 \ |
| 8219 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8220 | 0 \ |
| 8221 | -s "found fragmented DTLS handshake message" \ |
| 8222 | -c "found fragmented DTLS handshake message" \ |
| 8223 | -C "error" |
| 8224 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8225 | # While not required by the standard defining the MFL extension |
| 8226 | # (according to which it only applies to records, not to datagrams), |
| 8227 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8228 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8229 | # to the peer. |
| 8230 | # The next test checks that no datagrams significantly larger than the |
| 8231 | # negotiated MFL are sent. |
| 8232 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8233 | requires_config_enabled MBEDTLS_RSA_C |
| 8234 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8235 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8236 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8237 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8238 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8239 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8240 | crt_file=data_files/server7_int-ca.crt \ |
| 8241 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8242 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8243 | max_frag_len=2048" \ |
| 8244 | "$P_CLI dtls=1 debug_level=2 \ |
| 8245 | crt_file=data_files/server8_int-ca2.crt \ |
| 8246 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8247 | hs_timeout=2500-60000 \ |
| 8248 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8249 | 0 \ |
| 8250 | -s "found fragmented DTLS handshake message" \ |
| 8251 | -c "found fragmented DTLS handshake message" \ |
| 8252 | -C "error" |
| 8253 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8254 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8255 | requires_config_enabled MBEDTLS_RSA_C |
| 8256 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8257 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8258 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8259 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8260 | crt_file=data_files/server7_int-ca.crt \ |
| 8261 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8262 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8263 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8264 | "$P_CLI dtls=1 debug_level=2 \ |
| 8265 | crt_file=data_files/server8_int-ca2.crt \ |
| 8266 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8267 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8268 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8269 | 0 \ |
| 8270 | -S "found fragmented DTLS handshake message" \ |
| 8271 | -C "found fragmented DTLS handshake message" \ |
| 8272 | -C "error" |
| 8273 | |
| 8274 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8275 | requires_config_enabled MBEDTLS_RSA_C |
| 8276 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8277 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8278 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8279 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8280 | crt_file=data_files/server7_int-ca.crt \ |
| 8281 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8282 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8283 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8284 | "$P_CLI dtls=1 debug_level=2 \ |
| 8285 | crt_file=data_files/server8_int-ca2.crt \ |
| 8286 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8287 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8288 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8289 | 0 \ |
| 8290 | -s "found fragmented DTLS handshake message" \ |
| 8291 | -C "found fragmented DTLS handshake message" \ |
| 8292 | -C "error" |
| 8293 | |
| 8294 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8295 | requires_config_enabled MBEDTLS_RSA_C |
| 8296 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8297 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8298 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8299 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8300 | crt_file=data_files/server7_int-ca.crt \ |
| 8301 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8302 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8303 | mtu=512" \ |
| 8304 | "$P_CLI dtls=1 debug_level=2 \ |
| 8305 | crt_file=data_files/server8_int-ca2.crt \ |
| 8306 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8307 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8308 | mtu=2048" \ |
| 8309 | 0 \ |
| 8310 | -S "found fragmented DTLS handshake message" \ |
| 8311 | -c "found fragmented DTLS handshake message" \ |
| 8312 | -C "error" |
| 8313 | |
| 8314 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8315 | requires_config_enabled MBEDTLS_RSA_C |
| 8316 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8317 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8318 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8319 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8320 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8321 | crt_file=data_files/server7_int-ca.crt \ |
| 8322 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8323 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8324 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8325 | "$P_CLI dtls=1 debug_level=2 \ |
| 8326 | crt_file=data_files/server8_int-ca2.crt \ |
| 8327 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8328 | hs_timeout=2500-60000 \ |
| 8329 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8330 | 0 \ |
| 8331 | -s "found fragmented DTLS handshake message" \ |
| 8332 | -c "found fragmented DTLS handshake message" \ |
| 8333 | -C "error" |
| 8334 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8335 | # 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] | 8336 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8337 | requires_config_enabled MBEDTLS_RSA_C |
| 8338 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8339 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8340 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8341 | requires_config_enabled MBEDTLS_AES_C |
| 8342 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8343 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8344 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8345 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8346 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8347 | crt_file=data_files/server7_int-ca.crt \ |
| 8348 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8349 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8350 | mtu=512" \ |
| 8351 | "$P_CLI dtls=1 debug_level=2 \ |
| 8352 | crt_file=data_files/server8_int-ca2.crt \ |
| 8353 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8354 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8355 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8356 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8357 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8358 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8359 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8360 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8361 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8362 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8363 | # 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] | 8364 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8365 | # retransmissions, but in some cases (like both the server and client using |
| 8366 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8367 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8368 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8369 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8370 | requires_config_enabled MBEDTLS_RSA_C |
| 8371 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8372 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8373 | requires_config_enabled MBEDTLS_AES_C |
| 8374 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8375 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8376 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8377 | -p "$P_PXY mtu=508" \ |
| 8378 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8379 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8380 | key_file=data_files/server7.key \ |
| 8381 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8382 | "$P_CLI dtls=1 debug_level=2 \ |
| 8383 | crt_file=data_files/server8_int-ca2.crt \ |
| 8384 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8385 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8386 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8387 | 0 \ |
| 8388 | -s "found fragmented DTLS handshake message" \ |
| 8389 | -c "found fragmented DTLS handshake message" \ |
| 8390 | -C "error" |
| 8391 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8392 | # 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] | 8393 | only_with_valgrind |
| 8394 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8395 | requires_config_enabled MBEDTLS_RSA_C |
| 8396 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8397 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8398 | requires_config_enabled MBEDTLS_AES_C |
| 8399 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8400 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8401 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8402 | -p "$P_PXY mtu=508" \ |
| 8403 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8404 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8405 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8406 | hs_timeout=250-10000" \ |
| 8407 | "$P_CLI dtls=1 debug_level=2 \ |
| 8408 | crt_file=data_files/server8_int-ca2.crt \ |
| 8409 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8410 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8411 | hs_timeout=250-10000" \ |
| 8412 | 0 \ |
| 8413 | -s "found fragmented DTLS handshake message" \ |
| 8414 | -c "found fragmented DTLS handshake message" \ |
| 8415 | -C "error" |
| 8416 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8417 | # 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] | 8418 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8419 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8420 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8421 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8422 | requires_config_enabled MBEDTLS_RSA_C |
| 8423 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8424 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8425 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8426 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8427 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8428 | crt_file=data_files/server7_int-ca.crt \ |
| 8429 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8430 | hs_timeout=10000-60000 \ |
| 8431 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8432 | "$P_CLI dtls=1 debug_level=2 \ |
| 8433 | crt_file=data_files/server8_int-ca2.crt \ |
| 8434 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8435 | hs_timeout=10000-60000 \ |
| 8436 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8437 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8438 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8439 | -s "found fragmented DTLS handshake message" \ |
| 8440 | -c "found fragmented DTLS handshake message" \ |
| 8441 | -C "error" |
| 8442 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8443 | # 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] | 8444 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8445 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8446 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8447 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8448 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8449 | requires_config_enabled MBEDTLS_RSA_C |
| 8450 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8451 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8452 | requires_config_enabled MBEDTLS_AES_C |
| 8453 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8454 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8455 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8456 | -p "$P_PXY mtu=512" \ |
| 8457 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8458 | crt_file=data_files/server7_int-ca.crt \ |
| 8459 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8460 | hs_timeout=10000-60000 \ |
| 8461 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8462 | "$P_CLI dtls=1 debug_level=2 \ |
| 8463 | crt_file=data_files/server8_int-ca2.crt \ |
| 8464 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8465 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8466 | hs_timeout=10000-60000 \ |
| 8467 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8468 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8469 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8470 | -s "found fragmented DTLS handshake message" \ |
| 8471 | -c "found fragmented DTLS handshake message" \ |
| 8472 | -C "error" |
| 8473 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8474 | not_with_valgrind # spurious autoreduction due to timeout |
| 8475 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8476 | requires_config_enabled MBEDTLS_RSA_C |
| 8477 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8478 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8479 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8480 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8481 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8482 | crt_file=data_files/server7_int-ca.crt \ |
| 8483 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8484 | hs_timeout=10000-60000 \ |
| 8485 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8486 | "$P_CLI dtls=1 debug_level=2 \ |
| 8487 | crt_file=data_files/server8_int-ca2.crt \ |
| 8488 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8489 | hs_timeout=10000-60000 \ |
| 8490 | mtu=1024 nbio=2" \ |
| 8491 | 0 \ |
| 8492 | -S "autoreduction" \ |
| 8493 | -s "found fragmented DTLS handshake message" \ |
| 8494 | -c "found fragmented DTLS handshake message" \ |
| 8495 | -C "error" |
| 8496 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8497 | # 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] | 8498 | not_with_valgrind # spurious autoreduction due to timeout |
| 8499 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8500 | requires_config_enabled MBEDTLS_RSA_C |
| 8501 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8502 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8503 | requires_config_enabled MBEDTLS_AES_C |
| 8504 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8505 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8506 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8507 | -p "$P_PXY mtu=512" \ |
| 8508 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8509 | crt_file=data_files/server7_int-ca.crt \ |
| 8510 | key_file=data_files/server7.key \ |
| 8511 | hs_timeout=10000-60000 \ |
| 8512 | mtu=512 nbio=2" \ |
| 8513 | "$P_CLI dtls=1 debug_level=2 \ |
| 8514 | crt_file=data_files/server8_int-ca2.crt \ |
| 8515 | key_file=data_files/server8.key \ |
| 8516 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8517 | hs_timeout=10000-60000 \ |
| 8518 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8519 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8520 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8521 | -s "found fragmented DTLS handshake message" \ |
| 8522 | -c "found fragmented DTLS handshake message" \ |
| 8523 | -C "error" |
| 8524 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8525 | # 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] | 8526 | # This ensures things still work after session_reset(). |
| 8527 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8528 | # Since we don't support reading fragmented ClientHello yet, |
| 8529 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8530 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8531 | # An autoreduction on the client-side might happen if the server is |
| 8532 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8533 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8534 | # resumed listening, which would result in a spurious autoreduction. |
| 8535 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8536 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8537 | requires_config_enabled MBEDTLS_RSA_C |
| 8538 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8539 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8540 | requires_config_enabled MBEDTLS_AES_C |
| 8541 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8542 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8543 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8544 | -p "$P_PXY mtu=1450" \ |
| 8545 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8546 | crt_file=data_files/server7_int-ca.crt \ |
| 8547 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8548 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8549 | mtu=1450" \ |
| 8550 | "$P_CLI dtls=1 debug_level=2 \ |
| 8551 | crt_file=data_files/server8_int-ca2.crt \ |
| 8552 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8553 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8554 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8555 | 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] | 8556 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8557 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8558 | -s "found fragmented DTLS handshake message" \ |
| 8559 | -c "found fragmented DTLS handshake message" \ |
| 8560 | -C "error" |
| 8561 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8562 | # An autoreduction on the client-side might happen if the server is |
| 8563 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8564 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8565 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8566 | requires_config_enabled MBEDTLS_RSA_C |
| 8567 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8568 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8569 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8571 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8572 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8573 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8574 | -p "$P_PXY mtu=512" \ |
| 8575 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8576 | crt_file=data_files/server7_int-ca.crt \ |
| 8577 | key_file=data_files/server7.key \ |
| 8578 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8579 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8580 | mtu=512" \ |
| 8581 | "$P_CLI dtls=1 debug_level=2 \ |
| 8582 | crt_file=data_files/server8_int-ca2.crt \ |
| 8583 | key_file=data_files/server8.key \ |
| 8584 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8585 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8586 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8587 | mtu=512" \ |
| 8588 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8589 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8590 | -s "found fragmented DTLS handshake message" \ |
| 8591 | -c "found fragmented DTLS handshake message" \ |
| 8592 | -C "error" |
| 8593 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8594 | # An autoreduction on the client-side might happen if the server is |
| 8595 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8596 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8597 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8598 | requires_config_enabled MBEDTLS_RSA_C |
| 8599 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8600 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8601 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8602 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8603 | requires_config_enabled MBEDTLS_AES_C |
| 8604 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8605 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8606 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8607 | -p "$P_PXY mtu=512" \ |
| 8608 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8609 | crt_file=data_files/server7_int-ca.crt \ |
| 8610 | key_file=data_files/server7.key \ |
| 8611 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8612 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8613 | mtu=512" \ |
| 8614 | "$P_CLI dtls=1 debug_level=2 \ |
| 8615 | crt_file=data_files/server8_int-ca2.crt \ |
| 8616 | key_file=data_files/server8.key \ |
| 8617 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8618 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8619 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8620 | mtu=512" \ |
| 8621 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8622 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8623 | -s "found fragmented DTLS handshake message" \ |
| 8624 | -c "found fragmented DTLS handshake message" \ |
| 8625 | -C "error" |
| 8626 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8627 | # An autoreduction on the client-side might happen if the server is |
| 8628 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8629 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8630 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8631 | requires_config_enabled MBEDTLS_RSA_C |
| 8632 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8633 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8634 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8635 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8636 | requires_config_enabled MBEDTLS_AES_C |
| 8637 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8638 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8639 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8640 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8641 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8642 | crt_file=data_files/server7_int-ca.crt \ |
| 8643 | key_file=data_files/server7.key \ |
| 8644 | exchanges=2 renegotiation=1 \ |
| 8645 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8646 | hs_timeout=10000-60000 \ |
| 8647 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8648 | "$P_CLI dtls=1 debug_level=2 \ |
| 8649 | crt_file=data_files/server8_int-ca2.crt \ |
| 8650 | key_file=data_files/server8.key \ |
| 8651 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8652 | hs_timeout=10000-60000 \ |
| 8653 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8654 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8655 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8656 | -s "found fragmented DTLS handshake message" \ |
| 8657 | -c "found fragmented DTLS handshake message" \ |
| 8658 | -C "error" |
| 8659 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8660 | # An autoreduction on the client-side might happen if the server is |
| 8661 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8662 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8663 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8664 | requires_config_enabled MBEDTLS_RSA_C |
| 8665 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8666 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8667 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8668 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8669 | requires_config_enabled MBEDTLS_AES_C |
| 8670 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8671 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8672 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8673 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8674 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8675 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8676 | crt_file=data_files/server7_int-ca.crt \ |
| 8677 | key_file=data_files/server7.key \ |
| 8678 | exchanges=2 renegotiation=1 \ |
| 8679 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8680 | hs_timeout=10000-60000 \ |
| 8681 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8682 | "$P_CLI dtls=1 debug_level=2 \ |
| 8683 | crt_file=data_files/server8_int-ca2.crt \ |
| 8684 | key_file=data_files/server8.key \ |
| 8685 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8686 | hs_timeout=10000-60000 \ |
| 8687 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8688 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8689 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8690 | -s "found fragmented DTLS handshake message" \ |
| 8691 | -c "found fragmented DTLS handshake message" \ |
| 8692 | -C "error" |
| 8693 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8694 | # An autoreduction on the client-side might happen if the server is |
| 8695 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8696 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8697 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8698 | requires_config_enabled MBEDTLS_RSA_C |
| 8699 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8700 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8701 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8702 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8703 | requires_config_enabled MBEDTLS_AES_C |
| 8704 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8705 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8706 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8707 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8708 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8709 | crt_file=data_files/server7_int-ca.crt \ |
| 8710 | key_file=data_files/server7.key \ |
| 8711 | exchanges=2 renegotiation=1 \ |
| 8712 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8713 | hs_timeout=10000-60000 \ |
| 8714 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8715 | "$P_CLI dtls=1 debug_level=2 \ |
| 8716 | crt_file=data_files/server8_int-ca2.crt \ |
| 8717 | key_file=data_files/server8.key \ |
| 8718 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8719 | hs_timeout=10000-60000 \ |
| 8720 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8721 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8722 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8723 | -s "found fragmented DTLS handshake message" \ |
| 8724 | -c "found fragmented DTLS handshake message" \ |
| 8725 | -C "error" |
| 8726 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8727 | # 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] | 8728 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8729 | requires_config_enabled MBEDTLS_RSA_C |
| 8730 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8731 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8732 | requires_config_enabled MBEDTLS_AES_C |
| 8733 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8734 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8735 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8736 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8737 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8738 | "$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] | 8739 | crt_file=data_files/server7_int-ca.crt \ |
| 8740 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8741 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8742 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8743 | crt_file=data_files/server8_int-ca2.crt \ |
| 8744 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8745 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8746 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8747 | 0 \ |
| 8748 | -s "found fragmented DTLS handshake message" \ |
| 8749 | -c "found fragmented DTLS handshake message" \ |
| 8750 | -C "error" |
| 8751 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8752 | # 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] | 8753 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8754 | requires_config_enabled MBEDTLS_RSA_C |
| 8755 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8756 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8757 | requires_config_enabled MBEDTLS_AES_C |
| 8758 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8759 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8760 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8761 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8762 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8763 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8764 | crt_file=data_files/server7_int-ca.crt \ |
| 8765 | key_file=data_files/server7.key \ |
| 8766 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8767 | "$P_CLI dtls=1 debug_level=2 \ |
| 8768 | crt_file=data_files/server8_int-ca2.crt \ |
| 8769 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8770 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8771 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8772 | 0 \ |
| 8773 | -s "found fragmented DTLS handshake message" \ |
| 8774 | -c "found fragmented DTLS handshake message" \ |
| 8775 | -C "error" |
| 8776 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8777 | # interop tests for DTLS fragmentating with reliable connection |
| 8778 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8779 | # here and below we just want to test that the we fragment in a way that |
| 8780 | # pleases other implementations, so we don't need the peer to fragment |
| 8781 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8782 | requires_config_enabled MBEDTLS_RSA_C |
| 8783 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8784 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8785 | requires_gnutls |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8786 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8787 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8788 | "$G_SRV -u" \ |
| 8789 | "$P_CLI dtls=1 debug_level=2 \ |
| 8790 | crt_file=data_files/server8_int-ca2.crt \ |
| 8791 | key_file=data_files/server8.key \ |
| 8792 | mtu=512 force_version=dtls1_2" \ |
| 8793 | 0 \ |
| 8794 | -c "fragmenting handshake message" \ |
| 8795 | -C "error" |
| 8796 | |
| 8797 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8798 | requires_config_enabled MBEDTLS_RSA_C |
| 8799 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8800 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8801 | requires_gnutls |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8802 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8803 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8804 | "$G_SRV -u" \ |
| 8805 | "$P_CLI dtls=1 debug_level=2 \ |
| 8806 | crt_file=data_files/server8_int-ca2.crt \ |
| 8807 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8808 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8809 | 0 \ |
| 8810 | -c "fragmenting handshake message" \ |
| 8811 | -C "error" |
| 8812 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8813 | # We use --insecure for the GnuTLS client because it expects |
| 8814 | # the hostname / IP it connects to to be the name used in the |
| 8815 | # certificate obtained from the server. Here, however, it |
| 8816 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8817 | # as the server name in the certificate. This will make the |
| 8818 | # certifiate validation fail, but passing --insecure makes |
| 8819 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8820 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8821 | requires_config_enabled MBEDTLS_RSA_C |
| 8822 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8824 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8825 | requires_not_i686 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8826 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8827 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8828 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8829 | crt_file=data_files/server7_int-ca.crt \ |
| 8830 | key_file=data_files/server7.key \ |
| 8831 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8832 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8833 | 0 \ |
| 8834 | -s "fragmenting handshake message" |
| 8835 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8836 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8837 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8838 | requires_config_enabled MBEDTLS_RSA_C |
| 8839 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8840 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8841 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8842 | requires_not_i686 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8843 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8844 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8845 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8846 | crt_file=data_files/server7_int-ca.crt \ |
| 8847 | key_file=data_files/server7.key \ |
| 8848 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8849 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8850 | 0 \ |
| 8851 | -s "fragmenting handshake message" |
| 8852 | |
| 8853 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8854 | requires_config_enabled MBEDTLS_RSA_C |
| 8855 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8856 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8857 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8858 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8859 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8860 | "$P_CLI dtls=1 debug_level=2 \ |
| 8861 | crt_file=data_files/server8_int-ca2.crt \ |
| 8862 | key_file=data_files/server8.key \ |
| 8863 | mtu=512 force_version=dtls1_2" \ |
| 8864 | 0 \ |
| 8865 | -c "fragmenting handshake message" \ |
| 8866 | -C "error" |
| 8867 | |
| 8868 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8869 | requires_config_enabled MBEDTLS_RSA_C |
| 8870 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8872 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8873 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8874 | "$O_SRV -dtls1 -verify 10" \ |
| 8875 | "$P_CLI dtls=1 debug_level=2 \ |
| 8876 | crt_file=data_files/server8_int-ca2.crt \ |
| 8877 | key_file=data_files/server8.key \ |
| 8878 | mtu=512 force_version=dtls1" \ |
| 8879 | 0 \ |
| 8880 | -c "fragmenting handshake message" \ |
| 8881 | -C "error" |
| 8882 | |
| 8883 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8884 | requires_config_enabled MBEDTLS_RSA_C |
| 8885 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8887 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8888 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8889 | "$P_SRV dtls=1 debug_level=2 \ |
| 8890 | crt_file=data_files/server7_int-ca.crt \ |
| 8891 | key_file=data_files/server7.key \ |
| 8892 | mtu=512 force_version=dtls1_2" \ |
| 8893 | "$O_CLI -dtls1_2" \ |
| 8894 | 0 \ |
| 8895 | -s "fragmenting handshake message" |
| 8896 | |
| 8897 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8898 | requires_config_enabled MBEDTLS_RSA_C |
| 8899 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8901 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8902 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8903 | "$P_SRV dtls=1 debug_level=2 \ |
| 8904 | crt_file=data_files/server7_int-ca.crt \ |
| 8905 | key_file=data_files/server7.key \ |
| 8906 | mtu=512 force_version=dtls1" \ |
| 8907 | "$O_CLI -dtls1" \ |
| 8908 | 0 \ |
| 8909 | -s "fragmenting handshake message" |
| 8910 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8911 | # interop tests for DTLS fragmentating with unreliable connection |
| 8912 | # |
| 8913 | # again we just want to test that the we fragment in a way that |
| 8914 | # pleases other implementations, so we don't need the peer to fragment |
| 8915 | requires_gnutls_next |
| 8916 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8917 | requires_config_enabled MBEDTLS_RSA_C |
| 8918 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8920 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8921 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8922 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8923 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8924 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8925 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8926 | crt_file=data_files/server8_int-ca2.crt \ |
| 8927 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8928 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8929 | 0 \ |
| 8930 | -c "fragmenting handshake message" \ |
| 8931 | -C "error" |
| 8932 | |
| 8933 | requires_gnutls_next |
| 8934 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8935 | requires_config_enabled MBEDTLS_RSA_C |
| 8936 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8937 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8938 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8939 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8940 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8941 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8942 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8943 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8944 | crt_file=data_files/server8_int-ca2.crt \ |
| 8945 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8946 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8947 | 0 \ |
| 8948 | -c "fragmenting handshake message" \ |
| 8949 | -C "error" |
| 8950 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8951 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8952 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8953 | requires_config_enabled MBEDTLS_RSA_C |
| 8954 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8956 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8957 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8958 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8959 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8960 | "$P_SRV dtls=1 debug_level=2 \ |
| 8961 | crt_file=data_files/server7_int-ca.crt \ |
| 8962 | key_file=data_files/server7.key \ |
| 8963 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8964 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8965 | 0 \ |
| 8966 | -s "fragmenting handshake message" |
| 8967 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8968 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8969 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8970 | requires_config_enabled MBEDTLS_RSA_C |
| 8971 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8973 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8974 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8975 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8976 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8977 | "$P_SRV dtls=1 debug_level=2 \ |
| 8978 | crt_file=data_files/server7_int-ca.crt \ |
| 8979 | key_file=data_files/server7.key \ |
| 8980 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8981 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8982 | 0 \ |
| 8983 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8984 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8985 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8986 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8987 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8988 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8989 | ## (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] | 8990 | skip_next_test |
| 8991 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8992 | requires_config_enabled MBEDTLS_RSA_C |
| 8993 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8994 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8995 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8996 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8997 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8998 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8999 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9000 | "$P_CLI dtls=1 debug_level=2 \ |
| 9001 | crt_file=data_files/server8_int-ca2.crt \ |
| 9002 | key_file=data_files/server8.key \ |
| 9003 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 9004 | 0 \ |
| 9005 | -c "fragmenting handshake message" \ |
| 9006 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9007 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9008 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9009 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9010 | requires_config_enabled MBEDTLS_RSA_C |
| 9011 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9013 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9014 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9015 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 9016 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9017 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9018 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9019 | crt_file=data_files/server8_int-ca2.crt \ |
| 9020 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9021 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9022 | 0 \ |
| 9023 | -c "fragmenting handshake message" \ |
| 9024 | -C "error" |
| 9025 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9026 | skip_next_test |
| 9027 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9028 | requires_config_enabled MBEDTLS_RSA_C |
| 9029 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9031 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9032 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9033 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9034 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9035 | "$P_SRV dtls=1 debug_level=2 \ |
| 9036 | crt_file=data_files/server7_int-ca.crt \ |
| 9037 | key_file=data_files/server7.key \ |
| 9038 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 9039 | "$O_CLI -dtls1_2" \ |
| 9040 | 0 \ |
| 9041 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9042 | |
| 9043 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 9044 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9045 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9046 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9047 | requires_config_enabled MBEDTLS_RSA_C |
| 9048 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9050 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9051 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9052 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 9053 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9054 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9055 | crt_file=data_files/server7_int-ca.crt \ |
| 9056 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9057 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9058 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9059 | 0 \ |
| 9060 | -s "fragmenting handshake message" |
| 9061 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9062 | # Tests for DTLS-SRTP (RFC 5764) |
| 9063 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9064 | run_test "DTLS-SRTP all profiles supported" \ |
| 9065 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9066 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9067 | 0 \ |
| 9068 | -s "found use_srtp extension" \ |
| 9069 | -s "found srtp profile" \ |
| 9070 | -s "selected srtp profile" \ |
| 9071 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9072 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9073 | -c "client hello, adding use_srtp extension" \ |
| 9074 | -c "found use_srtp extension" \ |
| 9075 | -c "found srtp profile" \ |
| 9076 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9077 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9078 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9079 | -C "error" |
| 9080 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9081 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9082 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9083 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9084 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9085 | "$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] | 9086 | 0 \ |
| 9087 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9088 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9089 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9090 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9091 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9092 | -c "client hello, adding use_srtp extension" \ |
| 9093 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9094 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9095 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9096 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9097 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9098 | -C "error" |
| 9099 | |
| 9100 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9101 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9102 | "$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] | 9103 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9104 | 0 \ |
| 9105 | -s "found use_srtp extension" \ |
| 9106 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9107 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9108 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9109 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9110 | -c "client hello, adding use_srtp extension" \ |
| 9111 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9112 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9113 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9114 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9115 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9116 | -C "error" |
| 9117 | |
| 9118 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9119 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9120 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9121 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9122 | 0 \ |
| 9123 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9124 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9125 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9126 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9127 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9128 | -c "client hello, adding use_srtp extension" \ |
| 9129 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9130 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9131 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9132 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9133 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9134 | -C "error" |
| 9135 | |
| 9136 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9137 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9138 | "$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] | 9139 | "$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] | 9140 | 0 \ |
| 9141 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9142 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9143 | -S "selected srtp profile" \ |
| 9144 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9145 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9146 | -c "client hello, adding use_srtp extension" \ |
| 9147 | -C "found use_srtp extension" \ |
| 9148 | -C "found srtp profile" \ |
| 9149 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9150 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9151 | -C "error" |
| 9152 | |
| 9153 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9154 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9155 | "$P_SRV dtls=1 debug_level=3" \ |
| 9156 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9157 | 0 \ |
| 9158 | -s "found use_srtp extension" \ |
| 9159 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9160 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9161 | -c "client hello, adding use_srtp extension" \ |
| 9162 | -C "found use_srtp extension" \ |
| 9163 | -C "found srtp profile" \ |
| 9164 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9165 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9166 | -C "error" |
| 9167 | |
| 9168 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9169 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 9170 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 9171 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9172 | 0 \ |
| 9173 | -s "found use_srtp extension" \ |
| 9174 | -s "found srtp profile" \ |
| 9175 | -s "selected srtp profile" \ |
| 9176 | -s "server hello, adding use_srtp extension" \ |
| 9177 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9178 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9179 | -c "client hello, adding use_srtp extension" \ |
| 9180 | -c "found use_srtp extension" \ |
| 9181 | -c "found srtp profile" \ |
| 9182 | -c "selected srtp profile" \ |
| 9183 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9184 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9185 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9186 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9187 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9188 | -C "error" |
| 9189 | |
| 9190 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9191 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 9192 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9193 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9194 | 0 \ |
| 9195 | -s "found use_srtp extension" \ |
| 9196 | -s "found srtp profile" \ |
| 9197 | -s "selected srtp profile" \ |
| 9198 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9199 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9200 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9201 | -S "dumping 'using mki' (8 bytes)" \ |
| 9202 | -c "client hello, adding use_srtp extension" \ |
| 9203 | -c "found use_srtp extension" \ |
| 9204 | -c "found srtp profile" \ |
| 9205 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9206 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9207 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9208 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9209 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9210 | -C "dumping 'received mki' (8 bytes)" \ |
| 9211 | -C "error" |
| 9212 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9213 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9214 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 9215 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9216 | "$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] | 9217 | 0 \ |
| 9218 | -s "found use_srtp extension" \ |
| 9219 | -s "found srtp profile" \ |
| 9220 | -s "selected srtp profile" \ |
| 9221 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9222 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9223 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9224 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 9225 | |
| 9226 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9227 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 9228 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9229 | "$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] | 9230 | 0 \ |
| 9231 | -s "found use_srtp extension" \ |
| 9232 | -s "found srtp profile" \ |
| 9233 | -s "selected srtp profile" \ |
| 9234 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9235 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9236 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9237 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9238 | |
| 9239 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9240 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 9241 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9242 | "$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] | 9243 | 0 \ |
| 9244 | -s "found use_srtp extension" \ |
| 9245 | -s "found srtp profile" \ |
| 9246 | -s "selected srtp profile" \ |
| 9247 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9248 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9249 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9250 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9251 | |
| 9252 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9253 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 9254 | "$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] | 9255 | "$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] | 9256 | 0 \ |
| 9257 | -s "found use_srtp extension" \ |
| 9258 | -s "found srtp profile" \ |
| 9259 | -s "selected srtp profile" \ |
| 9260 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9261 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9262 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9263 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9264 | |
| 9265 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9266 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 9267 | "$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] | 9268 | "$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] | 9269 | 0 \ |
| 9270 | -s "found use_srtp extension" \ |
| 9271 | -s "found srtp profile" \ |
| 9272 | -s "selected srtp profile" \ |
| 9273 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9274 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9275 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9276 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9277 | |
| 9278 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9279 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 9280 | "$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] | 9281 | "$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] | 9282 | 0 \ |
| 9283 | -s "found use_srtp extension" \ |
| 9284 | -s "found srtp profile" \ |
| 9285 | -S "selected srtp profile" \ |
| 9286 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9287 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9288 | -C "SRTP Extension negotiated, profile" |
| 9289 | |
| 9290 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9291 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 9292 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9293 | "$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] | 9294 | 0 \ |
| 9295 | -s "found use_srtp extension" \ |
| 9296 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9297 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9298 | -C "SRTP Extension negotiated, profile" |
| 9299 | |
| 9300 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9301 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9302 | "$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] | 9303 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9304 | 0 \ |
| 9305 | -c "client hello, adding use_srtp extension" \ |
| 9306 | -c "found use_srtp extension" \ |
| 9307 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9308 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9309 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9310 | -C "error" |
| 9311 | |
| 9312 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9313 | 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] | 9314 | "$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] | 9315 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9316 | 0 \ |
| 9317 | -c "client hello, adding use_srtp extension" \ |
| 9318 | -c "found use_srtp extension" \ |
| 9319 | -c "found srtp profile" \ |
| 9320 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9321 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9322 | -C "error" |
| 9323 | |
| 9324 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9325 | 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] | 9326 | "$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] | 9327 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9328 | 0 \ |
| 9329 | -c "client hello, adding use_srtp extension" \ |
| 9330 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9331 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9332 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9333 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9334 | -C "error" |
| 9335 | |
| 9336 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9337 | 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] | 9338 | "$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] | 9339 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9340 | 0 \ |
| 9341 | -c "client hello, adding use_srtp extension" \ |
| 9342 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9343 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9344 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9345 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9346 | -C "error" |
| 9347 | |
| 9348 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9349 | 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] | 9350 | "$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] | 9351 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9352 | 0 \ |
| 9353 | -c "client hello, adding use_srtp extension" \ |
| 9354 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9355 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9356 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9357 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9358 | -C "error" |
| 9359 | |
| 9360 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9361 | 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] | 9362 | "$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] | 9363 | "$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] | 9364 | 0 \ |
| 9365 | -c "client hello, adding use_srtp extension" \ |
| 9366 | -C "found use_srtp extension" \ |
| 9367 | -C "found srtp profile" \ |
| 9368 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9369 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9370 | -C "error" |
| 9371 | |
| 9372 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9373 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9374 | "$O_SRV -dtls1" \ |
| 9375 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9376 | 0 \ |
| 9377 | -c "client hello, adding use_srtp extension" \ |
| 9378 | -C "found use_srtp extension" \ |
| 9379 | -C "found srtp profile" \ |
| 9380 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9381 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9382 | -C "error" |
| 9383 | |
| 9384 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9385 | 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] | 9386 | "$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] | 9387 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9388 | 0 \ |
| 9389 | -c "client hello, adding use_srtp extension" \ |
| 9390 | -c "found use_srtp extension" \ |
| 9391 | -c "found srtp profile" \ |
| 9392 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9393 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9394 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9395 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9396 | -C "dumping 'received mki' (8 bytes)" \ |
| 9397 | -C "error" |
| 9398 | |
| 9399 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9400 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9401 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9402 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9403 | "$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] | 9404 | 0 \ |
| 9405 | -s "found use_srtp extension" \ |
| 9406 | -s "found srtp profile" \ |
| 9407 | -s "selected srtp profile" \ |
| 9408 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9409 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9410 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9411 | |
| 9412 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9413 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9414 | 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] | 9415 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9416 | "$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] | 9417 | 0 \ |
| 9418 | -s "found use_srtp extension" \ |
| 9419 | -s "found srtp profile" \ |
| 9420 | -s "selected srtp profile" \ |
| 9421 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9422 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9423 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9424 | |
| 9425 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9426 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9427 | 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] | 9428 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9429 | "$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] | 9430 | 0 \ |
| 9431 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9432 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9433 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9434 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9435 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9436 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9437 | |
| 9438 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9439 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9440 | 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] | 9441 | "$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] | 9442 | "$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] | 9443 | 0 \ |
| 9444 | -s "found use_srtp extension" \ |
| 9445 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9446 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9447 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9448 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9449 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9450 | |
| 9451 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9452 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9453 | 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] | 9454 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9455 | "$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] | 9456 | 0 \ |
| 9457 | -s "found use_srtp extension" \ |
| 9458 | -s "found srtp profile" \ |
| 9459 | -s "selected srtp profile" \ |
| 9460 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9461 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9462 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9463 | |
| 9464 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9465 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9466 | 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] | 9467 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9468 | "$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] | 9469 | 0 \ |
| 9470 | -s "found use_srtp extension" \ |
| 9471 | -s "found srtp profile" \ |
| 9472 | -S "selected srtp profile" \ |
| 9473 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9474 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9475 | -C "SRTP profile:" |
| 9476 | |
| 9477 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9478 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9479 | 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] | 9480 | "$P_SRV dtls=1 debug_level=3" \ |
| 9481 | "$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] | 9482 | 0 \ |
| 9483 | -s "found use_srtp extension" \ |
| 9484 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9485 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9486 | -C "SRTP profile:" |
| 9487 | |
| 9488 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9489 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9490 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9491 | "$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" \ |
| 9492 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9493 | 0 \ |
| 9494 | -c "client hello, adding use_srtp extension" \ |
| 9495 | -c "found use_srtp extension" \ |
| 9496 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9497 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9498 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9499 | -C "error" |
| 9500 | |
| 9501 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9502 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9503 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9504 | "$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" \ |
| 9505 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9506 | 0 \ |
| 9507 | -c "client hello, adding use_srtp extension" \ |
| 9508 | -c "found use_srtp extension" \ |
| 9509 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9510 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9511 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9512 | -C "error" |
| 9513 | |
| 9514 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9515 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9516 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9517 | "$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" \ |
| 9518 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9519 | 0 \ |
| 9520 | -c "client hello, adding use_srtp extension" \ |
| 9521 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9522 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9523 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9524 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9525 | -C "error" |
| 9526 | |
| 9527 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9528 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9529 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9530 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9531 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9532 | 0 \ |
| 9533 | -c "client hello, adding use_srtp extension" \ |
| 9534 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9535 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9536 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9537 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9538 | -C "error" |
| 9539 | |
| 9540 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9541 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9542 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9543 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9544 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9545 | 0 \ |
| 9546 | -c "client hello, adding use_srtp extension" \ |
| 9547 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9548 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9549 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9550 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9551 | -C "error" |
| 9552 | |
| 9553 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9554 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9555 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9556 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9557 | "$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] | 9558 | 0 \ |
| 9559 | -c "client hello, adding use_srtp extension" \ |
| 9560 | -C "found use_srtp extension" \ |
| 9561 | -C "found srtp profile" \ |
| 9562 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9563 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9564 | -C "error" |
| 9565 | |
| 9566 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9567 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9568 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9569 | "$G_SRV -u" \ |
| 9570 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9571 | 0 \ |
| 9572 | -c "client hello, adding use_srtp extension" \ |
| 9573 | -C "found use_srtp extension" \ |
| 9574 | -C "found srtp profile" \ |
| 9575 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9576 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9577 | -C "error" |
| 9578 | |
| 9579 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9580 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9581 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9582 | "$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" \ |
| 9583 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9584 | 0 \ |
| 9585 | -c "client hello, adding use_srtp extension" \ |
| 9586 | -c "found use_srtp extension" \ |
| 9587 | -c "found srtp profile" \ |
| 9588 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9589 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9590 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9591 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9592 | -c "dumping 'received mki' (8 bytes)" \ |
| 9593 | -C "error" |
| 9594 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9595 | # Tests for specific things with "unreliable" UDP connection |
| 9596 | |
| 9597 | not_with_valgrind # spurious resend due to timeout |
| 9598 | run_test "DTLS proxy: reference" \ |
| 9599 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9600 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9601 | "$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] | 9602 | 0 \ |
| 9603 | -C "replayed record" \ |
| 9604 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9605 | -C "Buffer record from epoch" \ |
| 9606 | -S "Buffer record from epoch" \ |
| 9607 | -C "ssl_buffer_message" \ |
| 9608 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9609 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9610 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9611 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9612 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9613 | -c "HTTP/1.0 200 OK" |
| 9614 | |
| 9615 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9616 | run_test "DTLS proxy: duplicate every packet" \ |
| 9617 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9618 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9619 | "$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] | 9620 | 0 \ |
| 9621 | -c "replayed record" \ |
| 9622 | -s "replayed record" \ |
| 9623 | -c "record from another epoch" \ |
| 9624 | -s "record from another epoch" \ |
| 9625 | -S "resend" \ |
| 9626 | -s "Extra-header:" \ |
| 9627 | -c "HTTP/1.0 200 OK" |
| 9628 | |
| 9629 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9630 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9631 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9632 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9633 | 0 \ |
| 9634 | -c "replayed record" \ |
| 9635 | -S "replayed record" \ |
| 9636 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9637 | -s "record from another epoch" \ |
| 9638 | -c "resend" \ |
| 9639 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9640 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9641 | -c "HTTP/1.0 200 OK" |
| 9642 | |
| 9643 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9644 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9645 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9646 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9647 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9648 | -c "next record in same datagram" \ |
| 9649 | -s "next record in same datagram" |
| 9650 | |
| 9651 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9652 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9653 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9654 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9655 | 0 \ |
| 9656 | -c "next record in same datagram" \ |
| 9657 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9658 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9659 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9660 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9661 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9662 | "$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] | 9663 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9664 | -c "discarding invalid record (mac)" \ |
| 9665 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9666 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9667 | -c "HTTP/1.0 200 OK" \ |
| 9668 | -S "too many records with bad MAC" \ |
| 9669 | -S "Verification of the message MAC failed" |
| 9670 | |
| 9671 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9672 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9673 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9674 | "$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] | 9675 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9676 | -C "discarding invalid record (mac)" \ |
| 9677 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9678 | -S "Extra-header:" \ |
| 9679 | -C "HTTP/1.0 200 OK" \ |
| 9680 | -s "too many records with bad MAC" \ |
| 9681 | -s "Verification of the message MAC failed" |
| 9682 | |
| 9683 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9684 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9685 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9686 | "$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] | 9687 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9688 | -c "discarding invalid record (mac)" \ |
| 9689 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9690 | -s "Extra-header:" \ |
| 9691 | -c "HTTP/1.0 200 OK" \ |
| 9692 | -S "too many records with bad MAC" \ |
| 9693 | -S "Verification of the message MAC failed" |
| 9694 | |
| 9695 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9696 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9697 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9698 | "$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] | 9699 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9700 | -c "discarding invalid record (mac)" \ |
| 9701 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9702 | -s "Extra-header:" \ |
| 9703 | -c "HTTP/1.0 200 OK" \ |
| 9704 | -s "too many records with bad MAC" \ |
| 9705 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9706 | |
| 9707 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9708 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9709 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9710 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9711 | 0 \ |
| 9712 | -c "record from another epoch" \ |
| 9713 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9714 | -s "Extra-header:" \ |
| 9715 | -c "HTTP/1.0 200 OK" |
| 9716 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9717 | # Tests for reordering support with DTLS |
| 9718 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9719 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9720 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9721 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9722 | hs_timeout=2500-60000" \ |
| 9723 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9724 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9725 | 0 \ |
| 9726 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9727 | -c "Next handshake message has been buffered - load"\ |
| 9728 | -S "Buffering HS message" \ |
| 9729 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9730 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9731 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9732 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9733 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9734 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9735 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9736 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9737 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9738 | hs_timeout=2500-60000" \ |
| 9739 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9740 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9741 | 0 \ |
| 9742 | -c "Buffering HS message" \ |
| 9743 | -c "found fragmented DTLS handshake message"\ |
| 9744 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9745 | -c "Next handshake message has been buffered - load"\ |
| 9746 | -S "Buffering HS message" \ |
| 9747 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9748 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9749 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9750 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9751 | -S "Remember CCS message" |
| 9752 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9753 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9754 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9755 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9756 | # while keeping the ServerKeyExchange. |
| 9757 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 9758 | 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] | 9759 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9760 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9761 | hs_timeout=2500-60000" \ |
| 9762 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9763 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9764 | 0 \ |
| 9765 | -c "Buffering HS message" \ |
| 9766 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9767 | -C "attempt to make space by freeing buffered messages" \ |
| 9768 | -S "Buffering HS message" \ |
| 9769 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9770 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9771 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9772 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9773 | -S "Remember CCS message" |
| 9774 | |
| 9775 | # The size constraints ensure that the delayed certificate message can't |
| 9776 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9777 | # when dropping it first. |
| 9778 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9779 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 9780 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9781 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9782 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9783 | hs_timeout=2500-60000" \ |
| 9784 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9785 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9786 | 0 \ |
| 9787 | -c "Buffering HS message" \ |
| 9788 | -c "attempt to make space by freeing buffered future messages" \ |
| 9789 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9790 | -S "Buffering HS message" \ |
| 9791 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9792 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9793 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9794 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9795 | -S "Remember CCS message" |
| 9796 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9797 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9798 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9799 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9800 | hs_timeout=2500-60000" \ |
| 9801 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9802 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9803 | 0 \ |
| 9804 | -C "Buffering HS message" \ |
| 9805 | -C "Next handshake message has been buffered - load"\ |
| 9806 | -s "Buffering HS message" \ |
| 9807 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9808 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9809 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9810 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9811 | -S "Remember CCS message" |
| 9812 | |
| 9813 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9814 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9815 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9816 | hs_timeout=2500-60000" \ |
| 9817 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9818 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9819 | 0 \ |
| 9820 | -C "Buffering HS message" \ |
| 9821 | -C "Next handshake message has been buffered - load"\ |
| 9822 | -S "Buffering HS message" \ |
| 9823 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9824 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9825 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9826 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9827 | -S "Remember CCS message" |
| 9828 | |
| 9829 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9830 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9831 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9832 | hs_timeout=2500-60000" \ |
| 9833 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9834 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9835 | 0 \ |
| 9836 | -C "Buffering HS message" \ |
| 9837 | -C "Next handshake message has been buffered - load"\ |
| 9838 | -S "Buffering HS message" \ |
| 9839 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9840 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9841 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9842 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9843 | -s "Remember CCS message" |
| 9844 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9845 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9846 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9847 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9848 | hs_timeout=2500-60000" \ |
| 9849 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9850 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9851 | 0 \ |
| 9852 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9853 | -s "Found buffered record from current epoch - load" \ |
| 9854 | -c "Buffer record from epoch 1" \ |
| 9855 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9856 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9857 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9858 | # from the server are delayed, so that the encrypted Finished message |
| 9859 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9860 | # in afterwards, the encrypted Finished message must be freed in order |
| 9861 | # to make space for the NewSessionTicket to be reassembled. |
| 9862 | # This works only in very particular circumstances: |
| 9863 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9864 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9865 | # the encrypted Finished message. |
| 9866 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9867 | # needs to be fragmented. |
| 9868 | # - All messages sent by the server must be small enough to be either sent |
| 9869 | # without fragmentation or be reassembled within the bounds of |
| 9870 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9871 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9872 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9873 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9874 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9875 | -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] | 9876 | "$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] | 9877 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9878 | 0 \ |
| 9879 | -s "Buffer record from epoch 1" \ |
| 9880 | -s "Found buffered record from current epoch - load" \ |
| 9881 | -c "Buffer record from epoch 1" \ |
| 9882 | -C "Found buffered record from current epoch - load" \ |
| 9883 | -c "Enough space available after freeing future epoch record" |
| 9884 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9885 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9886 | |
| 9887 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9888 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9889 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9890 | "$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] | 9891 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9892 | "$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] | 9893 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9894 | 0 \ |
| 9895 | -s "Extra-header:" \ |
| 9896 | -c "HTTP/1.0 200 OK" |
| 9897 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9898 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9899 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9900 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9901 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9902 | "$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] | 9903 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9904 | 0 \ |
| 9905 | -s "Extra-header:" \ |
| 9906 | -c "HTTP/1.0 200 OK" |
| 9907 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9908 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9909 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9910 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9911 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9912 | "$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] | 9913 | 0 \ |
| 9914 | -s "Extra-header:" \ |
| 9915 | -c "HTTP/1.0 200 OK" |
| 9916 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9917 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9918 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9919 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9920 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9921 | "$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] | 9922 | 0 \ |
| 9923 | -s "Extra-header:" \ |
| 9924 | -c "HTTP/1.0 200 OK" |
| 9925 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9926 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9927 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9928 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9929 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9930 | "$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] | 9931 | 0 \ |
| 9932 | -s "Extra-header:" \ |
| 9933 | -c "HTTP/1.0 200 OK" |
| 9934 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9935 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9936 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9937 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9938 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9939 | "$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] | 9940 | 0 \ |
| 9941 | -s "Extra-header:" \ |
| 9942 | -c "HTTP/1.0 200 OK" |
| 9943 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9944 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9945 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9946 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9947 | "$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] | 9948 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9949 | "$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] | 9950 | 0 \ |
| 9951 | -s "Extra-header:" \ |
| 9952 | -c "HTTP/1.0 200 OK" |
| 9953 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9954 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9955 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9956 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9957 | "$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] | 9958 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9959 | "$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] | 9960 | 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] | 9961 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9962 | 0 \ |
| 9963 | -s "a session has been resumed" \ |
| 9964 | -c "a session has been resumed" \ |
| 9965 | -s "Extra-header:" \ |
| 9966 | -c "HTTP/1.0 200 OK" |
| 9967 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9968 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9969 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9970 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9971 | "$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] | 9972 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9973 | "$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] | 9974 | 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] | 9975 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9976 | 0 \ |
| 9977 | -s "a session has been resumed" \ |
| 9978 | -c "a session has been resumed" \ |
| 9979 | -s "Extra-header:" \ |
| 9980 | -c "HTTP/1.0 200 OK" |
| 9981 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9982 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9983 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9984 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9985 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9986 | "$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] | 9987 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9988 | "$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] | 9989 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9990 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9991 | 0 \ |
| 9992 | -c "=> renegotiate" \ |
| 9993 | -s "=> renegotiate" \ |
| 9994 | -s "Extra-header:" \ |
| 9995 | -c "HTTP/1.0 200 OK" |
| 9996 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9997 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9998 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9999 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10000 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10001 | "$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] | 10002 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10003 | "$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] | 10004 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10005 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10006 | 0 \ |
| 10007 | -c "=> renegotiate" \ |
| 10008 | -s "=> renegotiate" \ |
| 10009 | -s "Extra-header:" \ |
| 10010 | -c "HTTP/1.0 200 OK" |
| 10011 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10012 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10013 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10014 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10015 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10016 | "$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] | 10017 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10018 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10019 | "$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] | 10020 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10021 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10022 | 0 \ |
| 10023 | -c "=> renegotiate" \ |
| 10024 | -s "=> renegotiate" \ |
| 10025 | -s "Extra-header:" \ |
| 10026 | -c "HTTP/1.0 200 OK" |
| 10027 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10028 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10029 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10030 | 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] | 10031 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10032 | "$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] | 10033 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10034 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10035 | "$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] | 10036 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10037 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10038 | 0 \ |
| 10039 | -c "=> renegotiate" \ |
| 10040 | -s "=> renegotiate" \ |
| 10041 | -s "Extra-header:" \ |
| 10042 | -c "HTTP/1.0 200 OK" |
| 10043 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10044 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 10045 | ## all versions installed on the CI machines), reported here: |
| 10046 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 10047 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 10048 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 10049 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10050 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10051 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10052 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10053 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10054 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10055 | "$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] | 10056 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10057 | -c "HTTP/1.0 200 OK" |
| 10058 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10059 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10060 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10061 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10062 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10063 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10064 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10065 | "$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] | 10066 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10067 | -c "HTTP/1.0 200 OK" |
| 10068 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10069 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10070 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10071 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10072 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10073 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10074 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10075 | "$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] | 10076 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10077 | -c "HTTP/1.0 200 OK" |
| 10078 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10079 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10080 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10081 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10082 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10083 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 10084 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10085 | "$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] | 10086 | 0 \ |
| 10087 | -s "Extra-header:" \ |
| 10088 | -c "Extra-header:" |
| 10089 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10090 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10091 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10092 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10093 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 10094 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10095 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10096 | "$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] | 10097 | 0 \ |
| 10098 | -s "Extra-header:" \ |
| 10099 | -c "Extra-header:" |
| 10100 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10101 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10102 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10103 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10104 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 10105 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10106 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10107 | "$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] | 10108 | 0 \ |
| 10109 | -s "Extra-header:" \ |
| 10110 | -c "Extra-header:" |
| 10111 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10112 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 10113 | run_test "export keys functionality" \ |
| 10114 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 10115 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 10116 | 0 \ |
| 10117 | -s "exported maclen is " \ |
| 10118 | -s "exported keylen is " \ |
| 10119 | -s "exported ivlen is " \ |
| 10120 | -c "exported maclen is " \ |
| 10121 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 10122 | -c "exported ivlen is " \ |
| 10123 | -c "EAP-TLS key material is:"\ |
| 10124 | -s "EAP-TLS key material is:"\ |
| 10125 | -c "EAP-TLS IV is:" \ |
| 10126 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10127 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10128 | # Test heap memory usage after handshake |
| 10129 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 10130 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 10131 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10132 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10133 | run_tests_memory_after_hanshake |
| 10134 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10135 | # Final report |
| 10136 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10137 | echo "------------------------------------------------------------------------" |
| 10138 | |
| 10139 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10140 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10141 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10142 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10143 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 10144 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 10145 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10146 | |
| 10147 | exit $FAILS |