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() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 54 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 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 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [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 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 104 | CONFIG_H='../include/mbedtls/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 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 189 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 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 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 205 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 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 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 213 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 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 | 6f65743 | 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 |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 279 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 280 | maybe_requires_ciphersuite_enabled() { |
| 281 | case "$1" in |
| 282 | *\ force_ciphersuite=*) :;; |
| 283 | *) return;; # No specific required ciphersuite |
| 284 | esac |
| 285 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 286 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 287 | shift |
| 288 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 289 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 290 | |
| 291 | unset ciphersuite |
| 292 | } |
| 293 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 294 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 295 | requires_openssl_with_fallback_scsv() { |
| 296 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 297 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 298 | then |
| 299 | OPENSSL_HAS_FBSCSV="YES" |
| 300 | else |
| 301 | OPENSSL_HAS_FBSCSV="NO" |
| 302 | fi |
| 303 | fi |
| 304 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 305 | SKIP_NEXT="YES" |
| 306 | fi |
| 307 | } |
| 308 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 309 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 310 | requires_max_content_len() { |
| 311 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 312 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 313 | } |
| 314 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 315 | # skip next test if GnuTLS isn't available |
| 316 | requires_gnutls() { |
| 317 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 318 | 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] | 319 | GNUTLS_AVAILABLE="YES" |
| 320 | else |
| 321 | GNUTLS_AVAILABLE="NO" |
| 322 | fi |
| 323 | fi |
| 324 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 325 | SKIP_NEXT="YES" |
| 326 | fi |
| 327 | } |
| 328 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 329 | # skip next test if GnuTLS-next isn't available |
| 330 | requires_gnutls_next() { |
| 331 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 332 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 333 | GNUTLS_NEXT_AVAILABLE="YES" |
| 334 | else |
| 335 | GNUTLS_NEXT_AVAILABLE="NO" |
| 336 | fi |
| 337 | fi |
| 338 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 339 | SKIP_NEXT="YES" |
| 340 | fi |
| 341 | } |
| 342 | |
| 343 | # skip next test if OpenSSL-legacy isn't available |
| 344 | requires_openssl_legacy() { |
| 345 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 346 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 347 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 348 | else |
| 349 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 350 | fi |
| 351 | fi |
| 352 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 353 | SKIP_NEXT="YES" |
| 354 | fi |
| 355 | } |
| 356 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 357 | requires_openssl_next() { |
| 358 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 359 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 360 | OPENSSL_NEXT_AVAILABLE="YES" |
| 361 | else |
| 362 | OPENSSL_NEXT_AVAILABLE="NO" |
| 363 | fi |
| 364 | fi |
| 365 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 366 | SKIP_NEXT="YES" |
| 367 | fi |
| 368 | } |
| 369 | |
| 370 | # skip next test if tls1_3 is not available |
| 371 | requires_openssl_tls1_3() { |
| 372 | requires_openssl_next |
| 373 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 374 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 375 | fi |
| 376 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 377 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 378 | then |
| 379 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 380 | else |
| 381 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 382 | fi |
| 383 | fi |
| 384 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 385 | SKIP_NEXT="YES" |
| 386 | fi |
| 387 | } |
| 388 | |
| 389 | # skip next test if tls1_3 is not available |
| 390 | requires_gnutls_tls1_3() { |
| 391 | requires_gnutls_next |
| 392 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 393 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 394 | fi |
| 395 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 396 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 397 | then |
| 398 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 399 | else |
| 400 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 401 | fi |
| 402 | fi |
| 403 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 404 | SKIP_NEXT="YES" |
| 405 | fi |
| 406 | } |
| 407 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 408 | # skip next test if IPv6 isn't available on this host |
| 409 | requires_ipv6() { |
| 410 | if [ -z "${HAS_IPV6:-}" ]; then |
| 411 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 412 | SRV_PID=$! |
| 413 | sleep 1 |
| 414 | kill $SRV_PID >/dev/null 2>&1 |
| 415 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 416 | HAS_IPV6="NO" |
| 417 | else |
| 418 | HAS_IPV6="YES" |
| 419 | fi |
| 420 | rm -r $SRV_OUT |
| 421 | fi |
| 422 | |
| 423 | if [ "$HAS_IPV6" = "NO" ]; then |
| 424 | SKIP_NEXT="YES" |
| 425 | fi |
| 426 | } |
| 427 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 428 | # skip next test if it's i686 or uname is not available |
| 429 | requires_not_i686() { |
| 430 | if [ -z "${IS_I686:-}" ]; then |
| 431 | IS_I686="YES" |
| 432 | if which "uname" >/dev/null 2>&1; then |
| 433 | if [ -z "$(uname -a | grep i686)" ]; then |
| 434 | IS_I686="NO" |
| 435 | fi |
| 436 | fi |
| 437 | fi |
| 438 | if [ "$IS_I686" = "YES" ]; then |
| 439 | SKIP_NEXT="YES" |
| 440 | fi |
| 441 | } |
| 442 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 443 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 444 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 445 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 446 | 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] | 447 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 448 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 449 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 450 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 451 | fi |
| 452 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 453 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 454 | fi |
| 455 | |
| 456 | # skip the next test if the SSL output buffer is less than 16KB |
| 457 | requires_full_size_output_buffer() { |
| 458 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 459 | SKIP_NEXT="YES" |
| 460 | fi |
| 461 | } |
| 462 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 463 | # skip the next test if valgrind is in use |
| 464 | not_with_valgrind() { |
| 465 | if [ "$MEMCHECK" -gt 0 ]; then |
| 466 | SKIP_NEXT="YES" |
| 467 | fi |
| 468 | } |
| 469 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 470 | # skip the next test if valgrind is NOT in use |
| 471 | only_with_valgrind() { |
| 472 | if [ "$MEMCHECK" -eq 0 ]; then |
| 473 | SKIP_NEXT="YES" |
| 474 | fi |
| 475 | } |
| 476 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 477 | # 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] | 478 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 479 | CLI_DELAY_FACTOR=$1 |
| 480 | } |
| 481 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 482 | # wait for the given seconds after the client finished in the next test |
| 483 | server_needs_more_time() { |
| 484 | SRV_DELAY_SECONDS=$1 |
| 485 | } |
| 486 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 487 | # print_name <name> |
| 488 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 489 | TESTS=$(( $TESTS + 1 )) |
| 490 | LINE="" |
| 491 | |
| 492 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 493 | LINE="$TESTS " |
| 494 | fi |
| 495 | |
| 496 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 497 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 498 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 499 | for i in `seq 1 $LEN`; do printf '.'; done |
| 500 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 501 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 502 | } |
| 503 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 504 | # record_outcome <outcome> [<failure-reason>] |
| 505 | # The test name must be in $NAME. |
| 506 | record_outcome() { |
| 507 | echo "$1" |
| 508 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 509 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 510 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 511 | "ssl-opt" "$NAME" \ |
| 512 | "$1" "${2-}" \ |
| 513 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 514 | fi |
| 515 | } |
| 516 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 517 | # fail <message> |
| 518 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 519 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 520 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 521 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 522 | mv $SRV_OUT o-srv-${TESTS}.log |
| 523 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 524 | if [ -n "$PXY_CMD" ]; then |
| 525 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 526 | fi |
| 527 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 528 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 529 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 530 | echo " ! server output:" |
| 531 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 532 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 533 | echo " ! client output:" |
| 534 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 535 | if [ -n "$PXY_CMD" ]; then |
| 536 | echo " ! ========================================================" |
| 537 | echo " ! proxy output:" |
| 538 | cat o-pxy-${TESTS}.log |
| 539 | fi |
| 540 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 541 | fi |
| 542 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 543 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 544 | } |
| 545 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 546 | # is_polar <cmd_line> |
| 547 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 548 | case "$1" in |
| 549 | *ssl_client2*) true;; |
| 550 | *ssl_server2*) true;; |
| 551 | *) false;; |
| 552 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 553 | } |
| 554 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 555 | # openssl s_server doesn't have -www with DTLS |
| 556 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 557 | case "$SRV_CMD" in |
| 558 | *s_server*-dtls*) |
| 559 | NEEDS_INPUT=1 |
| 560 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 561 | *) NEEDS_INPUT=0;; |
| 562 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 563 | } |
| 564 | |
| 565 | # provide input to commands that need it |
| 566 | provide_input() { |
| 567 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 568 | return |
| 569 | fi |
| 570 | |
| 571 | while true; do |
| 572 | echo "HTTP/1.0 200 OK" |
| 573 | sleep 1 |
| 574 | done |
| 575 | } |
| 576 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 577 | # has_mem_err <log_file_name> |
| 578 | has_mem_err() { |
| 579 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 580 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 581 | then |
| 582 | return 1 # false: does not have errors |
| 583 | else |
| 584 | return 0 # true: has errors |
| 585 | fi |
| 586 | } |
| 587 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 588 | # 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] | 589 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 590 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 591 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 592 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 593 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 594 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 595 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 596 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 597 | # Make a tight loop, server normally takes less than 1s to start. |
| 598 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 599 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 600 | echo "$3 START TIMEOUT" |
| 601 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 602 | break |
| 603 | fi |
| 604 | # Linux and *BSD support decimal arguments to sleep. On other |
| 605 | # OSes this may be a tight loop. |
| 606 | sleep 0.1 2>/dev/null || true |
| 607 | done |
| 608 | } |
| 609 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 610 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 611 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 612 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 613 | } |
| 614 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 615 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 616 | # Wait for server process $2 to be listening on port $1. |
| 617 | wait_server_start() { |
| 618 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 619 | } |
| 620 | |
| 621 | # Wait for proxy process $2 to be listening on port $1. |
| 622 | wait_proxy_start() { |
| 623 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 624 | } |
| 625 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 626 | # 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] | 627 | # 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] | 628 | # acceptable bounds |
| 629 | check_server_hello_time() { |
| 630 | # 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] | 631 | 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] | 632 | # Get the Unix timestamp for now |
| 633 | CUR_TIME=$(date +'%s') |
| 634 | THRESHOLD_IN_SECS=300 |
| 635 | |
| 636 | # Check if the ServerHello time was printed |
| 637 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 638 | return 1 |
| 639 | fi |
| 640 | |
| 641 | # Check the time in ServerHello is within acceptable bounds |
| 642 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 643 | # The time in ServerHello is at least 5 minutes before now |
| 644 | return 1 |
| 645 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 646 | # 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] | 647 | return 1 |
| 648 | else |
| 649 | return 0 |
| 650 | fi |
| 651 | } |
| 652 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 653 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 654 | handshake_memory_get() { |
| 655 | OUTPUT_VARIABLE="$1" |
| 656 | OUTPUT_FILE="$2" |
| 657 | |
| 658 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 659 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 660 | |
| 661 | # Check if memory usage was read |
| 662 | if [ -z "$MEM_USAGE" ]; then |
| 663 | echo "Error: Can not read the value of handshake memory usage" |
| 664 | return 1 |
| 665 | else |
| 666 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 667 | return 0 |
| 668 | fi |
| 669 | } |
| 670 | |
| 671 | # Get handshake memory usage from server or client output and check if this value |
| 672 | # is not higher than the maximum given by the first argument |
| 673 | handshake_memory_check() { |
| 674 | MAX_MEMORY="$1" |
| 675 | OUTPUT_FILE="$2" |
| 676 | |
| 677 | # Get memory usage |
| 678 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 679 | return 1 |
| 680 | fi |
| 681 | |
| 682 | # Check if memory usage is below max value |
| 683 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 684 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 685 | "but should be below $MAX_MEMORY bytes" |
| 686 | return 1 |
| 687 | else |
| 688 | return 0 |
| 689 | fi |
| 690 | } |
| 691 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 692 | # wait for client to terminate and set CLI_EXIT |
| 693 | # must be called right after starting the client |
| 694 | wait_client_done() { |
| 695 | CLI_PID=$! |
| 696 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 697 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 698 | CLI_DELAY_FACTOR=1 |
| 699 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 700 | ( 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] | 701 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 702 | |
| 703 | wait $CLI_PID |
| 704 | CLI_EXIT=$? |
| 705 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 706 | kill $DOG_PID >/dev/null 2>&1 |
| 707 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 708 | |
| 709 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 710 | |
| 711 | sleep $SRV_DELAY_SECONDS |
| 712 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 713 | } |
| 714 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 715 | # check if the given command uses dtls and sets global variable DTLS |
| 716 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 717 | case "$1" in |
| 718 | *dtls=1*|-dtls|-u) DTLS=1;; |
| 719 | *) DTLS=0;; |
| 720 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 721 | } |
| 722 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 723 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 724 | is_gnutls() { |
| 725 | case "$1" in |
| 726 | *gnutls-cli*) |
| 727 | CMD_IS_GNUTLS=1 |
| 728 | ;; |
| 729 | *gnutls-serv*) |
| 730 | CMD_IS_GNUTLS=1 |
| 731 | ;; |
| 732 | *) |
| 733 | CMD_IS_GNUTLS=0 |
| 734 | ;; |
| 735 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 736 | } |
| 737 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 738 | # Compare file content |
| 739 | # Usage: find_in_both pattern file1 file2 |
| 740 | # extract from file1 the first line matching the pattern |
| 741 | # check in file2 that the same line can be found |
| 742 | find_in_both() { |
| 743 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 744 | if [ -z "$srv_pattern" ]; then |
| 745 | return 1; |
| 746 | fi |
| 747 | |
| 748 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 749 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 750 | else |
| 751 | return 1; |
| 752 | fi |
| 753 | } |
| 754 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 755 | SKIP_HANDSHAKE_CHECK="NO" |
| 756 | skip_handshake_stage_check() { |
| 757 | SKIP_HANDSHAKE_CHECK="YES" |
| 758 | } |
| 759 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 760 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 761 | # Options: -s pattern pattern that must be present in server output |
| 762 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 763 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 764 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 765 | # -S pattern pattern that must be absent in server output |
| 766 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 767 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 768 | # -F call shell function on server output |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 769 | # -g call shell function on server and client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 770 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 771 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 772 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 773 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 774 | if is_excluded "$NAME"; then |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 775 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 776 | # There was no request to run the test, so don't record its outcome. |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 777 | return |
| 778 | fi |
| 779 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 780 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 781 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 782 | # Do we only run numbered tests? |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 783 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 784 | case ",$RUN_TEST_NUMBER," in |
| 785 | *",$TESTS,"*) :;; |
| 786 | *) SKIP_NEXT="YES";; |
| 787 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 788 | fi |
| 789 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 790 | # does this test use a proxy? |
| 791 | if [ "X$1" = "X-p" ]; then |
| 792 | PXY_CMD="$2" |
| 793 | shift 2 |
| 794 | else |
| 795 | PXY_CMD="" |
| 796 | fi |
| 797 | |
| 798 | # get commands and client output |
| 799 | SRV_CMD="$1" |
| 800 | CLI_CMD="$2" |
| 801 | CLI_EXPECT="$3" |
| 802 | shift 3 |
| 803 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 804 | # Check if test uses files |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 805 | case "$SRV_CMD $CLI_CMD" in |
| 806 | *data_files/*) |
| 807 | requires_config_enabled MBEDTLS_FS_IO;; |
| 808 | esac |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 809 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 810 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 811 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 812 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 813 | |
| 814 | # should we skip? |
| 815 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 816 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 817 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 818 | SKIPS=$(( $SKIPS + 1 )) |
| 819 | return |
| 820 | fi |
| 821 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 822 | # update DTLS variable |
| 823 | detect_dtls "$SRV_CMD" |
| 824 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 825 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 826 | # 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] | 827 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 828 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 829 | case " $SRV_CMD " in |
| 830 | *' server_addr=::1 '*) |
| 831 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 832 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 833 | fi |
| 834 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 835 | # update CMD_IS_GNUTLS variable |
| 836 | is_gnutls "$SRV_CMD" |
| 837 | |
| 838 | # if the server uses gnutls but doesn't set priority, explicitly |
| 839 | # set the default priority |
| 840 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 841 | case "$SRV_CMD" in |
| 842 | *--priority*) :;; |
| 843 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 844 | esac |
| 845 | fi |
| 846 | |
| 847 | # update CMD_IS_GNUTLS variable |
| 848 | is_gnutls "$CLI_CMD" |
| 849 | |
| 850 | # if the client uses gnutls but doesn't set priority, explicitly |
| 851 | # set the default priority |
| 852 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 853 | case "$CLI_CMD" in |
| 854 | *--priority*) :;; |
| 855 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 856 | esac |
| 857 | fi |
| 858 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 859 | # fix client port |
| 860 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 861 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 862 | else |
| 863 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 864 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 865 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 866 | # prepend valgrind to our commands if active |
| 867 | if [ "$MEMCHECK" -gt 0 ]; then |
| 868 | if is_polar "$SRV_CMD"; then |
| 869 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 870 | fi |
| 871 | if is_polar "$CLI_CMD"; then |
| 872 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 873 | fi |
| 874 | fi |
| 875 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 876 | TIMES_LEFT=2 |
| 877 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 878 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 879 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 880 | # run the commands |
| 881 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 882 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 883 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 884 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 885 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 886 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 887 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 888 | check_osrv_dtls |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 889 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 890 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 891 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 892 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 893 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 894 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 895 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 896 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 897 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 898 | sleep 0.05 |
| 899 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 900 | # terminate the server (and the proxy) |
| 901 | kill $SRV_PID |
| 902 | wait $SRV_PID |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 903 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 904 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 905 | if [ -n "$PXY_CMD" ]; then |
| 906 | kill $PXY_PID >/dev/null 2>&1 |
| 907 | wait $PXY_PID |
| 908 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 909 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 910 | # retry only on timeouts |
| 911 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 912 | printf "RETRY " |
| 913 | else |
| 914 | TIMES_LEFT=0 |
| 915 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 916 | done |
| 917 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 918 | # 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] | 919 | # (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] | 920 | # expected client exit to incorrectly succeed in case of catastrophic |
| 921 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 922 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 923 | then |
| 924 | if is_polar "$SRV_CMD"; then |
| 925 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 926 | else |
| 927 | fail "server or client failed to reach handshake stage" |
| 928 | return |
| 929 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 930 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 931 | if is_polar "$CLI_CMD"; then |
| 932 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 933 | else |
| 934 | fail "server or client failed to reach handshake stage" |
| 935 | return |
| 936 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 937 | fi |
| 938 | fi |
| 939 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 940 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 941 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 942 | # exit with status 0 when interrupted by a signal, and we don't really |
| 943 | # care anyway), in case e.g. the server reports a memory leak. |
| 944 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 945 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 946 | return |
| 947 | fi |
| 948 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 949 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 950 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 951 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 952 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 953 | 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] | 954 | return |
| 955 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 956 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 957 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 958 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 959 | # 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] | 960 | while [ $# -gt 0 ] |
| 961 | do |
| 962 | case $1 in |
| 963 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 964 | 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] | 965 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 966 | return |
| 967 | fi |
| 968 | ;; |
| 969 | |
| 970 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 971 | 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] | 972 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 973 | return |
| 974 | fi |
| 975 | ;; |
| 976 | |
| 977 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 978 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 979 | fail "pattern '$2' MUST NOT be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 980 | return |
| 981 | fi |
| 982 | ;; |
| 983 | |
| 984 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 985 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 986 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 987 | return |
| 988 | fi |
| 989 | ;; |
| 990 | |
| 991 | # The filtering in the following two options (-u and -U) do the following |
| 992 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 993 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 994 | # - keep one of each non-unique line |
| 995 | # - count how many lines remain |
| 996 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 997 | # if there were no duplicates. |
| 998 | "-U") |
| 999 | 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 |
| 1000 | fail "lines following pattern '$2' must be unique in Server output" |
| 1001 | return |
| 1002 | fi |
| 1003 | ;; |
| 1004 | |
| 1005 | "-u") |
| 1006 | 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 |
| 1007 | 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] | 1008 | return |
| 1009 | fi |
| 1010 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1011 | "-F") |
| 1012 | if ! $2 "$SRV_OUT"; then |
| 1013 | fail "function call to '$2' failed on Server output" |
| 1014 | return |
| 1015 | fi |
| 1016 | ;; |
| 1017 | "-f") |
| 1018 | if ! $2 "$CLI_OUT"; then |
| 1019 | fail "function call to '$2' failed on Client output" |
| 1020 | return |
| 1021 | fi |
| 1022 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1023 | "-g") |
| 1024 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1025 | fail "function call to '$2' failed on Server and Client output" |
| 1026 | return |
| 1027 | fi |
| 1028 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1029 | |
| 1030 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1031 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1032 | exit 1 |
| 1033 | esac |
| 1034 | shift 2 |
| 1035 | done |
| 1036 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1037 | # check valgrind's results |
| 1038 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1039 | 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] | 1040 | fail "Server has memory errors" |
| 1041 | return |
| 1042 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1043 | 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] | 1044 | fail "Client has memory errors" |
| 1045 | return |
| 1046 | fi |
| 1047 | fi |
| 1048 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1049 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1050 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1051 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1052 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1053 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1054 | if [ -n "$PXY_CMD" ]; then |
| 1055 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1056 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1057 | fi |
| 1058 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1059 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1060 | } |
| 1061 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1062 | run_test_psa() { |
| 1063 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1064 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 1065 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 1066 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1067 | 0 \ |
| 1068 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1069 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1070 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1071 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1072 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1073 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1074 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1075 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1076 | -C "Failed to setup PSA-based cipher context"\ |
| 1077 | -S "Failed to setup PSA-based cipher context"\ |
| 1078 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1079 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1080 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1081 | -S "error" \ |
| 1082 | -C "error" |
| 1083 | } |
| 1084 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1085 | run_test_psa_force_curve() { |
| 1086 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1087 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1088 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1089 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1090 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1091 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1092 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1093 | -c "PSA calc verify" \ |
| 1094 | -c "calc PSA finished" \ |
| 1095 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1096 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1097 | -s "PSA calc verify" \ |
| 1098 | -s "calc PSA finished" \ |
| 1099 | -C "Failed to setup PSA-based cipher context"\ |
| 1100 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1101 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1102 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1103 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1104 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1105 | -C "error" |
| 1106 | } |
| 1107 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1108 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1109 | # a maximum fragment length. |
| 1110 | # first argument ($1) is MFL for SSL client |
| 1111 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1112 | run_test_memory_after_hanshake_with_mfl() |
| 1113 | { |
| 1114 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1115 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1116 | |
| 1117 | # Leave some margin for robustness |
| 1118 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1119 | |
| 1120 | run_test "Handshake memory usage (MFL $1)" \ |
| 1121 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1122 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1123 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1124 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1125 | 0 \ |
| 1126 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1127 | } |
| 1128 | |
| 1129 | |
| 1130 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1131 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1132 | run_tests_memory_after_hanshake() |
| 1133 | { |
| 1134 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1135 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1136 | |
| 1137 | # first test with default MFU is to get reference memory usage |
| 1138 | MEMORY_USAGE_MFL_16K=0 |
| 1139 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1140 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1141 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1142 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1143 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1144 | 0 \ |
| 1145 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1146 | |
| 1147 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1148 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1149 | |
| 1150 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1151 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1152 | |
| 1153 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1154 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1155 | |
| 1156 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1157 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1158 | } |
| 1159 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1160 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1161 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1162 | rm -f context_srv.txt |
| 1163 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1164 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1165 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1166 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1167 | 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] | 1168 | exit 1 |
| 1169 | } |
| 1170 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1171 | # |
| 1172 | # MAIN |
| 1173 | # |
| 1174 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1175 | get_options "$@" |
| 1176 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1177 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1178 | # patterns rather than regular expressions, use a case statement instead |
| 1179 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1180 | # detects simple cases: plain substring, everything, nothing. |
| 1181 | # |
| 1182 | # As an exception, the character '.' is treated as an ordinary character |
| 1183 | # if it is the only special character in the string. This is because it's |
| 1184 | # rare to need "any one character", but needing a literal '.' is common |
| 1185 | # (e.g. '-f "DTLS 1.2"'). |
| 1186 | need_grep= |
| 1187 | case "$FILTER" in |
| 1188 | '^$') simple_filter=;; |
| 1189 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1190 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1191 | need_grep=1;; |
| 1192 | *) # No regexp or shell-pattern special character |
| 1193 | simple_filter="*$FILTER*";; |
| 1194 | esac |
| 1195 | case "$EXCLUDE" in |
| 1196 | '^$') simple_exclude=;; |
| 1197 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1198 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1199 | need_grep=1;; |
| 1200 | *) # No regexp or shell-pattern special character |
| 1201 | simple_exclude="*$EXCLUDE*";; |
| 1202 | esac |
| 1203 | if [ -n "$need_grep" ]; then |
| 1204 | is_excluded () { |
| 1205 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1206 | } |
| 1207 | else |
| 1208 | is_excluded () { |
| 1209 | case "$1" in |
| 1210 | $simple_exclude) true;; |
| 1211 | $simple_filter) false;; |
| 1212 | *) true;; |
| 1213 | esac |
| 1214 | } |
| 1215 | fi |
| 1216 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1217 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1218 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1219 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1220 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1221 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1222 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1223 | exit 1 |
| 1224 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1225 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1226 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1227 | exit 1 |
| 1228 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1229 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1230 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1231 | exit 1 |
| 1232 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1233 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1234 | if which valgrind >/dev/null 2>&1; then :; else |
| 1235 | echo "Memcheck not possible. Valgrind not found" |
| 1236 | exit 1 |
| 1237 | fi |
| 1238 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1239 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1240 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1241 | exit 1 |
| 1242 | fi |
| 1243 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1244 | # used by watchdog |
| 1245 | MAIN_PID="$$" |
| 1246 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1247 | # We use somewhat arbitrary delays for tests: |
| 1248 | # - how long do we wait for the server to start (when lsof not available)? |
| 1249 | # - how long do we allow for the client to finish? |
| 1250 | # (not to check performance, just to avoid waiting indefinitely) |
| 1251 | # Things are slower with valgrind, so give extra time here. |
| 1252 | # |
| 1253 | # Note: without lsof, there is a trade-off between the running time of this |
| 1254 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1255 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1256 | # 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] | 1257 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1258 | START_DELAY=6 |
| 1259 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1260 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1261 | START_DELAY=2 |
| 1262 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1263 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1264 | |
| 1265 | # some particular tests need more time: |
| 1266 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1267 | # - for the server, we sleep for a number of seconds after the client exits |
| 1268 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1269 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1270 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1271 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1272 | # 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] | 1273 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1274 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1275 | 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] | 1276 | 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 | 96f5bae | 2021-04-01 14:00:11 +0200 | [diff] [blame] | 1277 | O_SRV="$O_SRV -accept $SRV_PORT" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1278 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1279 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1280 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1281 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1282 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1283 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1284 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1285 | fi |
| 1286 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1287 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1288 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1289 | fi |
| 1290 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1291 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1292 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1293 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1294 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1295 | # Allow SHA-1, because many of our test certificates use it |
| 1296 | P_SRV="$P_SRV allow_sha1=1" |
| 1297 | P_CLI="$P_CLI allow_sha1=1" |
| 1298 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1299 | # Also pick a unique name for intermediate files |
| 1300 | SRV_OUT="srv_out.$$" |
| 1301 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1302 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1303 | SESSION="session.$$" |
| 1304 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1305 | SKIP_NEXT="NO" |
| 1306 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1307 | trap cleanup INT TERM HUP |
| 1308 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1309 | # Basic test |
| 1310 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1311 | # Checks that: |
| 1312 | # - things work with all ciphersuites active (used with config-full in all.sh) |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1313 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1314 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1315 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1316 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1317 | "$P_CLI" \ |
| 1318 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1319 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1320 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1321 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1322 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1323 | -S "error" \ |
| 1324 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1325 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1326 | run_test "Default, DTLS" \ |
| 1327 | "$P_SRV dtls=1" \ |
| 1328 | "$P_CLI dtls=1" \ |
| 1329 | 0 \ |
| 1330 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1331 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1332 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1333 | run_test "TLS client auth: required" \ |
| 1334 | "$P_SRV auth_mode=required" \ |
| 1335 | "$P_CLI" \ |
| 1336 | 0 \ |
| 1337 | -s "Verifying peer X.509 certificate... ok" |
| 1338 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1339 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1340 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1341 | requires_config_enabled MBEDTLS_SHA256_C |
| 1342 | run_test "TLS: password protected client key" \ |
| 1343 | "$P_SRV auth_mode=required" \ |
| 1344 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1345 | 0 |
| 1346 | |
| 1347 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1348 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1349 | requires_config_enabled MBEDTLS_SHA256_C |
| 1350 | run_test "TLS: password protected server key" \ |
| 1351 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1352 | "$P_CLI" \ |
| 1353 | 0 |
| 1354 | |
| 1355 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1356 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1357 | requires_config_enabled MBEDTLS_RSA_C |
| 1358 | requires_config_enabled MBEDTLS_SHA256_C |
| 1359 | run_test "TLS: password protected server key, two certificates" \ |
| 1360 | "$P_SRV \ |
| 1361 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1362 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1363 | "$P_CLI" \ |
| 1364 | 0 |
| 1365 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1366 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1367 | run_test "CA callback on client" \ |
| 1368 | "$P_SRV debug_level=3" \ |
| 1369 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1370 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1371 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1372 | -S "error" \ |
| 1373 | -C "error" |
| 1374 | |
| 1375 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1376 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1377 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1378 | requires_config_enabled MBEDTLS_SHA256_C |
| 1379 | run_test "CA callback on server" \ |
| 1380 | "$P_SRV auth_mode=required" \ |
| 1381 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1382 | key_file=data_files/server5.key" \ |
| 1383 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1384 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1385 | -s "Verifying peer X.509 certificate... ok" \ |
| 1386 | -S "error" \ |
| 1387 | -C "error" |
| 1388 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1389 | # Test using an opaque private key for client authentication |
| 1390 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1391 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1392 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1393 | requires_config_enabled MBEDTLS_SHA256_C |
| 1394 | run_test "Opaque key for client authentication" \ |
| 1395 | "$P_SRV auth_mode=required" \ |
| 1396 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1397 | key_file=data_files/server5.key" \ |
| 1398 | 0 \ |
| 1399 | -c "key type: Opaque" \ |
| 1400 | -s "Verifying peer X.509 certificate... ok" \ |
| 1401 | -S "error" \ |
| 1402 | -C "error" |
| 1403 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1404 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1405 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1406 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1407 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1408 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1409 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1410 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1411 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1412 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1413 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1414 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1415 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1416 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1417 | run_test_psa_force_curve "secp521r1" |
| 1418 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1419 | run_test_psa_force_curve "brainpoolP512r1" |
| 1420 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1421 | run_test_psa_force_curve "secp384r1" |
| 1422 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1423 | run_test_psa_force_curve "brainpoolP384r1" |
| 1424 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1425 | run_test_psa_force_curve "secp256r1" |
| 1426 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1427 | run_test_psa_force_curve "secp256k1" |
| 1428 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1429 | run_test_psa_force_curve "brainpoolP256r1" |
| 1430 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1431 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1432 | ## SECP224K1 is buggy via the PSA API |
| 1433 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1434 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1435 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1436 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1437 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1438 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1439 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1440 | run_test_psa_force_curve "secp192r1" |
| 1441 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1442 | run_test_psa_force_curve "secp192k1" |
| 1443 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1444 | # Test current time in ServerHello |
| 1445 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1446 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1447 | "$P_SRV debug_level=3" \ |
| 1448 | "$P_CLI debug_level=3" \ |
| 1449 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1450 | -f "check_server_hello_time" \ |
| 1451 | -F "check_server_hello_time" |
| 1452 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1453 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1454 | run_test "Unique IV in GCM" \ |
| 1455 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1456 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1457 | 0 \ |
| 1458 | -u "IV used" \ |
| 1459 | -U "IV used" |
| 1460 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1461 | # Tests for certificate verification callback |
| 1462 | run_test "Configuration-specific CRT verification callback" \ |
| 1463 | "$P_SRV debug_level=3" \ |
| 1464 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1465 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1466 | -S "error" \ |
| 1467 | -c "Verify requested for " \ |
| 1468 | -c "Use configuration-specific verification callback" \ |
| 1469 | -C "Use context-specific verification callback" \ |
| 1470 | -C "error" |
| 1471 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1472 | run_test "Context-specific CRT verification callback" \ |
| 1473 | "$P_SRV debug_level=3" \ |
| 1474 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1475 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1476 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1477 | -c "Verify requested for " \ |
| 1478 | -c "Use context-specific verification callback" \ |
| 1479 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1480 | -C "error" |
| 1481 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1482 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1483 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1484 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1485 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1486 | 1 \ |
| 1487 | -c "The certificate is signed with an unacceptable hash" |
| 1488 | |
| 1489 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1490 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1491 | "$P_CLI allow_sha1=1" \ |
| 1492 | 0 |
| 1493 | |
| 1494 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1495 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1496 | "$P_CLI allow_sha1=0" \ |
| 1497 | 0 |
| 1498 | |
| 1499 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1500 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1501 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1502 | 1 \ |
| 1503 | -s "The certificate is signed with an unacceptable hash" |
| 1504 | |
| 1505 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1506 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1507 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1508 | 0 |
| 1509 | |
| 1510 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1511 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1512 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1513 | 0 |
| 1514 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1515 | # Dummy TLS 1.3 test |
| 1516 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1517 | # ssl_client2/ssl_server2 example programs works. |
| 1518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1519 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1520 | "$P_SRV tls13_kex_modes=psk" \ |
| 1521 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1522 | 0 |
| 1523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1524 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1525 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1526 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1527 | 0 |
| 1528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1529 | run_test "TLS 1.3, key exchange mode parameter passing: Pure-ephemeral only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1530 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1531 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1532 | 0 |
| 1533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1534 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1535 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1536 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1537 | 0 |
| 1538 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1539 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1540 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1541 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1542 | 0 |
| 1543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1544 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1545 | "$P_SRV tls13_kex_modes=all" \ |
| 1546 | "$P_CLI tls13_kex_modes=all" \ |
| 1547 | 0 |
| 1548 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1549 | # Tests for datagram packing |
| 1550 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1551 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1552 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1553 | 0 \ |
| 1554 | -c "next record in same datagram" \ |
| 1555 | -s "next record in same datagram" |
| 1556 | |
| 1557 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1558 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1559 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1560 | 0 \ |
| 1561 | -s "next record in same datagram" \ |
| 1562 | -C "next record in same datagram" |
| 1563 | |
| 1564 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1565 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1566 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1567 | 0 \ |
| 1568 | -S "next record in same datagram" \ |
| 1569 | -c "next record in same datagram" |
| 1570 | |
| 1571 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1572 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1573 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1574 | 0 \ |
| 1575 | -S "next record in same datagram" \ |
| 1576 | -C "next record in same datagram" |
| 1577 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1578 | # Tests for Context serialization |
| 1579 | |
| 1580 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1581 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1582 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1583 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1584 | 0 \ |
| 1585 | -c "Deserializing connection..." \ |
| 1586 | -S "Deserializing connection..." |
| 1587 | |
| 1588 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1589 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1590 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1591 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1592 | 0 \ |
| 1593 | -c "Deserializing connection..." \ |
| 1594 | -S "Deserializing connection..." |
| 1595 | |
| 1596 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1597 | run_test "Context serialization, client serializes, GCM" \ |
| 1598 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1599 | "$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] | 1600 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1601 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1602 | -S "Deserializing connection..." |
| 1603 | |
| 1604 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1605 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1606 | run_test "Context serialization, client serializes, with CID" \ |
| 1607 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1608 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1609 | 0 \ |
| 1610 | -c "Deserializing connection..." \ |
| 1611 | -S "Deserializing connection..." |
| 1612 | |
| 1613 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1614 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1615 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1616 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1617 | 0 \ |
| 1618 | -C "Deserializing connection..." \ |
| 1619 | -s "Deserializing connection..." |
| 1620 | |
| 1621 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1622 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1623 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1624 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1625 | 0 \ |
| 1626 | -C "Deserializing connection..." \ |
| 1627 | -s "Deserializing connection..." |
| 1628 | |
| 1629 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1630 | run_test "Context serialization, server serializes, GCM" \ |
| 1631 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1632 | "$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] | 1633 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1634 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1635 | -s "Deserializing connection..." |
| 1636 | |
| 1637 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1638 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1639 | run_test "Context serialization, server serializes, with CID" \ |
| 1640 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1641 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1642 | 0 \ |
| 1643 | -C "Deserializing connection..." \ |
| 1644 | -s "Deserializing connection..." |
| 1645 | |
| 1646 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1647 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1648 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1649 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1650 | 0 \ |
| 1651 | -c "Deserializing connection..." \ |
| 1652 | -s "Deserializing connection..." |
| 1653 | |
| 1654 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1655 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1656 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1657 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1658 | 0 \ |
| 1659 | -c "Deserializing connection..." \ |
| 1660 | -s "Deserializing connection..." |
| 1661 | |
| 1662 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1663 | run_test "Context serialization, both serialize, GCM" \ |
| 1664 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1665 | "$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] | 1666 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1667 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1668 | -s "Deserializing connection..." |
| 1669 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1670 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1671 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1672 | run_test "Context serialization, both serialize, with CID" \ |
| 1673 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1674 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1675 | 0 \ |
| 1676 | -c "Deserializing connection..." \ |
| 1677 | -s "Deserializing connection..." |
| 1678 | |
| 1679 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1680 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1681 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1682 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1683 | 0 \ |
| 1684 | -c "Deserializing connection..." \ |
| 1685 | -S "Deserializing connection..." |
| 1686 | |
| 1687 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1688 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1689 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1690 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1691 | 0 \ |
| 1692 | -c "Deserializing connection..." \ |
| 1693 | -S "Deserializing connection..." |
| 1694 | |
| 1695 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1696 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1697 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1698 | "$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] | 1699 | 0 \ |
| 1700 | -c "Deserializing connection..." \ |
| 1701 | -S "Deserializing connection..." |
| 1702 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1703 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1704 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1705 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1706 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1707 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1708 | 0 \ |
| 1709 | -c "Deserializing connection..." \ |
| 1710 | -S "Deserializing connection..." |
| 1711 | |
| 1712 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1713 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1714 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1715 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1716 | 0 \ |
| 1717 | -C "Deserializing connection..." \ |
| 1718 | -s "Deserializing connection..." |
| 1719 | |
| 1720 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1721 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1722 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1723 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1724 | 0 \ |
| 1725 | -C "Deserializing connection..." \ |
| 1726 | -s "Deserializing connection..." |
| 1727 | |
| 1728 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1729 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1730 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1731 | "$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] | 1732 | 0 \ |
| 1733 | -C "Deserializing connection..." \ |
| 1734 | -s "Deserializing connection..." |
| 1735 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1736 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1737 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1738 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1739 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1740 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1741 | 0 \ |
| 1742 | -C "Deserializing connection..." \ |
| 1743 | -s "Deserializing connection..." |
| 1744 | |
| 1745 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1746 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1747 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1748 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1749 | 0 \ |
| 1750 | -c "Deserializing connection..." \ |
| 1751 | -s "Deserializing connection..." |
| 1752 | |
| 1753 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1754 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1755 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1756 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1757 | 0 \ |
| 1758 | -c "Deserializing connection..." \ |
| 1759 | -s "Deserializing connection..." |
| 1760 | |
| 1761 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1762 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1763 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1764 | "$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] | 1765 | 0 \ |
| 1766 | -c "Deserializing connection..." \ |
| 1767 | -s "Deserializing connection..." |
| 1768 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1769 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1770 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1771 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1772 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1773 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1774 | 0 \ |
| 1775 | -c "Deserializing connection..." \ |
| 1776 | -s "Deserializing connection..." |
| 1777 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1778 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1779 | run_test "Saving the serialized context to a file" \ |
| 1780 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1781 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1782 | 0 \ |
| 1783 | -s "Save serialized context to a file... ok" \ |
| 1784 | -c "Save serialized context to a file... ok" |
| 1785 | rm -f context_srv.txt |
| 1786 | rm -f context_cli.txt |
| 1787 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1788 | # Tests for DTLS Connection ID extension |
| 1789 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1790 | # So far, the CID API isn't implemented, so we can't |
| 1791 | # grep for output witnessing its use. This needs to be |
| 1792 | # changed once the CID extension is implemented. |
| 1793 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1794 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1795 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1796 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1797 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1798 | 0 \ |
| 1799 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1800 | -s "found CID extension" \ |
| 1801 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1802 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1803 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1804 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1805 | -C "found CID extension" \ |
| 1806 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1807 | -C "Copy CIDs into SSL transform" \ |
| 1808 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1809 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1810 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1811 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1812 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1813 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1814 | 0 \ |
| 1815 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1816 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1817 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1818 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1819 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1820 | -C "found CID extension" \ |
| 1821 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1822 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1823 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1824 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1825 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1826 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1827 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1828 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1829 | 0 \ |
| 1830 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1831 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1832 | -c "client hello, adding CID extension" \ |
| 1833 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1834 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1835 | -s "server hello, adding CID extension" \ |
| 1836 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1837 | -c "Use of CID extension negotiated" \ |
| 1838 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1839 | -c "Copy CIDs into SSL transform" \ |
| 1840 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1841 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1842 | -s "Use of Connection ID has been negotiated" \ |
| 1843 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1844 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1845 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1846 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1847 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1848 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1849 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1850 | 0 \ |
| 1851 | -c "Enable use of CID extension." \ |
| 1852 | -s "Enable use of CID extension." \ |
| 1853 | -c "client hello, adding CID extension" \ |
| 1854 | -s "found CID extension" \ |
| 1855 | -s "Use of CID extension negotiated" \ |
| 1856 | -s "server hello, adding CID extension" \ |
| 1857 | -c "found CID extension" \ |
| 1858 | -c "Use of CID extension negotiated" \ |
| 1859 | -s "Copy CIDs into SSL transform" \ |
| 1860 | -c "Copy CIDs into SSL transform" \ |
| 1861 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1862 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1863 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1864 | -c "Use of Connection ID has been negotiated" \ |
| 1865 | -c "ignoring unexpected CID" \ |
| 1866 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1867 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1868 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1869 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1870 | -p "$P_PXY mtu=800" \ |
| 1871 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1872 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1873 | 0 \ |
| 1874 | -c "Enable use of CID extension." \ |
| 1875 | -s "Enable use of CID extension." \ |
| 1876 | -c "client hello, adding CID extension" \ |
| 1877 | -s "found CID extension" \ |
| 1878 | -s "Use of CID extension negotiated" \ |
| 1879 | -s "server hello, adding CID extension" \ |
| 1880 | -c "found CID extension" \ |
| 1881 | -c "Use of CID extension negotiated" \ |
| 1882 | -s "Copy CIDs into SSL transform" \ |
| 1883 | -c "Copy CIDs into SSL transform" \ |
| 1884 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1885 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1886 | -s "Use of Connection ID has been negotiated" \ |
| 1887 | -c "Use of Connection ID has been negotiated" |
| 1888 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1889 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1890 | 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] | 1891 | -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] | 1892 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1893 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1894 | 0 \ |
| 1895 | -c "Enable use of CID extension." \ |
| 1896 | -s "Enable use of CID extension." \ |
| 1897 | -c "client hello, adding CID extension" \ |
| 1898 | -s "found CID extension" \ |
| 1899 | -s "Use of CID extension negotiated" \ |
| 1900 | -s "server hello, adding CID extension" \ |
| 1901 | -c "found CID extension" \ |
| 1902 | -c "Use of CID extension negotiated" \ |
| 1903 | -s "Copy CIDs into SSL transform" \ |
| 1904 | -c "Copy CIDs into SSL transform" \ |
| 1905 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1906 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1907 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1908 | -c "Use of Connection ID has been negotiated" \ |
| 1909 | -c "ignoring unexpected CID" \ |
| 1910 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1911 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1912 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1913 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1914 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1915 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1916 | 0 \ |
| 1917 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1918 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1919 | -c "client hello, adding CID extension" \ |
| 1920 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1921 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1922 | -s "server hello, adding CID extension" \ |
| 1923 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1924 | -c "Use of CID extension negotiated" \ |
| 1925 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1926 | -c "Copy CIDs into SSL transform" \ |
| 1927 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1928 | -s "Peer CID (length 0 Bytes):" \ |
| 1929 | -s "Use of Connection ID has been negotiated" \ |
| 1930 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1931 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1932 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1933 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1934 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1935 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1936 | 0 \ |
| 1937 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1938 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1939 | -c "client hello, adding CID extension" \ |
| 1940 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1941 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1942 | -s "server hello, adding CID extension" \ |
| 1943 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1944 | -c "Use of CID extension negotiated" \ |
| 1945 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1946 | -c "Copy CIDs into SSL transform" \ |
| 1947 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1948 | -c "Peer CID (length 0 Bytes):" \ |
| 1949 | -s "Use of Connection ID has been negotiated" \ |
| 1950 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1951 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1952 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1953 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1954 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1955 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1956 | 0 \ |
| 1957 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1958 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1959 | -c "client hello, adding CID extension" \ |
| 1960 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1961 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1962 | -s "server hello, adding CID extension" \ |
| 1963 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1964 | -c "Use of CID extension negotiated" \ |
| 1965 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1966 | -c "Copy CIDs into SSL transform" \ |
| 1967 | -S "Use of Connection ID has been negotiated" \ |
| 1968 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1969 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1971 | 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] | 1972 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1973 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1974 | 0 \ |
| 1975 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1976 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1977 | -c "client hello, adding CID extension" \ |
| 1978 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1979 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1980 | -s "server hello, adding CID extension" \ |
| 1981 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1982 | -c "Use of CID extension negotiated" \ |
| 1983 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1984 | -c "Copy CIDs into SSL transform" \ |
| 1985 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1986 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1987 | -s "Use of Connection ID has been negotiated" \ |
| 1988 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1989 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1990 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1991 | 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] | 1992 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1993 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1994 | 0 \ |
| 1995 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1996 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1997 | -c "client hello, adding CID extension" \ |
| 1998 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1999 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2000 | -s "server hello, adding CID extension" \ |
| 2001 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2002 | -c "Use of CID extension negotiated" \ |
| 2003 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2004 | -c "Copy CIDs into SSL transform" \ |
| 2005 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2006 | -s "Peer CID (length 0 Bytes):" \ |
| 2007 | -s "Use of Connection ID has been negotiated" \ |
| 2008 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2009 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2010 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2011 | 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] | 2012 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2013 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2014 | 0 \ |
| 2015 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2016 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2017 | -c "client hello, adding CID extension" \ |
| 2018 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2019 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2020 | -s "server hello, adding CID extension" \ |
| 2021 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2022 | -c "Use of CID extension negotiated" \ |
| 2023 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2024 | -c "Copy CIDs into SSL transform" \ |
| 2025 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2026 | -c "Peer CID (length 0 Bytes):" \ |
| 2027 | -s "Use of Connection ID has been negotiated" \ |
| 2028 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2029 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2030 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2031 | 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] | 2032 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2033 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2034 | 0 \ |
| 2035 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2036 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2037 | -c "client hello, adding CID extension" \ |
| 2038 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2039 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2040 | -s "server hello, adding CID extension" \ |
| 2041 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2042 | -c "Use of CID extension negotiated" \ |
| 2043 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2044 | -c "Copy CIDs into SSL transform" \ |
| 2045 | -S "Use of Connection ID has been negotiated" \ |
| 2046 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2047 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2048 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2049 | 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] | 2050 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2051 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2052 | 0 \ |
| 2053 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2054 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2055 | -c "client hello, adding CID extension" \ |
| 2056 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2057 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2058 | -s "server hello, adding CID extension" \ |
| 2059 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2060 | -c "Use of CID extension negotiated" \ |
| 2061 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2062 | -c "Copy CIDs into SSL transform" \ |
| 2063 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2064 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2065 | -s "Use of Connection ID has been negotiated" \ |
| 2066 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2067 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2068 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2069 | 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] | 2070 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2071 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2072 | 0 \ |
| 2073 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2074 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2075 | -c "client hello, adding CID extension" \ |
| 2076 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2077 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2078 | -s "server hello, adding CID extension" \ |
| 2079 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2080 | -c "Use of CID extension negotiated" \ |
| 2081 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2082 | -c "Copy CIDs into SSL transform" \ |
| 2083 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2084 | -s "Peer CID (length 0 Bytes):" \ |
| 2085 | -s "Use of Connection ID has been negotiated" \ |
| 2086 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2087 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2088 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2089 | 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] | 2090 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2091 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2092 | 0 \ |
| 2093 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2094 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2095 | -c "client hello, adding CID extension" \ |
| 2096 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2097 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2098 | -s "server hello, adding CID extension" \ |
| 2099 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2100 | -c "Use of CID extension negotiated" \ |
| 2101 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2102 | -c "Copy CIDs into SSL transform" \ |
| 2103 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2104 | -c "Peer CID (length 0 Bytes):" \ |
| 2105 | -s "Use of Connection ID has been negotiated" \ |
| 2106 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2107 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2108 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2109 | 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] | 2110 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2111 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2112 | 0 \ |
| 2113 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2114 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2115 | -c "client hello, adding CID extension" \ |
| 2116 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2117 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2118 | -s "server hello, adding CID extension" \ |
| 2119 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2120 | -c "Use of CID extension negotiated" \ |
| 2121 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2122 | -c "Copy CIDs into SSL transform" \ |
| 2123 | -S "Use of Connection ID has been negotiated" \ |
| 2124 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2125 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2126 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2127 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2128 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2129 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2130 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2131 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2132 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2133 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2134 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2135 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2136 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2137 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2138 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2139 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2140 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2141 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2142 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2143 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2144 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2145 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2146 | 0 \ |
| 2147 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2148 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2149 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2150 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2151 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2152 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2153 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2154 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2155 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2156 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2157 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2158 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2159 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2160 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2161 | 0 \ |
| 2162 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2163 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2164 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2165 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2166 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2167 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2168 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2169 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2170 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2171 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2172 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2173 | 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] | 2174 | -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] | 2175 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2176 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2177 | 0 \ |
| 2178 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2179 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2180 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2181 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2182 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2183 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2184 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2185 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2186 | -c "ignoring unexpected CID" \ |
| 2187 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2188 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2189 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2190 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2191 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2192 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2193 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2194 | 0 \ |
| 2195 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2196 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2197 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2198 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2199 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2200 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2201 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2202 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2203 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2204 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2205 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2206 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2207 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2208 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2209 | 0 \ |
| 2210 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2211 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2212 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2213 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2214 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2215 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2216 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2217 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2218 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2219 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2221 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2222 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2223 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2224 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2225 | 0 \ |
| 2226 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2227 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2228 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2229 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2230 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2231 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2232 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2233 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2234 | -c "ignoring unexpected CID" \ |
| 2235 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +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 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2239 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2240 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2241 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2242 | 0 \ |
| 2243 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2244 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2245 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2246 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2247 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2248 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2249 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2250 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2251 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2252 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2253 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2254 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2255 | 0 \ |
| 2256 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2257 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2258 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2259 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2260 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2261 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2262 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2263 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2264 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2265 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2266 | -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] | 2267 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2268 | "$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" \ |
| 2269 | 0 \ |
| 2270 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2271 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2272 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2273 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2274 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2275 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2276 | -c "ignoring unexpected CID" \ |
| 2277 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2278 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2279 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2280 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2281 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2282 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2283 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2284 | 0 \ |
| 2285 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2286 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2287 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2288 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2289 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2290 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2291 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2292 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2293 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2294 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +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, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2298 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2299 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2300 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2301 | 0 \ |
| 2302 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2303 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2304 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2305 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2306 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2307 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2308 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2309 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2310 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2311 | -c "ignoring unexpected CID" \ |
| 2312 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2313 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2314 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2315 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2316 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2317 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2318 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2319 | 0 \ |
| 2320 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2321 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2322 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2323 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2324 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2325 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2326 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2327 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2328 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2329 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2332 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2333 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2334 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2335 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2336 | 0 \ |
| 2337 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2338 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2339 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2340 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2341 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2342 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2343 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2344 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2345 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2346 | -c "ignoring unexpected CID" \ |
| 2347 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2348 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2349 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2350 | # tests check that the buffer contents are reallocated when the message is |
| 2351 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2352 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2353 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2354 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2355 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2356 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2357 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2358 | 0 \ |
| 2359 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2360 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2361 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2362 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2363 | -s "Reallocating in_buf" \ |
| 2364 | -s "Reallocating out_buf" |
| 2365 | |
| 2366 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2367 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2368 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2369 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2370 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2371 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2372 | 0 \ |
| 2373 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2374 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2375 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2376 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2377 | -s "Reallocating in_buf" \ |
| 2378 | -s "Reallocating out_buf" |
| 2379 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2380 | # Tests for Encrypt-then-MAC extension |
| 2381 | |
| 2382 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2383 | "$P_SRV debug_level=3 \ |
| 2384 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2385 | "$P_CLI debug_level=3" \ |
| 2386 | 0 \ |
| 2387 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2388 | -s "found encrypt then mac extension" \ |
| 2389 | -s "server hello, adding encrypt then mac extension" \ |
| 2390 | -c "found encrypt_then_mac extension" \ |
| 2391 | -c "using encrypt then mac" \ |
| 2392 | -s "using encrypt then mac" |
| 2393 | |
| 2394 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2395 | "$P_SRV debug_level=3 etm=0 \ |
| 2396 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2397 | "$P_CLI debug_level=3 etm=1" \ |
| 2398 | 0 \ |
| 2399 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2400 | -s "found encrypt then mac extension" \ |
| 2401 | -S "server hello, adding encrypt then mac extension" \ |
| 2402 | -C "found encrypt_then_mac extension" \ |
| 2403 | -C "using encrypt then mac" \ |
| 2404 | -S "using encrypt then mac" |
| 2405 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2406 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2407 | "$P_SRV debug_level=3 etm=1 \ |
| 2408 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2409 | "$P_CLI debug_level=3 etm=1" \ |
| 2410 | 0 \ |
| 2411 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2412 | -s "found encrypt then mac extension" \ |
| 2413 | -S "server hello, adding encrypt then mac extension" \ |
| 2414 | -C "found encrypt_then_mac extension" \ |
| 2415 | -C "using encrypt then mac" \ |
| 2416 | -S "using encrypt then mac" |
| 2417 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2418 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2419 | "$P_SRV debug_level=3 etm=1 \ |
| 2420 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2421 | "$P_CLI debug_level=3 etm=0" \ |
| 2422 | 0 \ |
| 2423 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2424 | -S "found encrypt then mac extension" \ |
| 2425 | -S "server hello, adding encrypt then mac extension" \ |
| 2426 | -C "found encrypt_then_mac extension" \ |
| 2427 | -C "using encrypt then mac" \ |
| 2428 | -S "using encrypt then mac" |
| 2429 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2430 | # Tests for Extended Master Secret extension |
| 2431 | |
| 2432 | run_test "Extended Master Secret: default" \ |
| 2433 | "$P_SRV debug_level=3" \ |
| 2434 | "$P_CLI debug_level=3" \ |
| 2435 | 0 \ |
| 2436 | -c "client hello, adding extended_master_secret extension" \ |
| 2437 | -s "found extended master secret extension" \ |
| 2438 | -s "server hello, adding extended master secret extension" \ |
| 2439 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2440 | -c "session hash for extended master secret" \ |
| 2441 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2442 | |
| 2443 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2444 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2445 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2446 | 0 \ |
| 2447 | -c "client hello, adding extended_master_secret extension" \ |
| 2448 | -s "found extended master secret extension" \ |
| 2449 | -S "server hello, adding extended master secret extension" \ |
| 2450 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2451 | -C "session hash for extended master secret" \ |
| 2452 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2453 | |
| 2454 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2455 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2456 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2457 | 0 \ |
| 2458 | -C "client hello, adding extended_master_secret extension" \ |
| 2459 | -S "found extended master secret extension" \ |
| 2460 | -S "server hello, adding extended master secret extension" \ |
| 2461 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2462 | -C "session hash for extended master secret" \ |
| 2463 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2464 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2465 | # Test sending and receiving empty application data records |
| 2466 | |
| 2467 | run_test "Encrypt then MAC: empty application data record" \ |
| 2468 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2469 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2470 | 0 \ |
| 2471 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2472 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2473 | -c "0 bytes written in 1 fragments" |
| 2474 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2475 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2476 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2477 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2478 | 0 \ |
| 2479 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2480 | -c "0 bytes written in 1 fragments" |
| 2481 | |
| 2482 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2483 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2484 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2485 | 0 \ |
| 2486 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2487 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2488 | -c "0 bytes written in 1 fragments" |
| 2489 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2490 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2491 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2492 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2493 | 0 \ |
| 2494 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2495 | -c "0 bytes written in 1 fragments" |
| 2496 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2497 | # Tests for CBC 1/n-1 record splitting |
| 2498 | |
| 2499 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2500 | "$P_SRV" \ |
| 2501 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2502 | request_size=123 force_version=tls1_2" \ |
| 2503 | 0 \ |
| 2504 | -s "Read from client: 123 bytes read" \ |
| 2505 | -S "Read from client: 1 bytes read" \ |
| 2506 | -S "122 bytes read" |
| 2507 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2508 | # Tests for Session Tickets |
| 2509 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2510 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2511 | "$P_SRV debug_level=3 tickets=1" \ |
| 2512 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2513 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2514 | -c "client hello, adding session ticket extension" \ |
| 2515 | -s "found session ticket extension" \ |
| 2516 | -s "server hello, adding session ticket extension" \ |
| 2517 | -c "found session_ticket extension" \ |
| 2518 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2519 | -S "session successfully restored from cache" \ |
| 2520 | -s "session successfully restored from ticket" \ |
| 2521 | -s "a session has been resumed" \ |
| 2522 | -c "a session has been resumed" |
| 2523 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2524 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2525 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2526 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2527 | 0 \ |
| 2528 | -c "client hello, adding session ticket extension" \ |
| 2529 | -s "found session ticket extension" \ |
| 2530 | -s "server hello, adding session ticket extension" \ |
| 2531 | -c "found session_ticket extension" \ |
| 2532 | -c "parse new session ticket" \ |
| 2533 | -S "session successfully restored from cache" \ |
| 2534 | -s "session successfully restored from ticket" \ |
| 2535 | -s "a session has been resumed" \ |
| 2536 | -c "a session has been resumed" |
| 2537 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2538 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2539 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2540 | "$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] | 2541 | 0 \ |
| 2542 | -c "client hello, adding session ticket extension" \ |
| 2543 | -s "found session ticket extension" \ |
| 2544 | -s "server hello, adding session ticket extension" \ |
| 2545 | -c "found session_ticket extension" \ |
| 2546 | -c "parse new session ticket" \ |
| 2547 | -S "session successfully restored from cache" \ |
| 2548 | -S "session successfully restored from ticket" \ |
| 2549 | -S "a session has been resumed" \ |
| 2550 | -C "a session has been resumed" |
| 2551 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2552 | run_test "Session resume using tickets: session copy" \ |
| 2553 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2554 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2555 | 0 \ |
| 2556 | -c "client hello, adding session ticket extension" \ |
| 2557 | -s "found session ticket extension" \ |
| 2558 | -s "server hello, adding session ticket extension" \ |
| 2559 | -c "found session_ticket extension" \ |
| 2560 | -c "parse new session ticket" \ |
| 2561 | -S "session successfully restored from cache" \ |
| 2562 | -s "session successfully restored from ticket" \ |
| 2563 | -s "a session has been resumed" \ |
| 2564 | -c "a session has been resumed" |
| 2565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2566 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2567 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2568 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2569 | 0 \ |
| 2570 | -c "client hello, adding session ticket extension" \ |
| 2571 | -c "found session_ticket extension" \ |
| 2572 | -c "parse new session ticket" \ |
| 2573 | -c "a session has been resumed" |
| 2574 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2575 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2576 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2577 | "( $O_CLI -sess_out $SESSION; \ |
| 2578 | $O_CLI -sess_in $SESSION; \ |
| 2579 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2580 | 0 \ |
| 2581 | -s "found session ticket extension" \ |
| 2582 | -s "server hello, adding session ticket extension" \ |
| 2583 | -S "session successfully restored from cache" \ |
| 2584 | -s "session successfully restored from ticket" \ |
| 2585 | -s "a session has been resumed" |
| 2586 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2587 | # Tests for Session Tickets with DTLS |
| 2588 | |
| 2589 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2590 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2591 | "$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] | 2592 | 0 \ |
| 2593 | -c "client hello, adding session ticket extension" \ |
| 2594 | -s "found session ticket extension" \ |
| 2595 | -s "server hello, adding session ticket extension" \ |
| 2596 | -c "found session_ticket extension" \ |
| 2597 | -c "parse new session ticket" \ |
| 2598 | -S "session successfully restored from cache" \ |
| 2599 | -s "session successfully restored from ticket" \ |
| 2600 | -s "a session has been resumed" \ |
| 2601 | -c "a session has been resumed" |
| 2602 | |
| 2603 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2604 | "$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] | 2605 | "$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] | 2606 | 0 \ |
| 2607 | -c "client hello, adding session ticket extension" \ |
| 2608 | -s "found session ticket extension" \ |
| 2609 | -s "server hello, adding session ticket extension" \ |
| 2610 | -c "found session_ticket extension" \ |
| 2611 | -c "parse new session ticket" \ |
| 2612 | -S "session successfully restored from cache" \ |
| 2613 | -s "session successfully restored from ticket" \ |
| 2614 | -s "a session has been resumed" \ |
| 2615 | -c "a session has been resumed" |
| 2616 | |
| 2617 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2618 | "$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] | 2619 | "$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] | 2620 | 0 \ |
| 2621 | -c "client hello, adding session ticket extension" \ |
| 2622 | -s "found session ticket extension" \ |
| 2623 | -s "server hello, adding session ticket extension" \ |
| 2624 | -c "found session_ticket extension" \ |
| 2625 | -c "parse new session ticket" \ |
| 2626 | -S "session successfully restored from cache" \ |
| 2627 | -S "session successfully restored from ticket" \ |
| 2628 | -S "a session has been resumed" \ |
| 2629 | -C "a session has been resumed" |
| 2630 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2631 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2632 | "$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] | 2633 | "$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] | 2634 | 0 \ |
| 2635 | -c "client hello, adding session ticket extension" \ |
| 2636 | -s "found session ticket extension" \ |
| 2637 | -s "server hello, adding session ticket extension" \ |
| 2638 | -c "found session_ticket extension" \ |
| 2639 | -c "parse new session ticket" \ |
| 2640 | -S "session successfully restored from cache" \ |
| 2641 | -s "session successfully restored from ticket" \ |
| 2642 | -s "a session has been resumed" \ |
| 2643 | -c "a session has been resumed" |
| 2644 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2645 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2646 | "$O_SRV -dtls" \ |
| 2647 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2648 | 0 \ |
| 2649 | -c "client hello, adding session ticket extension" \ |
| 2650 | -c "found session_ticket extension" \ |
| 2651 | -c "parse new session ticket" \ |
| 2652 | -c "a session has been resumed" |
| 2653 | |
| 2654 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2655 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2656 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2657 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2658 | rm -f $SESSION )" \ |
| 2659 | 0 \ |
| 2660 | -s "found session ticket extension" \ |
| 2661 | -s "server hello, adding session ticket extension" \ |
| 2662 | -S "session successfully restored from cache" \ |
| 2663 | -s "session successfully restored from ticket" \ |
| 2664 | -s "a session has been resumed" |
| 2665 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2666 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2667 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2668 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2669 | "$P_SRV debug_level=3 tickets=0" \ |
| 2670 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2671 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2672 | -c "client hello, adding session ticket extension" \ |
| 2673 | -s "found session ticket extension" \ |
| 2674 | -S "server hello, adding session ticket extension" \ |
| 2675 | -C "found session_ticket extension" \ |
| 2676 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2677 | -s "session successfully restored from cache" \ |
| 2678 | -S "session successfully restored from ticket" \ |
| 2679 | -s "a session has been resumed" \ |
| 2680 | -c "a session has been resumed" |
| 2681 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2682 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2683 | "$P_SRV debug_level=3 tickets=1" \ |
| 2684 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2685 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2686 | -C "client hello, adding session ticket extension" \ |
| 2687 | -S "found session ticket extension" \ |
| 2688 | -S "server hello, adding session ticket extension" \ |
| 2689 | -C "found session_ticket extension" \ |
| 2690 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2691 | -s "session successfully restored from cache" \ |
| 2692 | -S "session successfully restored from ticket" \ |
| 2693 | -s "a session has been resumed" \ |
| 2694 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2696 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2697 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2698 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2699 | 0 \ |
| 2700 | -S "session successfully restored from cache" \ |
| 2701 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2702 | -S "a session has been resumed" \ |
| 2703 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2704 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2705 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2706 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2707 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2708 | 0 \ |
| 2709 | -s "session successfully restored from cache" \ |
| 2710 | -S "session successfully restored from ticket" \ |
| 2711 | -s "a session has been resumed" \ |
| 2712 | -c "a session has been resumed" |
| 2713 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2714 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2715 | "$P_SRV debug_level=3 tickets=0" \ |
| 2716 | "$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] | 2717 | 0 \ |
| 2718 | -s "session successfully restored from cache" \ |
| 2719 | -S "session successfully restored from ticket" \ |
| 2720 | -s "a session has been resumed" \ |
| 2721 | -c "a session has been resumed" |
| 2722 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2723 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2724 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2725 | "$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] | 2726 | 0 \ |
| 2727 | -S "session successfully restored from cache" \ |
| 2728 | -S "session successfully restored from ticket" \ |
| 2729 | -S "a session has been resumed" \ |
| 2730 | -C "a session has been resumed" |
| 2731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2732 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2733 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2734 | "$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] | 2735 | 0 \ |
| 2736 | -s "session successfully restored from cache" \ |
| 2737 | -S "session successfully restored from ticket" \ |
| 2738 | -s "a session has been resumed" \ |
| 2739 | -c "a session has been resumed" |
| 2740 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2741 | run_test "Session resume using cache: session copy" \ |
| 2742 | "$P_SRV debug_level=3 tickets=0" \ |
| 2743 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2744 | 0 \ |
| 2745 | -s "session successfully restored from cache" \ |
| 2746 | -S "session successfully restored from ticket" \ |
| 2747 | -s "a session has been resumed" \ |
| 2748 | -c "a session has been resumed" |
| 2749 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2750 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2751 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2752 | "( $O_CLI -sess_out $SESSION; \ |
| 2753 | $O_CLI -sess_in $SESSION; \ |
| 2754 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2755 | 0 \ |
| 2756 | -s "found session ticket extension" \ |
| 2757 | -S "server hello, adding session ticket extension" \ |
| 2758 | -s "session successfully restored from cache" \ |
| 2759 | -S "session successfully restored from ticket" \ |
| 2760 | -s "a session has been resumed" |
| 2761 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2762 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2763 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2764 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2765 | 0 \ |
| 2766 | -C "found session_ticket extension" \ |
| 2767 | -C "parse new session ticket" \ |
| 2768 | -c "a session has been resumed" |
| 2769 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2770 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2771 | |
| 2772 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2773 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2774 | "$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] | 2775 | 0 \ |
| 2776 | -c "client hello, adding session ticket extension" \ |
| 2777 | -s "found session ticket extension" \ |
| 2778 | -S "server hello, adding session ticket extension" \ |
| 2779 | -C "found session_ticket extension" \ |
| 2780 | -C "parse new session ticket" \ |
| 2781 | -s "session successfully restored from cache" \ |
| 2782 | -S "session successfully restored from ticket" \ |
| 2783 | -s "a session has been resumed" \ |
| 2784 | -c "a session has been resumed" |
| 2785 | |
| 2786 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2787 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2788 | "$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] | 2789 | 0 \ |
| 2790 | -C "client hello, adding session ticket extension" \ |
| 2791 | -S "found session ticket extension" \ |
| 2792 | -S "server hello, adding session ticket extension" \ |
| 2793 | -C "found session_ticket extension" \ |
| 2794 | -C "parse new session ticket" \ |
| 2795 | -s "session successfully restored from cache" \ |
| 2796 | -S "session successfully restored from ticket" \ |
| 2797 | -s "a session has been resumed" \ |
| 2798 | -c "a session has been resumed" |
| 2799 | |
| 2800 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2801 | "$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] | 2802 | "$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] | 2803 | 0 \ |
| 2804 | -S "session successfully restored from cache" \ |
| 2805 | -S "session successfully restored from ticket" \ |
| 2806 | -S "a session has been resumed" \ |
| 2807 | -C "a session has been resumed" |
| 2808 | |
| 2809 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2810 | "$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] | 2811 | "$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] | 2812 | 0 \ |
| 2813 | -s "session successfully restored from cache" \ |
| 2814 | -S "session successfully restored from ticket" \ |
| 2815 | -s "a session has been resumed" \ |
| 2816 | -c "a session has been resumed" |
| 2817 | |
| 2818 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2819 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2820 | "$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] | 2821 | 0 \ |
| 2822 | -s "session successfully restored from cache" \ |
| 2823 | -S "session successfully restored from ticket" \ |
| 2824 | -s "a session has been resumed" \ |
| 2825 | -c "a session has been resumed" |
| 2826 | |
| 2827 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2828 | "$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] | 2829 | "$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] | 2830 | 0 \ |
| 2831 | -S "session successfully restored from cache" \ |
| 2832 | -S "session successfully restored from ticket" \ |
| 2833 | -S "a session has been resumed" \ |
| 2834 | -C "a session has been resumed" |
| 2835 | |
| 2836 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2837 | "$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] | 2838 | "$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] | 2839 | 0 \ |
| 2840 | -s "session successfully restored from cache" \ |
| 2841 | -S "session successfully restored from ticket" \ |
| 2842 | -s "a session has been resumed" \ |
| 2843 | -c "a session has been resumed" |
| 2844 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2845 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2846 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2847 | "$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] | 2848 | 0 \ |
| 2849 | -s "session successfully restored from cache" \ |
| 2850 | -S "session successfully restored from ticket" \ |
| 2851 | -s "a session has been resumed" \ |
| 2852 | -c "a session has been resumed" |
| 2853 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2854 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2855 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2856 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2857 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2858 | rm -f $SESSION )" \ |
| 2859 | 0 \ |
| 2860 | -s "found session ticket extension" \ |
| 2861 | -S "server hello, adding session ticket extension" \ |
| 2862 | -s "session successfully restored from cache" \ |
| 2863 | -S "session successfully restored from ticket" \ |
| 2864 | -s "a session has been resumed" |
| 2865 | |
| 2866 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2867 | "$O_SRV -dtls" \ |
| 2868 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2869 | 0 \ |
| 2870 | -C "found session_ticket extension" \ |
| 2871 | -C "parse new session ticket" \ |
| 2872 | -c "a session has been resumed" |
| 2873 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2874 | # Tests for Max Fragment Length extension |
| 2875 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2876 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2877 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2878 | "$P_SRV debug_level=3" \ |
| 2879 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2880 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2881 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2882 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2883 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2884 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2885 | -C "client hello, adding max_fragment_length extension" \ |
| 2886 | -S "found max fragment length extension" \ |
| 2887 | -S "server hello, max_fragment_length extension" \ |
| 2888 | -C "found max_fragment_length extension" |
| 2889 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2890 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2891 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2892 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2893 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2894 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2895 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2896 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2897 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2898 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2899 | -C "client hello, adding max_fragment_length extension" \ |
| 2900 | -S "found max fragment length extension" \ |
| 2901 | -S "server hello, max_fragment_length extension" \ |
| 2902 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2903 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2904 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2905 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2906 | |
| 2907 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2908 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2909 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2910 | "$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] | 2911 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2912 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2913 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2914 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2915 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2916 | -C "client hello, adding max_fragment_length extension" \ |
| 2917 | -S "found max fragment length extension" \ |
| 2918 | -S "server hello, max_fragment_length extension" \ |
| 2919 | -C "found max_fragment_length extension" \ |
| 2920 | -c "fragment larger than.*maximum " |
| 2921 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2922 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2923 | # (session fragment length will be 16384 regardless of mbedtls |
| 2924 | # content length configuration.) |
| 2925 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2926 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2927 | run_test "Max fragment length: disabled, larger message" \ |
| 2928 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2929 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2930 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2931 | -C "Maximum incoming record payload length is 16384" \ |
| 2932 | -C "Maximum outgoing record payload length is 16384" \ |
| 2933 | -S "Maximum incoming record payload length is 16384" \ |
| 2934 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2935 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2936 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2937 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2938 | |
| 2939 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2940 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2941 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2942 | "$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] | 2943 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2944 | -C "Maximum incoming record payload length is 16384" \ |
| 2945 | -C "Maximum outgoing record payload length is 16384" \ |
| 2946 | -S "Maximum incoming record payload length is 16384" \ |
| 2947 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2948 | -c "fragment larger than.*maximum " |
| 2949 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2950 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2951 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2952 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2953 | "$P_SRV debug_level=3" \ |
| 2954 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2955 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2956 | -c "Maximum incoming record payload length is 4096" \ |
| 2957 | -c "Maximum outgoing record payload length is 4096" \ |
| 2958 | -s "Maximum incoming record payload length is 4096" \ |
| 2959 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2960 | -c "client hello, adding max_fragment_length extension" \ |
| 2961 | -s "found max fragment length extension" \ |
| 2962 | -s "server hello, max_fragment_length extension" \ |
| 2963 | -c "found max_fragment_length extension" |
| 2964 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2965 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2966 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2967 | run_test "Max fragment length: client 512, server 1024" \ |
| 2968 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 2969 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2970 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2971 | -c "Maximum incoming record payload length is 512" \ |
| 2972 | -c "Maximum outgoing record payload length is 512" \ |
| 2973 | -s "Maximum incoming record payload length is 512" \ |
| 2974 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2975 | -c "client hello, adding max_fragment_length extension" \ |
| 2976 | -s "found max fragment length extension" \ |
| 2977 | -s "server hello, max_fragment_length extension" \ |
| 2978 | -c "found max_fragment_length extension" |
| 2979 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2980 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2981 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2982 | run_test "Max fragment length: client 512, server 2048" \ |
| 2983 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 2984 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2985 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2986 | -c "Maximum incoming record payload length is 512" \ |
| 2987 | -c "Maximum outgoing record payload length is 512" \ |
| 2988 | -s "Maximum incoming record payload length is 512" \ |
| 2989 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2990 | -c "client hello, adding max_fragment_length extension" \ |
| 2991 | -s "found max fragment length extension" \ |
| 2992 | -s "server hello, max_fragment_length extension" \ |
| 2993 | -c "found max_fragment_length extension" |
| 2994 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2995 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2996 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2997 | run_test "Max fragment length: client 512, server 4096" \ |
| 2998 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2999 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3000 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3001 | -c "Maximum incoming record payload length is 512" \ |
| 3002 | -c "Maximum outgoing record payload length is 512" \ |
| 3003 | -s "Maximum incoming record payload length is 512" \ |
| 3004 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3005 | -c "client hello, adding max_fragment_length extension" \ |
| 3006 | -s "found max fragment length extension" \ |
| 3007 | -s "server hello, max_fragment_length extension" \ |
| 3008 | -c "found max_fragment_length extension" |
| 3009 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3010 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3011 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3012 | run_test "Max fragment length: client 1024, server 512" \ |
| 3013 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3014 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3015 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3016 | -c "Maximum incoming record payload length is 1024" \ |
| 3017 | -c "Maximum outgoing record payload length is 1024" \ |
| 3018 | -s "Maximum incoming record payload length is 1024" \ |
| 3019 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3020 | -c "client hello, adding max_fragment_length extension" \ |
| 3021 | -s "found max fragment length extension" \ |
| 3022 | -s "server hello, max_fragment_length extension" \ |
| 3023 | -c "found max_fragment_length extension" |
| 3024 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3025 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3026 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3027 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3028 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3029 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3030 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3031 | -c "Maximum incoming record payload length is 1024" \ |
| 3032 | -c "Maximum outgoing record payload length is 1024" \ |
| 3033 | -s "Maximum incoming record payload length is 1024" \ |
| 3034 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3035 | -c "client hello, adding max_fragment_length extension" \ |
| 3036 | -s "found max fragment length extension" \ |
| 3037 | -s "server hello, max_fragment_length extension" \ |
| 3038 | -c "found max_fragment_length extension" |
| 3039 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3040 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3041 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3042 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3043 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3044 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3045 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3046 | -c "Maximum incoming record payload length is 1024" \ |
| 3047 | -c "Maximum outgoing record payload length is 1024" \ |
| 3048 | -s "Maximum incoming record payload length is 1024" \ |
| 3049 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3050 | -c "client hello, adding max_fragment_length extension" \ |
| 3051 | -s "found max fragment length extension" \ |
| 3052 | -s "server hello, max_fragment_length extension" \ |
| 3053 | -c "found max_fragment_length extension" |
| 3054 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3055 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3056 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3057 | run_test "Max fragment length: client 2048, server 512" \ |
| 3058 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3059 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3060 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3061 | -c "Maximum incoming record payload length is 2048" \ |
| 3062 | -c "Maximum outgoing record payload length is 2048" \ |
| 3063 | -s "Maximum incoming record payload length is 2048" \ |
| 3064 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3065 | -c "client hello, adding max_fragment_length extension" \ |
| 3066 | -s "found max fragment length extension" \ |
| 3067 | -s "server hello, max_fragment_length extension" \ |
| 3068 | -c "found max_fragment_length extension" |
| 3069 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3070 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3071 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3072 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3073 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3074 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3075 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3076 | -c "Maximum incoming record payload length is 2048" \ |
| 3077 | -c "Maximum outgoing record payload length is 2048" \ |
| 3078 | -s "Maximum incoming record payload length is 2048" \ |
| 3079 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3080 | -c "client hello, adding max_fragment_length extension" \ |
| 3081 | -s "found max fragment length extension" \ |
| 3082 | -s "server hello, max_fragment_length extension" \ |
| 3083 | -c "found max_fragment_length extension" |
| 3084 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3085 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3086 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3087 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3088 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3089 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3090 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3091 | -c "Maximum incoming record payload length is 2048" \ |
| 3092 | -c "Maximum outgoing record payload length is 2048" \ |
| 3093 | -s "Maximum incoming record payload length is 2048" \ |
| 3094 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3095 | -c "client hello, adding max_fragment_length extension" \ |
| 3096 | -s "found max fragment length extension" \ |
| 3097 | -s "server hello, max_fragment_length extension" \ |
| 3098 | -c "found max_fragment_length extension" |
| 3099 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3100 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3101 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3102 | run_test "Max fragment length: client 4096, server 512" \ |
| 3103 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3104 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3105 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3106 | -c "Maximum incoming record payload length is 4096" \ |
| 3107 | -c "Maximum outgoing record payload length is 4096" \ |
| 3108 | -s "Maximum incoming record payload length is 4096" \ |
| 3109 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3110 | -c "client hello, adding max_fragment_length extension" \ |
| 3111 | -s "found max fragment length extension" \ |
| 3112 | -s "server hello, max_fragment_length extension" \ |
| 3113 | -c "found max_fragment_length extension" |
| 3114 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3115 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3116 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3117 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3118 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3119 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3120 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3121 | -c "Maximum incoming record payload length is 4096" \ |
| 3122 | -c "Maximum outgoing record payload length is 4096" \ |
| 3123 | -s "Maximum incoming record payload length is 4096" \ |
| 3124 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3125 | -c "client hello, adding max_fragment_length extension" \ |
| 3126 | -s "found max fragment length extension" \ |
| 3127 | -s "server hello, max_fragment_length extension" \ |
| 3128 | -c "found max_fragment_length extension" |
| 3129 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3130 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3131 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3132 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3133 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3134 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3135 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3136 | -c "Maximum incoming record payload length is 4096" \ |
| 3137 | -c "Maximum outgoing record payload length is 4096" \ |
| 3138 | -s "Maximum incoming record payload length is 4096" \ |
| 3139 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3140 | -c "client hello, adding max_fragment_length extension" \ |
| 3141 | -s "found max fragment length extension" \ |
| 3142 | -s "server hello, max_fragment_length extension" \ |
| 3143 | -c "found max_fragment_length extension" |
| 3144 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3145 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3146 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3147 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3148 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3149 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3150 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3151 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3152 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3153 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3154 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3155 | -C "client hello, adding max_fragment_length extension" \ |
| 3156 | -S "found max fragment length extension" \ |
| 3157 | -S "server hello, max_fragment_length extension" \ |
| 3158 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3159 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3160 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3161 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3162 | requires_gnutls |
| 3163 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3164 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3165 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3166 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3167 | -c "Maximum incoming record payload length is 4096" \ |
| 3168 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3169 | -c "client hello, adding max_fragment_length extension" \ |
| 3170 | -c "found max_fragment_length extension" |
| 3171 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3172 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3173 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3174 | run_test "Max fragment length: client, message just fits" \ |
| 3175 | "$P_SRV debug_level=3" \ |
| 3176 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3177 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3178 | -c "Maximum incoming record payload length is 2048" \ |
| 3179 | -c "Maximum outgoing record payload length is 2048" \ |
| 3180 | -s "Maximum incoming record payload length is 2048" \ |
| 3181 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3182 | -c "client hello, adding max_fragment_length extension" \ |
| 3183 | -s "found max fragment length extension" \ |
| 3184 | -s "server hello, max_fragment_length extension" \ |
| 3185 | -c "found max_fragment_length extension" \ |
| 3186 | -c "2048 bytes written in 1 fragments" \ |
| 3187 | -s "2048 bytes read" |
| 3188 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3189 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3190 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3191 | run_test "Max fragment length: client, larger message" \ |
| 3192 | "$P_SRV debug_level=3" \ |
| 3193 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3194 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3195 | -c "Maximum incoming record payload length is 2048" \ |
| 3196 | -c "Maximum outgoing record payload length is 2048" \ |
| 3197 | -s "Maximum incoming record payload length is 2048" \ |
| 3198 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3199 | -c "client hello, adding max_fragment_length extension" \ |
| 3200 | -s "found max fragment length extension" \ |
| 3201 | -s "server hello, max_fragment_length extension" \ |
| 3202 | -c "found max_fragment_length extension" \ |
| 3203 | -c "2345 bytes written in 2 fragments" \ |
| 3204 | -s "2048 bytes read" \ |
| 3205 | -s "297 bytes read" |
| 3206 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3207 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3208 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3209 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3210 | "$P_SRV debug_level=3 dtls=1" \ |
| 3211 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3212 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3213 | -c "Maximum incoming record payload length is 2048" \ |
| 3214 | -c "Maximum outgoing record payload length is 2048" \ |
| 3215 | -s "Maximum incoming record payload length is 2048" \ |
| 3216 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3217 | -c "client hello, adding max_fragment_length extension" \ |
| 3218 | -s "found max fragment length extension" \ |
| 3219 | -s "server hello, max_fragment_length extension" \ |
| 3220 | -c "found max_fragment_length extension" \ |
| 3221 | -c "fragment larger than.*maximum" |
| 3222 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3223 | # Tests for renegotiation |
| 3224 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3225 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3226 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3227 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3228 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3229 | 0 \ |
| 3230 | -C "client hello, adding renegotiation extension" \ |
| 3231 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3232 | -S "found renegotiation extension" \ |
| 3233 | -s "server hello, secure renegotiation extension" \ |
| 3234 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3235 | -C "=> renegotiate" \ |
| 3236 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3237 | -S "write hello request" |
| 3238 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3240 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3241 | "$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] | 3242 | "$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] | 3243 | 0 \ |
| 3244 | -c "client hello, adding renegotiation extension" \ |
| 3245 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3246 | -s "found renegotiation extension" \ |
| 3247 | -s "server hello, secure renegotiation extension" \ |
| 3248 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3249 | -c "=> renegotiate" \ |
| 3250 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3251 | -S "write hello request" |
| 3252 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3253 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3254 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3255 | "$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] | 3256 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3257 | 0 \ |
| 3258 | -c "client hello, adding renegotiation extension" \ |
| 3259 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3260 | -s "found renegotiation extension" \ |
| 3261 | -s "server hello, secure renegotiation extension" \ |
| 3262 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3263 | -c "=> renegotiate" \ |
| 3264 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3265 | -s "write hello request" |
| 3266 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3267 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3268 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 3269 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3270 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3271 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3272 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3273 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3274 | 0 \ |
| 3275 | -c "client hello, adding renegotiation extension" \ |
| 3276 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3277 | -s "found renegotiation extension" \ |
| 3278 | -s "server hello, secure renegotiation extension" \ |
| 3279 | -c "found renegotiation extension" \ |
| 3280 | -c "=> renegotiate" \ |
| 3281 | -s "=> renegotiate" \ |
| 3282 | -S "write hello request" \ |
| 3283 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3284 | |
| 3285 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3286 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 3287 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3288 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3289 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3290 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3291 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3292 | 0 \ |
| 3293 | -c "client hello, adding renegotiation extension" \ |
| 3294 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3295 | -s "found renegotiation extension" \ |
| 3296 | -s "server hello, secure renegotiation extension" \ |
| 3297 | -c "found renegotiation extension" \ |
| 3298 | -c "=> renegotiate" \ |
| 3299 | -s "=> renegotiate" \ |
| 3300 | -s "write hello request" \ |
| 3301 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3302 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3303 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3304 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3305 | "$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] | 3306 | "$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] | 3307 | 0 \ |
| 3308 | -c "client hello, adding renegotiation extension" \ |
| 3309 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3310 | -s "found renegotiation extension" \ |
| 3311 | -s "server hello, secure renegotiation extension" \ |
| 3312 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3313 | -c "=> renegotiate" \ |
| 3314 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3315 | -s "write hello request" |
| 3316 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3318 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3319 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3320 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3321 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3322 | "$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" \ |
| 3323 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3324 | -c "Maximum incoming record payload length is 2048" \ |
| 3325 | -c "Maximum outgoing record payload length is 2048" \ |
| 3326 | -s "Maximum incoming record payload length is 2048" \ |
| 3327 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3328 | -c "client hello, adding max_fragment_length extension" \ |
| 3329 | -s "found max fragment length extension" \ |
| 3330 | -s "server hello, max_fragment_length extension" \ |
| 3331 | -c "found max_fragment_length extension" \ |
| 3332 | -c "client hello, adding renegotiation extension" \ |
| 3333 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3334 | -s "found renegotiation extension" \ |
| 3335 | -s "server hello, secure renegotiation extension" \ |
| 3336 | -c "found renegotiation extension" \ |
| 3337 | -c "=> renegotiate" \ |
| 3338 | -s "=> renegotiate" \ |
| 3339 | -s "write hello request" |
| 3340 | |
| 3341 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3342 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3343 | "$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] | 3344 | "$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] | 3345 | 1 \ |
| 3346 | -c "client hello, adding renegotiation extension" \ |
| 3347 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3348 | -S "found renegotiation extension" \ |
| 3349 | -s "server hello, secure renegotiation extension" \ |
| 3350 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3351 | -c "=> renegotiate" \ |
| 3352 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3353 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3354 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3355 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3356 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3357 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3358 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3359 | "$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] | 3360 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3361 | 0 \ |
| 3362 | -C "client hello, adding renegotiation extension" \ |
| 3363 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3364 | -S "found renegotiation extension" \ |
| 3365 | -s "server hello, secure renegotiation extension" \ |
| 3366 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3367 | -C "=> renegotiate" \ |
| 3368 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3369 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3370 | -S "SSL - An unexpected message was received from our peer" \ |
| 3371 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3372 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3373 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3374 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3375 | "$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] | 3376 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3377 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3378 | 0 \ |
| 3379 | -C "client hello, adding renegotiation extension" \ |
| 3380 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3381 | -S "found renegotiation extension" \ |
| 3382 | -s "server hello, secure renegotiation extension" \ |
| 3383 | -c "found renegotiation extension" \ |
| 3384 | -C "=> renegotiate" \ |
| 3385 | -S "=> renegotiate" \ |
| 3386 | -s "write hello request" \ |
| 3387 | -S "SSL - An unexpected message was received from our peer" \ |
| 3388 | -S "failed" |
| 3389 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3390 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3391 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3392 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3393 | "$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] | 3394 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3395 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3396 | 0 \ |
| 3397 | -C "client hello, adding renegotiation extension" \ |
| 3398 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3399 | -S "found renegotiation extension" \ |
| 3400 | -s "server hello, secure renegotiation extension" \ |
| 3401 | -c "found renegotiation extension" \ |
| 3402 | -C "=> renegotiate" \ |
| 3403 | -S "=> renegotiate" \ |
| 3404 | -s "write hello request" \ |
| 3405 | -S "SSL - An unexpected message was received from our peer" \ |
| 3406 | -S "failed" |
| 3407 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3408 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3409 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3410 | "$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] | 3411 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3412 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3413 | 0 \ |
| 3414 | -C "client hello, adding renegotiation extension" \ |
| 3415 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3416 | -S "found renegotiation extension" \ |
| 3417 | -s "server hello, secure renegotiation extension" \ |
| 3418 | -c "found renegotiation extension" \ |
| 3419 | -C "=> renegotiate" \ |
| 3420 | -S "=> renegotiate" \ |
| 3421 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3422 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3423 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3424 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3425 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3426 | "$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] | 3427 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3428 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3429 | 0 \ |
| 3430 | -c "client hello, adding renegotiation extension" \ |
| 3431 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3432 | -s "found renegotiation extension" \ |
| 3433 | -s "server hello, secure renegotiation extension" \ |
| 3434 | -c "found renegotiation extension" \ |
| 3435 | -c "=> renegotiate" \ |
| 3436 | -s "=> renegotiate" \ |
| 3437 | -s "write hello request" \ |
| 3438 | -S "SSL - An unexpected message was received from our peer" \ |
| 3439 | -S "failed" |
| 3440 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3441 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3442 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3443 | "$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] | 3444 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3445 | 0 \ |
| 3446 | -C "client hello, adding renegotiation extension" \ |
| 3447 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3448 | -S "found renegotiation extension" \ |
| 3449 | -s "server hello, secure renegotiation extension" \ |
| 3450 | -c "found renegotiation extension" \ |
| 3451 | -S "record counter limit reached: renegotiate" \ |
| 3452 | -C "=> renegotiate" \ |
| 3453 | -S "=> renegotiate" \ |
| 3454 | -S "write hello request" \ |
| 3455 | -S "SSL - An unexpected message was received from our peer" \ |
| 3456 | -S "failed" |
| 3457 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3458 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3460 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3461 | "$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] | 3462 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3463 | 0 \ |
| 3464 | -c "client hello, adding renegotiation extension" \ |
| 3465 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3466 | -s "found renegotiation extension" \ |
| 3467 | -s "server hello, secure renegotiation extension" \ |
| 3468 | -c "found renegotiation extension" \ |
| 3469 | -s "record counter limit reached: renegotiate" \ |
| 3470 | -c "=> renegotiate" \ |
| 3471 | -s "=> renegotiate" \ |
| 3472 | -s "write hello request" \ |
| 3473 | -S "SSL - An unexpected message was received from our peer" \ |
| 3474 | -S "failed" |
| 3475 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3477 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3478 | "$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] | 3479 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3480 | 0 \ |
| 3481 | -c "client hello, adding renegotiation extension" \ |
| 3482 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3483 | -s "found renegotiation extension" \ |
| 3484 | -s "server hello, secure renegotiation extension" \ |
| 3485 | -c "found renegotiation extension" \ |
| 3486 | -s "record counter limit reached: renegotiate" \ |
| 3487 | -c "=> renegotiate" \ |
| 3488 | -s "=> renegotiate" \ |
| 3489 | -s "write hello request" \ |
| 3490 | -S "SSL - An unexpected message was received from our peer" \ |
| 3491 | -S "failed" |
| 3492 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3493 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3494 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3495 | "$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] | 3496 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3497 | 0 \ |
| 3498 | -C "client hello, adding renegotiation extension" \ |
| 3499 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3500 | -S "found renegotiation extension" \ |
| 3501 | -s "server hello, secure renegotiation extension" \ |
| 3502 | -c "found renegotiation extension" \ |
| 3503 | -S "record counter limit reached: renegotiate" \ |
| 3504 | -C "=> renegotiate" \ |
| 3505 | -S "=> renegotiate" \ |
| 3506 | -S "write hello request" \ |
| 3507 | -S "SSL - An unexpected message was received from our peer" \ |
| 3508 | -S "failed" |
| 3509 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3510 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3511 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3512 | "$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] | 3513 | "$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] | 3514 | 0 \ |
| 3515 | -c "client hello, adding renegotiation extension" \ |
| 3516 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3517 | -s "found renegotiation extension" \ |
| 3518 | -s "server hello, secure renegotiation extension" \ |
| 3519 | -c "found renegotiation extension" \ |
| 3520 | -c "=> renegotiate" \ |
| 3521 | -s "=> renegotiate" \ |
| 3522 | -S "write hello request" |
| 3523 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3524 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3525 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3526 | "$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] | 3527 | "$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] | 3528 | 0 \ |
| 3529 | -c "client hello, adding renegotiation extension" \ |
| 3530 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3531 | -s "found renegotiation extension" \ |
| 3532 | -s "server hello, secure renegotiation extension" \ |
| 3533 | -c "found renegotiation extension" \ |
| 3534 | -c "=> renegotiate" \ |
| 3535 | -s "=> renegotiate" \ |
| 3536 | -s "write hello request" |
| 3537 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3538 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3539 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3540 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3541 | "$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] | 3542 | 0 \ |
| 3543 | -c "client hello, adding renegotiation extension" \ |
| 3544 | -c "found renegotiation extension" \ |
| 3545 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3546 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3547 | -C "error" \ |
| 3548 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3549 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3550 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3551 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3552 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3553 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3554 | "$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] | 3555 | 0 \ |
| 3556 | -c "client hello, adding renegotiation extension" \ |
| 3557 | -c "found renegotiation extension" \ |
| 3558 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3559 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3560 | -C "error" \ |
| 3561 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3562 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3563 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3564 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3565 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3566 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3567 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3568 | 1 \ |
| 3569 | -c "client hello, adding renegotiation extension" \ |
| 3570 | -C "found renegotiation extension" \ |
| 3571 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3572 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3573 | -c "error" \ |
| 3574 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3575 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3576 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3577 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3578 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3579 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3580 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3581 | allow_legacy=0" \ |
| 3582 | 1 \ |
| 3583 | -c "client hello, adding renegotiation extension" \ |
| 3584 | -C "found renegotiation extension" \ |
| 3585 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3586 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3587 | -c "error" \ |
| 3588 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3589 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3590 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3591 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3592 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3593 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3594 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3595 | allow_legacy=1" \ |
| 3596 | 0 \ |
| 3597 | -c "client hello, adding renegotiation extension" \ |
| 3598 | -C "found renegotiation extension" \ |
| 3599 | -c "=> renegotiate" \ |
| 3600 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3601 | -C "error" \ |
| 3602 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3603 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3604 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3605 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3606 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3607 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3608 | 0 \ |
| 3609 | -c "client hello, adding renegotiation extension" \ |
| 3610 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3611 | -s "found renegotiation extension" \ |
| 3612 | -s "server hello, secure renegotiation extension" \ |
| 3613 | -c "found renegotiation extension" \ |
| 3614 | -c "=> renegotiate" \ |
| 3615 | -s "=> renegotiate" \ |
| 3616 | -S "write hello request" |
| 3617 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3618 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3619 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3620 | "$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] | 3621 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3622 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3623 | 0 \ |
| 3624 | -c "client hello, adding renegotiation extension" \ |
| 3625 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3626 | -s "found renegotiation extension" \ |
| 3627 | -s "server hello, secure renegotiation extension" \ |
| 3628 | -c "found renegotiation extension" \ |
| 3629 | -c "=> renegotiate" \ |
| 3630 | -s "=> renegotiate" \ |
| 3631 | -s "write hello request" |
| 3632 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3633 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3634 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3635 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3636 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3637 | 0 \ |
| 3638 | -c "client hello, adding renegotiation extension" \ |
| 3639 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3640 | -s "found renegotiation extension" \ |
| 3641 | -s "server hello, secure renegotiation extension" \ |
| 3642 | -s "record counter limit reached: renegotiate" \ |
| 3643 | -c "=> renegotiate" \ |
| 3644 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3645 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3646 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3647 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3648 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3649 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3650 | "$G_SRV -u --mtu 4096" \ |
| 3651 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3652 | 0 \ |
| 3653 | -c "client hello, adding renegotiation extension" \ |
| 3654 | -c "found renegotiation extension" \ |
| 3655 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3656 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3657 | -C "error" \ |
| 3658 | -s "Extra-header:" |
| 3659 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3660 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3661 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3662 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3663 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3664 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3665 | "$P_CLI debug_level=3" \ |
| 3666 | 0 \ |
| 3667 | -c "found renegotiation extension" \ |
| 3668 | -C "error" \ |
| 3669 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3670 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3671 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3672 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3673 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3674 | "$P_CLI debug_level=3" \ |
| 3675 | 0 \ |
| 3676 | -C "found renegotiation extension" \ |
| 3677 | -C "error" \ |
| 3678 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3679 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3680 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3681 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3682 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3683 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3684 | 1 \ |
| 3685 | -C "found renegotiation extension" \ |
| 3686 | -c "error" \ |
| 3687 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3688 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3689 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3690 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3691 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3692 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3693 | 0 \ |
| 3694 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3695 | -s "server hello, secure renegotiation extension" |
| 3696 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3697 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3698 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3699 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3700 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3701 | 0 \ |
| 3702 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3703 | -S "server hello, secure renegotiation extension" |
| 3704 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3705 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3706 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3707 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3708 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3709 | 1 \ |
| 3710 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3711 | -S "server hello, secure renegotiation extension" |
| 3712 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3713 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3714 | |
| 3715 | requires_gnutls |
| 3716 | run_test "DER format: no trailing bytes" \ |
| 3717 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3718 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3719 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3720 | 0 \ |
| 3721 | -c "Handshake was completed" \ |
| 3722 | |
| 3723 | requires_gnutls |
| 3724 | run_test "DER format: with a trailing zero byte" \ |
| 3725 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3726 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3727 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3728 | 0 \ |
| 3729 | -c "Handshake was completed" \ |
| 3730 | |
| 3731 | requires_gnutls |
| 3732 | run_test "DER format: with a trailing random byte" \ |
| 3733 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3734 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3735 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3736 | 0 \ |
| 3737 | -c "Handshake was completed" \ |
| 3738 | |
| 3739 | requires_gnutls |
| 3740 | run_test "DER format: with 2 trailing random bytes" \ |
| 3741 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3742 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3743 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3744 | 0 \ |
| 3745 | -c "Handshake was completed" \ |
| 3746 | |
| 3747 | requires_gnutls |
| 3748 | run_test "DER format: with 4 trailing random bytes" \ |
| 3749 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3750 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3751 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3752 | 0 \ |
| 3753 | -c "Handshake was completed" \ |
| 3754 | |
| 3755 | requires_gnutls |
| 3756 | run_test "DER format: with 8 trailing random bytes" \ |
| 3757 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3758 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3759 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3760 | 0 \ |
| 3761 | -c "Handshake was completed" \ |
| 3762 | |
| 3763 | requires_gnutls |
| 3764 | run_test "DER format: with 9 trailing random bytes" \ |
| 3765 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3766 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3767 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3768 | 0 \ |
| 3769 | -c "Handshake was completed" \ |
| 3770 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3771 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3772 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3773 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3774 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3775 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3776 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3777 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3778 | 1 \ |
| 3779 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3780 | -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] | 3781 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3782 | -c "X509 - Certificate verification failed" |
| 3783 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3784 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3785 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3786 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3787 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3788 | 0 \ |
| 3789 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3790 | -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] | 3791 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3792 | -C "X509 - Certificate verification failed" |
| 3793 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3794 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3795 | "$P_SRV" \ |
| 3796 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3797 | 0 \ |
| 3798 | -c "x509_verify_cert() returned" \ |
| 3799 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3800 | -c "! Certificate verification flags"\ |
| 3801 | -C "! mbedtls_ssl_handshake returned" \ |
| 3802 | -C "X509 - Certificate verification failed" \ |
| 3803 | -C "SSL - No CA Chain is set, but required to operate" |
| 3804 | |
| 3805 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3806 | "$P_SRV" \ |
| 3807 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3808 | 1 \ |
| 3809 | -c "x509_verify_cert() returned" \ |
| 3810 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3811 | -c "! Certificate verification flags"\ |
| 3812 | -c "! mbedtls_ssl_handshake returned" \ |
| 3813 | -c "SSL - No CA Chain is set, but required to operate" |
| 3814 | |
| 3815 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3816 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3817 | # the client informs the server about the supported curves - it does, though, in the |
| 3818 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3819 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3820 | # different means to have the server ignoring the client's supported curve list. |
| 3821 | |
| 3822 | requires_config_enabled MBEDTLS_ECP_C |
| 3823 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3824 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3825 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3826 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3827 | 1 \ |
| 3828 | -c "bad certificate (EC key curve)"\ |
| 3829 | -c "! Certificate verification flags"\ |
| 3830 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3831 | |
| 3832 | requires_config_enabled MBEDTLS_ECP_C |
| 3833 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3834 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3835 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3836 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3837 | 1 \ |
| 3838 | -c "bad certificate (EC key curve)"\ |
| 3839 | -c "! Certificate verification flags"\ |
| 3840 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3841 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3842 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3843 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3844 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3845 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3846 | 0 \ |
| 3847 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3848 | -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] | 3849 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3850 | -C "X509 - Certificate verification failed" |
| 3851 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3852 | run_test "Authentication: client SHA256, server required" \ |
| 3853 | "$P_SRV auth_mode=required" \ |
| 3854 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3855 | key_file=data_files/server6.key \ |
| 3856 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3857 | 0 \ |
| 3858 | -c "Supported Signature Algorithm found: 4," \ |
| 3859 | -c "Supported Signature Algorithm found: 5," |
| 3860 | |
| 3861 | run_test "Authentication: client SHA384, server required" \ |
| 3862 | "$P_SRV auth_mode=required" \ |
| 3863 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3864 | key_file=data_files/server6.key \ |
| 3865 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3866 | 0 \ |
| 3867 | -c "Supported Signature Algorithm found: 4," \ |
| 3868 | -c "Supported Signature Algorithm found: 5," |
| 3869 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3870 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3871 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3872 | "$P_CLI debug_level=3 crt_file=none \ |
| 3873 | key_file=data_files/server5.key" \ |
| 3874 | 1 \ |
| 3875 | -S "skip write certificate request" \ |
| 3876 | -C "skip parse certificate request" \ |
| 3877 | -c "got a certificate request" \ |
| 3878 | -c "= write certificate$" \ |
| 3879 | -C "skip write certificate$" \ |
| 3880 | -S "x509_verify_cert() returned" \ |
| 3881 | -s "client has no certificate" \ |
| 3882 | -s "! mbedtls_ssl_handshake returned" \ |
| 3883 | -c "! mbedtls_ssl_handshake returned" \ |
| 3884 | -s "No client certification received from the client, but required by the authentication mode" |
| 3885 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3886 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3887 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3888 | "$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] | 3889 | key_file=data_files/server5.key" \ |
| 3890 | 1 \ |
| 3891 | -S "skip write certificate request" \ |
| 3892 | -C "skip parse certificate request" \ |
| 3893 | -c "got a certificate request" \ |
| 3894 | -C "skip write certificate" \ |
| 3895 | -C "skip write certificate verify" \ |
| 3896 | -S "skip parse certificate verify" \ |
| 3897 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3898 | -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] | 3899 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3900 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3901 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3902 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3903 | # We don't check that the client receives the alert because it might |
| 3904 | # detect that its write end of the connection is closed and abort |
| 3905 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3906 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3907 | run_test "Authentication: client cert not trusted, server required" \ |
| 3908 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3909 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3910 | key_file=data_files/server5.key" \ |
| 3911 | 1 \ |
| 3912 | -S "skip write certificate request" \ |
| 3913 | -C "skip parse certificate request" \ |
| 3914 | -c "got a certificate request" \ |
| 3915 | -C "skip write certificate" \ |
| 3916 | -C "skip write certificate verify" \ |
| 3917 | -S "skip parse certificate verify" \ |
| 3918 | -s "x509_verify_cert() returned" \ |
| 3919 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3920 | -s "! mbedtls_ssl_handshake returned" \ |
| 3921 | -c "! mbedtls_ssl_handshake returned" \ |
| 3922 | -s "X509 - Certificate verification failed" |
| 3923 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3924 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3925 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3926 | "$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] | 3927 | key_file=data_files/server5.key" \ |
| 3928 | 0 \ |
| 3929 | -S "skip write certificate request" \ |
| 3930 | -C "skip parse certificate request" \ |
| 3931 | -c "got a certificate request" \ |
| 3932 | -C "skip write certificate" \ |
| 3933 | -C "skip write certificate verify" \ |
| 3934 | -S "skip parse certificate verify" \ |
| 3935 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3936 | -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] | 3937 | -S "! mbedtls_ssl_handshake returned" \ |
| 3938 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3939 | -S "X509 - Certificate verification failed" |
| 3940 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3941 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3942 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3943 | "$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] | 3944 | key_file=data_files/server5.key" \ |
| 3945 | 0 \ |
| 3946 | -s "skip write certificate request" \ |
| 3947 | -C "skip parse certificate request" \ |
| 3948 | -c "got no certificate request" \ |
| 3949 | -c "skip write certificate" \ |
| 3950 | -c "skip write certificate verify" \ |
| 3951 | -s "skip parse certificate verify" \ |
| 3952 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3953 | -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] | 3954 | -S "! mbedtls_ssl_handshake returned" \ |
| 3955 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3956 | -S "X509 - Certificate verification failed" |
| 3957 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3958 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3959 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3960 | "$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] | 3961 | 0 \ |
| 3962 | -S "skip write certificate request" \ |
| 3963 | -C "skip parse certificate request" \ |
| 3964 | -c "got a certificate request" \ |
| 3965 | -C "skip write certificate$" \ |
| 3966 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3967 | -c "skip write certificate verify" \ |
| 3968 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3969 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3970 | -S "! mbedtls_ssl_handshake returned" \ |
| 3971 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3972 | -S "X509 - Certificate verification failed" |
| 3973 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3974 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3975 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3976 | "$O_CLI" \ |
| 3977 | 0 \ |
| 3978 | -S "skip write certificate request" \ |
| 3979 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3980 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3981 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3982 | -S "X509 - Certificate verification failed" |
| 3983 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3984 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3985 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3986 | "$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] | 3987 | 0 \ |
| 3988 | -C "skip parse certificate request" \ |
| 3989 | -c "got a certificate request" \ |
| 3990 | -C "skip write certificate$" \ |
| 3991 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3992 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3993 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3994 | run_test "Authentication: client no cert, openssl server required" \ |
| 3995 | "$O_SRV -Verify 10" \ |
| 3996 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3997 | 1 \ |
| 3998 | -C "skip parse certificate request" \ |
| 3999 | -c "got a certificate request" \ |
| 4000 | -C "skip write certificate$" \ |
| 4001 | -c "skip write certificate verify" \ |
| 4002 | -c "! mbedtls_ssl_handshake returned" |
| 4003 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4004 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4005 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4006 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4007 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4008 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4009 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4010 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4011 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4012 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4013 | # are in place so that the semantics are consistent with the test description. |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4014 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4015 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4016 | run_test "Authentication: server max_int chain, client default" \ |
| 4017 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4018 | key_file=data_files/dir-maxpath/09.key" \ |
| 4019 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4020 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4021 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4022 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4023 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4024 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4025 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4026 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4027 | key_file=data_files/dir-maxpath/10.key" \ |
| 4028 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4029 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4030 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4031 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4032 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4033 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4034 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4035 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4036 | key_file=data_files/dir-maxpath/10.key" \ |
| 4037 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4038 | auth_mode=optional" \ |
| 4039 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4040 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4041 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4042 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4043 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4044 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4045 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4046 | key_file=data_files/dir-maxpath/10.key" \ |
| 4047 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4048 | auth_mode=none" \ |
| 4049 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4050 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4051 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4052 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4053 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4054 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4055 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4056 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4057 | key_file=data_files/dir-maxpath/10.key" \ |
| 4058 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4059 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4060 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4061 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4062 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4063 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4064 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4065 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4066 | key_file=data_files/dir-maxpath/10.key" \ |
| 4067 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4068 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4069 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4070 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4071 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4072 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4073 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4074 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4075 | key_file=data_files/dir-maxpath/10.key" \ |
| 4076 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4077 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4078 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4079 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4080 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4081 | run_test "Authentication: client max_int chain, server required" \ |
| 4082 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4083 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4084 | key_file=data_files/dir-maxpath/09.key" \ |
| 4085 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4086 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4087 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4088 | # Tests for CA list in CertificateRequest messages |
| 4089 | |
| 4090 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4091 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4092 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4093 | key_file=data_files/server6.key" \ |
| 4094 | 0 \ |
| 4095 | -s "requested DN" |
| 4096 | |
| 4097 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4098 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4099 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4100 | key_file=data_files/server6.key" \ |
| 4101 | 0 \ |
| 4102 | -S "requested DN" |
| 4103 | |
| 4104 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4105 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4106 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4107 | key_file=data_files/server5.key" \ |
| 4108 | 1 \ |
| 4109 | -S "requested DN" \ |
| 4110 | -s "x509_verify_cert() returned" \ |
| 4111 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4112 | -s "! mbedtls_ssl_handshake returned" \ |
| 4113 | -c "! mbedtls_ssl_handshake returned" \ |
| 4114 | -s "X509 - Certificate verification failed" |
| 4115 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4116 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4117 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4118 | |
| 4119 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4120 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4121 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4122 | key_file=data_files/server5.key" \ |
| 4123 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4124 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4125 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4126 | -c "x509_verify_cert() returned" \ |
| 4127 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4128 | -c "! mbedtls_ssl_handshake returned" \ |
| 4129 | -c "X509 - Certificate verification failed" |
| 4130 | |
| 4131 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4132 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4133 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4134 | key_file=data_files/server5.key" \ |
| 4135 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4136 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4137 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4138 | -c "x509_verify_cert() returned" \ |
| 4139 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4140 | -C "! mbedtls_ssl_handshake returned" \ |
| 4141 | -C "X509 - Certificate verification failed" |
| 4142 | |
| 4143 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4144 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4145 | # the client informs the server about the supported curves - it does, though, in the |
| 4146 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4147 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4148 | # different means to have the server ignoring the client's supported curve list. |
| 4149 | |
| 4150 | requires_config_enabled MBEDTLS_ECP_C |
| 4151 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4152 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4153 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4154 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4155 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4156 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4157 | -c "use CA callback for X.509 CRT verification" \ |
| 4158 | -c "bad certificate (EC key curve)" \ |
| 4159 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4160 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4161 | |
| 4162 | requires_config_enabled MBEDTLS_ECP_C |
| 4163 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4164 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4165 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4166 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4167 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4168 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4169 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4170 | -c "bad certificate (EC key curve)"\ |
| 4171 | -c "! Certificate verification flags"\ |
| 4172 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4173 | |
| 4174 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4175 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4176 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4177 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4178 | key_file=data_files/server6.key \ |
| 4179 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4180 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4181 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4182 | -c "Supported Signature Algorithm found: 4," \ |
| 4183 | -c "Supported Signature Algorithm found: 5," |
| 4184 | |
| 4185 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4186 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4187 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4188 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4189 | key_file=data_files/server6.key \ |
| 4190 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4191 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4192 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4193 | -c "Supported Signature Algorithm found: 4," \ |
| 4194 | -c "Supported Signature Algorithm found: 5," |
| 4195 | |
| 4196 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4197 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4198 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4199 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4200 | key_file=data_files/server5.key" \ |
| 4201 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4202 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4203 | -S "skip write certificate request" \ |
| 4204 | -C "skip parse certificate request" \ |
| 4205 | -c "got a certificate request" \ |
| 4206 | -C "skip write certificate" \ |
| 4207 | -C "skip write certificate verify" \ |
| 4208 | -S "skip parse certificate verify" \ |
| 4209 | -s "x509_verify_cert() returned" \ |
| 4210 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4211 | -s "! mbedtls_ssl_handshake returned" \ |
| 4212 | -s "send alert level=2 message=48" \ |
| 4213 | -c "! mbedtls_ssl_handshake returned" \ |
| 4214 | -s "X509 - Certificate verification failed" |
| 4215 | # We don't check that the client receives the alert because it might |
| 4216 | # detect that its write end of the connection is closed and abort |
| 4217 | # before reading the alert message. |
| 4218 | |
| 4219 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4220 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4221 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4222 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4223 | key_file=data_files/server5.key" \ |
| 4224 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4225 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4226 | -S "skip write certificate request" \ |
| 4227 | -C "skip parse certificate request" \ |
| 4228 | -c "got a certificate request" \ |
| 4229 | -C "skip write certificate" \ |
| 4230 | -C "skip write certificate verify" \ |
| 4231 | -S "skip parse certificate verify" \ |
| 4232 | -s "x509_verify_cert() returned" \ |
| 4233 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4234 | -s "! mbedtls_ssl_handshake returned" \ |
| 4235 | -c "! mbedtls_ssl_handshake returned" \ |
| 4236 | -s "X509 - Certificate verification failed" |
| 4237 | |
| 4238 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4239 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4240 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4241 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4242 | key_file=data_files/server5.key" \ |
| 4243 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4244 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4245 | -S "skip write certificate request" \ |
| 4246 | -C "skip parse certificate request" \ |
| 4247 | -c "got a certificate request" \ |
| 4248 | -C "skip write certificate" \ |
| 4249 | -C "skip write certificate verify" \ |
| 4250 | -S "skip parse certificate verify" \ |
| 4251 | -s "x509_verify_cert() returned" \ |
| 4252 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4253 | -S "! mbedtls_ssl_handshake returned" \ |
| 4254 | -C "! mbedtls_ssl_handshake returned" \ |
| 4255 | -S "X509 - Certificate verification failed" |
| 4256 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4257 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4258 | requires_full_size_output_buffer |
| 4259 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4260 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4261 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4262 | key_file=data_files/dir-maxpath/09.key" \ |
| 4263 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4264 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4265 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4266 | -C "X509 - A fatal error occurred" |
| 4267 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4268 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4269 | requires_full_size_output_buffer |
| 4270 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4271 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4272 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4273 | key_file=data_files/dir-maxpath/10.key" \ |
| 4274 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4275 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4276 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4277 | -c "X509 - A fatal error occurred" |
| 4278 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4279 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4280 | requires_full_size_output_buffer |
| 4281 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4282 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4283 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4284 | key_file=data_files/dir-maxpath/10.key" \ |
| 4285 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4286 | debug_level=3 auth_mode=optional" \ |
| 4287 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4288 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4289 | -c "X509 - A fatal error occurred" |
| 4290 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4291 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4292 | requires_full_size_output_buffer |
| 4293 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4294 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4295 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4296 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4297 | key_file=data_files/dir-maxpath/10.key" \ |
| 4298 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4299 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4300 | -s "X509 - A fatal error occurred" |
| 4301 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4302 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4303 | requires_full_size_output_buffer |
| 4304 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4305 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4306 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4307 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4308 | key_file=data_files/dir-maxpath/10.key" \ |
| 4309 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4310 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4311 | -s "X509 - A fatal error occurred" |
| 4312 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4313 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4314 | requires_full_size_output_buffer |
| 4315 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4316 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4317 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4318 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4319 | key_file=data_files/dir-maxpath/09.key" \ |
| 4320 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4321 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4322 | -S "X509 - A fatal error occurred" |
| 4323 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4324 | # Tests for certificate selection based on SHA verson |
| 4325 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4326 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4327 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4328 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4329 | key_file=data_files/server5.key \ |
| 4330 | crt_file2=data_files/server5-sha1.crt \ |
| 4331 | key_file2=data_files/server5.key" \ |
| 4332 | "$P_CLI force_version=tls1_2" \ |
| 4333 | 0 \ |
| 4334 | -c "signed using.*ECDSA with SHA256" \ |
| 4335 | -C "signed using.*ECDSA with SHA1" |
| 4336 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4337 | # tests for SNI |
| 4338 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4339 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4340 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4341 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4342 | 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] | 4343 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4344 | 0 \ |
| 4345 | -S "parse ServerName extension" \ |
| 4346 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4347 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4348 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4349 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4350 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4351 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4352 | 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] | 4353 | 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] | 4354 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4355 | 0 \ |
| 4356 | -s "parse ServerName extension" \ |
| 4357 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4358 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4359 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4360 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4361 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4362 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4363 | 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] | 4364 | 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] | 4365 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4366 | 0 \ |
| 4367 | -s "parse ServerName extension" \ |
| 4368 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4369 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4370 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4371 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4372 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4373 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4374 | 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] | 4375 | 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] | 4376 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4377 | 1 \ |
| 4378 | -s "parse ServerName extension" \ |
| 4379 | -s "ssl_sni_wrapper() returned" \ |
| 4380 | -s "mbedtls_ssl_handshake returned" \ |
| 4381 | -c "mbedtls_ssl_handshake returned" \ |
| 4382 | -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] | 4383 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4384 | run_test "SNI: client auth no override: optional" \ |
| 4385 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4386 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4387 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4388 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4389 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4390 | -S "skip write certificate request" \ |
| 4391 | -C "skip parse certificate request" \ |
| 4392 | -c "got a certificate request" \ |
| 4393 | -C "skip write certificate" \ |
| 4394 | -C "skip write certificate verify" \ |
| 4395 | -S "skip parse certificate verify" |
| 4396 | |
| 4397 | run_test "SNI: client auth override: none -> optional" \ |
| 4398 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4399 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4400 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4401 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4402 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4403 | -S "skip write certificate request" \ |
| 4404 | -C "skip parse certificate request" \ |
| 4405 | -c "got a certificate request" \ |
| 4406 | -C "skip write certificate" \ |
| 4407 | -C "skip write certificate verify" \ |
| 4408 | -S "skip parse certificate verify" |
| 4409 | |
| 4410 | run_test "SNI: client auth override: optional -> none" \ |
| 4411 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4412 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4413 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4414 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4415 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4416 | -s "skip write certificate request" \ |
| 4417 | -C "skip parse certificate request" \ |
| 4418 | -c "got no certificate request" \ |
| 4419 | -c "skip write certificate" \ |
| 4420 | -c "skip write certificate verify" \ |
| 4421 | -s "skip parse certificate verify" |
| 4422 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4423 | run_test "SNI: CA no override" \ |
| 4424 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4425 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4426 | ca_file=data_files/test-ca.crt \ |
| 4427 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4428 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4429 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4430 | 1 \ |
| 4431 | -S "skip write certificate request" \ |
| 4432 | -C "skip parse certificate request" \ |
| 4433 | -c "got a certificate request" \ |
| 4434 | -C "skip write certificate" \ |
| 4435 | -C "skip write certificate verify" \ |
| 4436 | -S "skip parse certificate verify" \ |
| 4437 | -s "x509_verify_cert() returned" \ |
| 4438 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4439 | -S "The certificate has been revoked (is on a CRL)" |
| 4440 | |
| 4441 | run_test "SNI: CA override" \ |
| 4442 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4443 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4444 | ca_file=data_files/test-ca.crt \ |
| 4445 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4446 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4447 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4448 | 0 \ |
| 4449 | -S "skip write certificate request" \ |
| 4450 | -C "skip parse certificate request" \ |
| 4451 | -c "got a certificate request" \ |
| 4452 | -C "skip write certificate" \ |
| 4453 | -C "skip write certificate verify" \ |
| 4454 | -S "skip parse certificate verify" \ |
| 4455 | -S "x509_verify_cert() returned" \ |
| 4456 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4457 | -S "The certificate has been revoked (is on a CRL)" |
| 4458 | |
| 4459 | run_test "SNI: CA override with CRL" \ |
| 4460 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4461 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4462 | ca_file=data_files/test-ca.crt \ |
| 4463 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4464 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4465 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4466 | 1 \ |
| 4467 | -S "skip write certificate request" \ |
| 4468 | -C "skip parse certificate request" \ |
| 4469 | -c "got a certificate request" \ |
| 4470 | -C "skip write certificate" \ |
| 4471 | -C "skip write certificate verify" \ |
| 4472 | -S "skip parse certificate verify" \ |
| 4473 | -s "x509_verify_cert() returned" \ |
| 4474 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4475 | -s "The certificate has been revoked (is on a CRL)" |
| 4476 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4477 | # Tests for SNI and DTLS |
| 4478 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4479 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4480 | run_test "SNI: DTLS, no SNI callback" \ |
| 4481 | "$P_SRV debug_level=3 dtls=1 \ |
| 4482 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4483 | "$P_CLI server_name=localhost dtls=1" \ |
| 4484 | 0 \ |
| 4485 | -S "parse ServerName extension" \ |
| 4486 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4487 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4488 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4489 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4490 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4491 | "$P_SRV debug_level=3 dtls=1 \ |
| 4492 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4493 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4494 | "$P_CLI server_name=localhost dtls=1" \ |
| 4495 | 0 \ |
| 4496 | -s "parse ServerName extension" \ |
| 4497 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4498 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4499 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4500 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4501 | run_test "SNI: DTLS, matching cert 2" \ |
| 4502 | "$P_SRV debug_level=3 dtls=1 \ |
| 4503 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4504 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4505 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4506 | 0 \ |
| 4507 | -s "parse ServerName extension" \ |
| 4508 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4509 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4510 | |
| 4511 | run_test "SNI: DTLS, no matching cert" \ |
| 4512 | "$P_SRV debug_level=3 dtls=1 \ |
| 4513 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4514 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4515 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4516 | 1 \ |
| 4517 | -s "parse ServerName extension" \ |
| 4518 | -s "ssl_sni_wrapper() returned" \ |
| 4519 | -s "mbedtls_ssl_handshake returned" \ |
| 4520 | -c "mbedtls_ssl_handshake returned" \ |
| 4521 | -c "SSL - A fatal alert message was received from our peer" |
| 4522 | |
| 4523 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4524 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4525 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4526 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4527 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4528 | 0 \ |
| 4529 | -S "skip write certificate request" \ |
| 4530 | -C "skip parse certificate request" \ |
| 4531 | -c "got a certificate request" \ |
| 4532 | -C "skip write certificate" \ |
| 4533 | -C "skip write certificate verify" \ |
| 4534 | -S "skip parse certificate verify" |
| 4535 | |
| 4536 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4537 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4538 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4539 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4540 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4541 | 0 \ |
| 4542 | -S "skip write certificate request" \ |
| 4543 | -C "skip parse certificate request" \ |
| 4544 | -c "got a certificate request" \ |
| 4545 | -C "skip write certificate" \ |
| 4546 | -C "skip write certificate verify" \ |
| 4547 | -S "skip parse certificate verify" |
| 4548 | |
| 4549 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4550 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4551 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4552 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4553 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4554 | 0 \ |
| 4555 | -s "skip write certificate request" \ |
| 4556 | -C "skip parse certificate request" \ |
| 4557 | -c "got no certificate request" \ |
| 4558 | -c "skip write certificate" \ |
| 4559 | -c "skip write certificate verify" \ |
| 4560 | -s "skip parse certificate verify" |
| 4561 | |
| 4562 | run_test "SNI: DTLS, CA no override" \ |
| 4563 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4564 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4565 | ca_file=data_files/test-ca.crt \ |
| 4566 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4567 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4568 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4569 | 1 \ |
| 4570 | -S "skip write certificate request" \ |
| 4571 | -C "skip parse certificate request" \ |
| 4572 | -c "got a certificate request" \ |
| 4573 | -C "skip write certificate" \ |
| 4574 | -C "skip write certificate verify" \ |
| 4575 | -S "skip parse certificate verify" \ |
| 4576 | -s "x509_verify_cert() returned" \ |
| 4577 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4578 | -S "The certificate has been revoked (is on a CRL)" |
| 4579 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4580 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4581 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4582 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4583 | ca_file=data_files/test-ca.crt \ |
| 4584 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4585 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4586 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4587 | 0 \ |
| 4588 | -S "skip write certificate request" \ |
| 4589 | -C "skip parse certificate request" \ |
| 4590 | -c "got a certificate request" \ |
| 4591 | -C "skip write certificate" \ |
| 4592 | -C "skip write certificate verify" \ |
| 4593 | -S "skip parse certificate verify" \ |
| 4594 | -S "x509_verify_cert() returned" \ |
| 4595 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4596 | -S "The certificate has been revoked (is on a CRL)" |
| 4597 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4598 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4599 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4600 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4601 | ca_file=data_files/test-ca.crt \ |
| 4602 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4603 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4604 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4605 | 1 \ |
| 4606 | -S "skip write certificate request" \ |
| 4607 | -C "skip parse certificate request" \ |
| 4608 | -c "got a certificate request" \ |
| 4609 | -C "skip write certificate" \ |
| 4610 | -C "skip write certificate verify" \ |
| 4611 | -S "skip parse certificate verify" \ |
| 4612 | -s "x509_verify_cert() returned" \ |
| 4613 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4614 | -s "The certificate has been revoked (is on a CRL)" |
| 4615 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4616 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4617 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4618 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4619 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4620 | "$P_CLI nbio=2 tickets=0" \ |
| 4621 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4622 | -S "mbedtls_ssl_handshake returned" \ |
| 4623 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4624 | -c "Read from server: .* bytes read" |
| 4625 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4626 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4627 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4628 | "$P_CLI nbio=2 tickets=0" \ |
| 4629 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4630 | -S "mbedtls_ssl_handshake returned" \ |
| 4631 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4632 | -c "Read from server: .* bytes read" |
| 4633 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4634 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4635 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4636 | "$P_CLI nbio=2 tickets=1" \ |
| 4637 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4638 | -S "mbedtls_ssl_handshake returned" \ |
| 4639 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4640 | -c "Read from server: .* bytes read" |
| 4641 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4642 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4643 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4644 | "$P_CLI nbio=2 tickets=1" \ |
| 4645 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4646 | -S "mbedtls_ssl_handshake returned" \ |
| 4647 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4648 | -c "Read from server: .* bytes read" |
| 4649 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4650 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4651 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4652 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4653 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4654 | -S "mbedtls_ssl_handshake returned" \ |
| 4655 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4656 | -c "Read from server: .* bytes read" |
| 4657 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4658 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4659 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4660 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4661 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4662 | -S "mbedtls_ssl_handshake returned" \ |
| 4663 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4664 | -c "Read from server: .* bytes read" |
| 4665 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4666 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4667 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4668 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4669 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4670 | -S "mbedtls_ssl_handshake returned" \ |
| 4671 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4672 | -c "Read from server: .* bytes read" |
| 4673 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4674 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4675 | |
| 4676 | run_test "Event-driven I/O: basic handshake" \ |
| 4677 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4678 | "$P_CLI event=1 tickets=0" \ |
| 4679 | 0 \ |
| 4680 | -S "mbedtls_ssl_handshake returned" \ |
| 4681 | -C "mbedtls_ssl_handshake returned" \ |
| 4682 | -c "Read from server: .* bytes read" |
| 4683 | |
| 4684 | run_test "Event-driven I/O: client auth" \ |
| 4685 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4686 | "$P_CLI event=1 tickets=0" \ |
| 4687 | 0 \ |
| 4688 | -S "mbedtls_ssl_handshake returned" \ |
| 4689 | -C "mbedtls_ssl_handshake returned" \ |
| 4690 | -c "Read from server: .* bytes read" |
| 4691 | |
| 4692 | run_test "Event-driven I/O: ticket" \ |
| 4693 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4694 | "$P_CLI event=1 tickets=1" \ |
| 4695 | 0 \ |
| 4696 | -S "mbedtls_ssl_handshake returned" \ |
| 4697 | -C "mbedtls_ssl_handshake returned" \ |
| 4698 | -c "Read from server: .* bytes read" |
| 4699 | |
| 4700 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4701 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4702 | "$P_CLI event=1 tickets=1" \ |
| 4703 | 0 \ |
| 4704 | -S "mbedtls_ssl_handshake returned" \ |
| 4705 | -C "mbedtls_ssl_handshake returned" \ |
| 4706 | -c "Read from server: .* bytes read" |
| 4707 | |
| 4708 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4709 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4710 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4711 | 0 \ |
| 4712 | -S "mbedtls_ssl_handshake returned" \ |
| 4713 | -C "mbedtls_ssl_handshake returned" \ |
| 4714 | -c "Read from server: .* bytes read" |
| 4715 | |
| 4716 | run_test "Event-driven I/O: ticket + resume" \ |
| 4717 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4718 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4719 | 0 \ |
| 4720 | -S "mbedtls_ssl_handshake returned" \ |
| 4721 | -C "mbedtls_ssl_handshake returned" \ |
| 4722 | -c "Read from server: .* bytes read" |
| 4723 | |
| 4724 | run_test "Event-driven I/O: session-id resume" \ |
| 4725 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4726 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4727 | 0 \ |
| 4728 | -S "mbedtls_ssl_handshake returned" \ |
| 4729 | -C "mbedtls_ssl_handshake returned" \ |
| 4730 | -c "Read from server: .* bytes read" |
| 4731 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4732 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4733 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4734 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4735 | 0 \ |
| 4736 | -c "Read from server: .* bytes read" |
| 4737 | |
| 4738 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4739 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4740 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4741 | 0 \ |
| 4742 | -c "Read from server: .* bytes read" |
| 4743 | |
| 4744 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4745 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4746 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4747 | 0 \ |
| 4748 | -c "Read from server: .* bytes read" |
| 4749 | |
| 4750 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4751 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4752 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4753 | 0 \ |
| 4754 | -c "Read from server: .* bytes read" |
| 4755 | |
| 4756 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4757 | "$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] | 4758 | "$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] | 4759 | 0 \ |
| 4760 | -c "Read from server: .* bytes read" |
| 4761 | |
| 4762 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4763 | "$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] | 4764 | "$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] | 4765 | 0 \ |
| 4766 | -c "Read from server: .* bytes read" |
| 4767 | |
| 4768 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4769 | "$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] | 4770 | "$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] | 4771 | 0 \ |
| 4772 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4773 | |
| 4774 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4775 | # During session resumption, the client will send its ApplicationData record |
| 4776 | # within the same datagram as the Finished messages. In this situation, the |
| 4777 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4778 | # because the ApplicationData request has already been queued internally. |
| 4779 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4780 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4781 | "$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] | 4782 | "$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] | 4783 | 0 \ |
| 4784 | -c "Read from server: .* bytes read" |
| 4785 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4786 | # Tests for version negotiation |
| 4787 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4788 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4789 | "$P_SRV" \ |
| 4790 | "$P_CLI" \ |
| 4791 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4792 | -S "mbedtls_ssl_handshake returned" \ |
| 4793 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4794 | -s "Protocol is TLSv1.2" \ |
| 4795 | -c "Protocol is TLSv1.2" |
| 4796 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4797 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4798 | "$P_SRV" \ |
| 4799 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4800 | 1 \ |
| 4801 | -s "Handshake protocol not within min/max boundaries" \ |
| 4802 | -c "Error in protocol version" \ |
| 4803 | -S "Protocol is TLSv1.0" \ |
| 4804 | -C "Handshake was completed" |
| 4805 | |
| 4806 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4807 | "$P_SRV" \ |
| 4808 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4809 | 1 \ |
| 4810 | -s "Handshake protocol not within min/max boundaries" \ |
| 4811 | -c "Error in protocol version" \ |
| 4812 | -S "Protocol is TLSv1.1" \ |
| 4813 | -C "Handshake was completed" |
| 4814 | |
| 4815 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 4816 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 4817 | "$P_CLI" \ |
| 4818 | 1 \ |
| 4819 | -s "Error in protocol version" \ |
| 4820 | -c "Handshake protocol not within min/max boundaries" \ |
| 4821 | -S "Version: TLS1.0" \ |
| 4822 | -C "Protocol is TLSv1.0" |
| 4823 | |
| 4824 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 4825 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 4826 | "$P_CLI" \ |
| 4827 | 1 \ |
| 4828 | -s "Error in protocol version" \ |
| 4829 | -c "Handshake protocol not within min/max boundaries" \ |
| 4830 | -S "Version: TLS1.1" \ |
| 4831 | -C "Protocol is TLSv1.1" |
| 4832 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4833 | # Tests for ALPN extension |
| 4834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4835 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4836 | "$P_SRV debug_level=3" \ |
| 4837 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4838 | 0 \ |
| 4839 | -C "client hello, adding alpn extension" \ |
| 4840 | -S "found alpn extension" \ |
| 4841 | -C "got an alert message, type: \\[2:120]" \ |
| 4842 | -S "server hello, adding alpn extension" \ |
| 4843 | -C "found alpn extension " \ |
| 4844 | -C "Application Layer Protocol is" \ |
| 4845 | -S "Application Layer Protocol is" |
| 4846 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4847 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4848 | "$P_SRV debug_level=3" \ |
| 4849 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4850 | 0 \ |
| 4851 | -c "client hello, adding alpn extension" \ |
| 4852 | -s "found alpn extension" \ |
| 4853 | -C "got an alert message, type: \\[2:120]" \ |
| 4854 | -S "server hello, adding alpn extension" \ |
| 4855 | -C "found alpn extension " \ |
| 4856 | -c "Application Layer Protocol is (none)" \ |
| 4857 | -S "Application Layer Protocol is" |
| 4858 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4859 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4860 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4861 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4862 | 0 \ |
| 4863 | -C "client hello, adding alpn extension" \ |
| 4864 | -S "found alpn extension" \ |
| 4865 | -C "got an alert message, type: \\[2:120]" \ |
| 4866 | -S "server hello, adding alpn extension" \ |
| 4867 | -C "found alpn extension " \ |
| 4868 | -C "Application Layer Protocol is" \ |
| 4869 | -s "Application Layer Protocol is (none)" |
| 4870 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4871 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4872 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4873 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4874 | 0 \ |
| 4875 | -c "client hello, adding alpn extension" \ |
| 4876 | -s "found alpn extension" \ |
| 4877 | -C "got an alert message, type: \\[2:120]" \ |
| 4878 | -s "server hello, adding alpn extension" \ |
| 4879 | -c "found alpn extension" \ |
| 4880 | -c "Application Layer Protocol is abc" \ |
| 4881 | -s "Application Layer Protocol is abc" |
| 4882 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4883 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4884 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4885 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4886 | 0 \ |
| 4887 | -c "client hello, adding alpn extension" \ |
| 4888 | -s "found alpn extension" \ |
| 4889 | -C "got an alert message, type: \\[2:120]" \ |
| 4890 | -s "server hello, adding alpn extension" \ |
| 4891 | -c "found alpn extension" \ |
| 4892 | -c "Application Layer Protocol is abc" \ |
| 4893 | -s "Application Layer Protocol is abc" |
| 4894 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4895 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4896 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4897 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4898 | 0 \ |
| 4899 | -c "client hello, adding alpn extension" \ |
| 4900 | -s "found alpn extension" \ |
| 4901 | -C "got an alert message, type: \\[2:120]" \ |
| 4902 | -s "server hello, adding alpn extension" \ |
| 4903 | -c "found alpn extension" \ |
| 4904 | -c "Application Layer Protocol is 1234" \ |
| 4905 | -s "Application Layer Protocol is 1234" |
| 4906 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4907 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4908 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4909 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4910 | 1 \ |
| 4911 | -c "client hello, adding alpn extension" \ |
| 4912 | -s "found alpn extension" \ |
| 4913 | -c "got an alert message, type: \\[2:120]" \ |
| 4914 | -S "server hello, adding alpn extension" \ |
| 4915 | -C "found alpn extension" \ |
| 4916 | -C "Application Layer Protocol is 1234" \ |
| 4917 | -S "Application Layer Protocol is 1234" |
| 4918 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4919 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4920 | # Tests for keyUsage in leaf certificates, part 1: |
| 4921 | # server-side certificate/suite selection |
| 4922 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4923 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4924 | "$P_SRV key_file=data_files/server2.key \ |
| 4925 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4926 | "$P_CLI" \ |
| 4927 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4928 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4929 | |
| 4930 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4931 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4932 | "$P_SRV key_file=data_files/server2.key \ |
| 4933 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4934 | "$P_CLI" \ |
| 4935 | 0 \ |
| 4936 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4937 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4938 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4939 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4940 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4941 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4942 | 1 \ |
| 4943 | -C "Ciphersuite is " |
| 4944 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4945 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4946 | "$P_SRV key_file=data_files/server5.key \ |
| 4947 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4948 | "$P_CLI" \ |
| 4949 | 0 \ |
| 4950 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4951 | |
| 4952 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4953 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4954 | "$P_SRV key_file=data_files/server5.key \ |
| 4955 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4956 | "$P_CLI" \ |
| 4957 | 0 \ |
| 4958 | -c "Ciphersuite is TLS-ECDH-" |
| 4959 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4960 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4961 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4962 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4963 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4964 | 1 \ |
| 4965 | -C "Ciphersuite is " |
| 4966 | |
| 4967 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4968 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4969 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4970 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4971 | "$O_SRV -key data_files/server2.key \ |
| 4972 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4973 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4974 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4975 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4976 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4977 | -C "Processing of the Certificate handshake message failed" \ |
| 4978 | -c "Ciphersuite is TLS-" |
| 4979 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4980 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4981 | "$O_SRV -key data_files/server2.key \ |
| 4982 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4983 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4984 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4985 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4986 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4987 | -C "Processing of the Certificate handshake message failed" \ |
| 4988 | -c "Ciphersuite is TLS-" |
| 4989 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4990 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4991 | "$O_SRV -key data_files/server2.key \ |
| 4992 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4993 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4994 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4995 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4996 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4997 | -C "Processing of the Certificate handshake message failed" \ |
| 4998 | -c "Ciphersuite is TLS-" |
| 4999 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5000 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5001 | "$O_SRV -key data_files/server2.key \ |
| 5002 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5003 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5004 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5005 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5006 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5007 | -c "Processing of the Certificate handshake message failed" \ |
| 5008 | -C "Ciphersuite is TLS-" |
| 5009 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5010 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5011 | "$O_SRV -key data_files/server2.key \ |
| 5012 | -cert data_files/server2.ku-ke.crt" \ |
| 5013 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5014 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5015 | 0 \ |
| 5016 | -c "bad certificate (usage extensions)" \ |
| 5017 | -C "Processing of the Certificate handshake message failed" \ |
| 5018 | -c "Ciphersuite is TLS-" \ |
| 5019 | -c "! Usage does not match the keyUsage extension" |
| 5020 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5021 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5022 | "$O_SRV -key data_files/server2.key \ |
| 5023 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5024 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5025 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5026 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5027 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5028 | -C "Processing of the Certificate handshake message failed" \ |
| 5029 | -c "Ciphersuite is TLS-" |
| 5030 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5031 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5032 | "$O_SRV -key data_files/server2.key \ |
| 5033 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5034 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5035 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5036 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5037 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5038 | -c "Processing of the Certificate handshake message failed" \ |
| 5039 | -C "Ciphersuite is TLS-" |
| 5040 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5041 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5042 | "$O_SRV -key data_files/server2.key \ |
| 5043 | -cert data_files/server2.ku-ds.crt" \ |
| 5044 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5045 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5046 | 0 \ |
| 5047 | -c "bad certificate (usage extensions)" \ |
| 5048 | -C "Processing of the Certificate handshake message failed" \ |
| 5049 | -c "Ciphersuite is TLS-" \ |
| 5050 | -c "! Usage does not match the keyUsage extension" |
| 5051 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5052 | # Tests for keyUsage in leaf certificates, part 3: |
| 5053 | # server-side checking of client cert |
| 5054 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5055 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5056 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5057 | "$O_CLI -key data_files/server2.key \ |
| 5058 | -cert data_files/server2.ku-ds.crt" \ |
| 5059 | 0 \ |
| 5060 | -S "bad certificate (usage extensions)" \ |
| 5061 | -S "Processing of the Certificate handshake message failed" |
| 5062 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5063 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5064 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5065 | "$O_CLI -key data_files/server2.key \ |
| 5066 | -cert data_files/server2.ku-ke.crt" \ |
| 5067 | 0 \ |
| 5068 | -s "bad certificate (usage extensions)" \ |
| 5069 | -S "Processing of the Certificate handshake message failed" |
| 5070 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5071 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5072 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5073 | "$O_CLI -key data_files/server2.key \ |
| 5074 | -cert data_files/server2.ku-ke.crt" \ |
| 5075 | 1 \ |
| 5076 | -s "bad certificate (usage extensions)" \ |
| 5077 | -s "Processing of the Certificate handshake message failed" |
| 5078 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5079 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5080 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5081 | "$O_CLI -key data_files/server5.key \ |
| 5082 | -cert data_files/server5.ku-ds.crt" \ |
| 5083 | 0 \ |
| 5084 | -S "bad certificate (usage extensions)" \ |
| 5085 | -S "Processing of the Certificate handshake message failed" |
| 5086 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5087 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5088 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5089 | "$O_CLI -key data_files/server5.key \ |
| 5090 | -cert data_files/server5.ku-ka.crt" \ |
| 5091 | 0 \ |
| 5092 | -s "bad certificate (usage extensions)" \ |
| 5093 | -S "Processing of the Certificate handshake message failed" |
| 5094 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5095 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5096 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5097 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5098 | "$P_SRV key_file=data_files/server5.key \ |
| 5099 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5100 | "$P_CLI" \ |
| 5101 | 0 |
| 5102 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5103 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5104 | "$P_SRV key_file=data_files/server5.key \ |
| 5105 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5106 | "$P_CLI" \ |
| 5107 | 0 |
| 5108 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5109 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5110 | "$P_SRV key_file=data_files/server5.key \ |
| 5111 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5112 | "$P_CLI" \ |
| 5113 | 0 |
| 5114 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5115 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5116 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5117 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5118 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5119 | 1 |
| 5120 | |
| 5121 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5122 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5123 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5124 | "$O_SRV -key data_files/server5.key \ |
| 5125 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5126 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5127 | 0 \ |
| 5128 | -C "bad certificate (usage extensions)" \ |
| 5129 | -C "Processing of the Certificate handshake message failed" \ |
| 5130 | -c "Ciphersuite is TLS-" |
| 5131 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5132 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5133 | "$O_SRV -key data_files/server5.key \ |
| 5134 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5135 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5136 | 0 \ |
| 5137 | -C "bad certificate (usage extensions)" \ |
| 5138 | -C "Processing of the Certificate handshake message failed" \ |
| 5139 | -c "Ciphersuite is TLS-" |
| 5140 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5141 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5142 | "$O_SRV -key data_files/server5.key \ |
| 5143 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5144 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5145 | 0 \ |
| 5146 | -C "bad certificate (usage extensions)" \ |
| 5147 | -C "Processing of the Certificate handshake message failed" \ |
| 5148 | -c "Ciphersuite is TLS-" |
| 5149 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5150 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5151 | "$O_SRV -key data_files/server5.key \ |
| 5152 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5153 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5154 | 1 \ |
| 5155 | -c "bad certificate (usage extensions)" \ |
| 5156 | -c "Processing of the Certificate handshake message failed" \ |
| 5157 | -C "Ciphersuite is TLS-" |
| 5158 | |
| 5159 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5161 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5162 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5163 | "$O_CLI -key data_files/server5.key \ |
| 5164 | -cert data_files/server5.eku-cli.crt" \ |
| 5165 | 0 \ |
| 5166 | -S "bad certificate (usage extensions)" \ |
| 5167 | -S "Processing of the Certificate handshake message failed" |
| 5168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5169 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5170 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5171 | "$O_CLI -key data_files/server5.key \ |
| 5172 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5173 | 0 \ |
| 5174 | -S "bad certificate (usage extensions)" \ |
| 5175 | -S "Processing of the Certificate handshake message failed" |
| 5176 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5177 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5178 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5179 | "$O_CLI -key data_files/server5.key \ |
| 5180 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5181 | 0 \ |
| 5182 | -S "bad certificate (usage extensions)" \ |
| 5183 | -S "Processing of the Certificate handshake message failed" |
| 5184 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5185 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5186 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5187 | "$O_CLI -key data_files/server5.key \ |
| 5188 | -cert data_files/server5.eku-cs.crt" \ |
| 5189 | 0 \ |
| 5190 | -s "bad certificate (usage extensions)" \ |
| 5191 | -S "Processing of the Certificate handshake message failed" |
| 5192 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5193 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5194 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5195 | "$O_CLI -key data_files/server5.key \ |
| 5196 | -cert data_files/server5.eku-cs.crt" \ |
| 5197 | 1 \ |
| 5198 | -s "bad certificate (usage extensions)" \ |
| 5199 | -s "Processing of the Certificate handshake message failed" |
| 5200 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5201 | # Tests for DHM parameters loading |
| 5202 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5203 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5204 | "$P_SRV" \ |
| 5205 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5206 | debug_level=3" \ |
| 5207 | 0 \ |
| 5208 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5209 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5210 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5211 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5212 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5213 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5214 | debug_level=3" \ |
| 5215 | 0 \ |
| 5216 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5217 | -c "value of 'DHM: G ' (2 bits)" |
| 5218 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5219 | # Tests for DHM client-side size checking |
| 5220 | |
| 5221 | run_test "DHM size: server default, client default, OK" \ |
| 5222 | "$P_SRV" \ |
| 5223 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5224 | debug_level=1" \ |
| 5225 | 0 \ |
| 5226 | -C "DHM prime too short:" |
| 5227 | |
| 5228 | run_test "DHM size: server default, client 2048, OK" \ |
| 5229 | "$P_SRV" \ |
| 5230 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5231 | debug_level=1 dhmlen=2048" \ |
| 5232 | 0 \ |
| 5233 | -C "DHM prime too short:" |
| 5234 | |
| 5235 | run_test "DHM size: server 1024, client default, OK" \ |
| 5236 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5237 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5238 | debug_level=1" \ |
| 5239 | 0 \ |
| 5240 | -C "DHM prime too short:" |
| 5241 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5242 | run_test "DHM size: server 999, client 999, OK" \ |
| 5243 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5244 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5245 | debug_level=1 dhmlen=999" \ |
| 5246 | 0 \ |
| 5247 | -C "DHM prime too short:" |
| 5248 | |
| 5249 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5250 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5251 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5252 | debug_level=1 dhmlen=1000" \ |
| 5253 | 0 \ |
| 5254 | -C "DHM prime too short:" |
| 5255 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5256 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5257 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5258 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5259 | debug_level=1" \ |
| 5260 | 1 \ |
| 5261 | -c "DHM prime too short:" |
| 5262 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5263 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5264 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5265 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5266 | debug_level=1 dhmlen=1001" \ |
| 5267 | 1 \ |
| 5268 | -c "DHM prime too short:" |
| 5269 | |
| 5270 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5271 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5272 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5273 | debug_level=1 dhmlen=1000" \ |
| 5274 | 1 \ |
| 5275 | -c "DHM prime too short:" |
| 5276 | |
| 5277 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5278 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5279 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5280 | debug_level=1 dhmlen=999" \ |
| 5281 | 1 \ |
| 5282 | -c "DHM prime too short:" |
| 5283 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5284 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5285 | "$P_SRV" \ |
| 5286 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5287 | debug_level=1 dhmlen=2049" \ |
| 5288 | 1 \ |
| 5289 | -c "DHM prime too short:" |
| 5290 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5291 | # Tests for PSK callback |
| 5292 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5293 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5294 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5295 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5296 | psk_identity=foo psk=abc123" \ |
| 5297 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5298 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5299 | -S "SSL - Unknown identity received" \ |
| 5300 | -S "SSL - Verification of the message MAC failed" |
| 5301 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5302 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5303 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5304 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5305 | "$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] | 5306 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5307 | 0 \ |
| 5308 | -c "skip PMS generation for opaque PSK"\ |
| 5309 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5310 | -C "session hash for extended master secret"\ |
| 5311 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5312 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5313 | -S "SSL - Unknown identity received" \ |
| 5314 | -S "SSL - Verification of the message MAC failed" |
| 5315 | |
| 5316 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5317 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5318 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5319 | "$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] | 5320 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5321 | 0 \ |
| 5322 | -c "skip PMS generation for opaque PSK"\ |
| 5323 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5324 | -C "session hash for extended master secret"\ |
| 5325 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5326 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5327 | -S "SSL - Unknown identity received" \ |
| 5328 | -S "SSL - Verification of the message MAC failed" |
| 5329 | |
| 5330 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5331 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5332 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5333 | "$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] | 5334 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5335 | 0 \ |
| 5336 | -c "skip PMS generation for opaque PSK"\ |
| 5337 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5338 | -c "session hash for extended master secret"\ |
| 5339 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5340 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5341 | -S "SSL - Unknown identity received" \ |
| 5342 | -S "SSL - Verification of the message MAC failed" |
| 5343 | |
| 5344 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5345 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5346 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5347 | "$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] | 5348 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5349 | 0 \ |
| 5350 | -c "skip PMS generation for opaque PSK"\ |
| 5351 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5352 | -c "session hash for extended master secret"\ |
| 5353 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5354 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5355 | -S "SSL - Unknown identity received" \ |
| 5356 | -S "SSL - Verification of the message MAC failed" |
| 5357 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5358 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5359 | 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] | 5360 | "$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] | 5361 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5362 | psk_identity=foo psk=abc123" \ |
| 5363 | 0 \ |
| 5364 | -C "skip PMS generation for opaque PSK"\ |
| 5365 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5366 | -C "session hash for extended master secret"\ |
| 5367 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5368 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5369 | -S "SSL - Unknown identity received" \ |
| 5370 | -S "SSL - Verification of the message MAC failed" |
| 5371 | |
| 5372 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5373 | 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] | 5374 | "$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] | 5375 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5376 | psk_identity=foo psk=abc123" \ |
| 5377 | 0 \ |
| 5378 | -C "skip PMS generation for opaque PSK"\ |
| 5379 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5380 | -C "session hash for extended master secret"\ |
| 5381 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5382 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5383 | -S "SSL - Unknown identity received" \ |
| 5384 | -S "SSL - Verification of the message MAC failed" |
| 5385 | |
| 5386 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5387 | 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] | 5388 | "$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] | 5389 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5390 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5391 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5392 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5393 | -c "session hash for extended master secret"\ |
| 5394 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5395 | -C "skip PMS generation for opaque PSK"\ |
| 5396 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5397 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5398 | -S "SSL - Unknown identity received" \ |
| 5399 | -S "SSL - Verification of the message MAC failed" |
| 5400 | |
| 5401 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5402 | 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] | 5403 | "$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] | 5404 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5405 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5406 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5407 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5408 | -c "session hash for extended master secret"\ |
| 5409 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5410 | -C "skip PMS generation for opaque PSK"\ |
| 5411 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5412 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5413 | -S "SSL - Unknown identity received" \ |
| 5414 | -S "SSL - Verification of the message MAC failed" |
| 5415 | |
| 5416 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5417 | 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] | 5418 | "$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] | 5419 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5420 | psk_identity=def psk=beef" \ |
| 5421 | 0 \ |
| 5422 | -C "skip PMS generation for opaque PSK"\ |
| 5423 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5424 | -C "session hash for extended master secret"\ |
| 5425 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5426 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5427 | -S "SSL - Unknown identity received" \ |
| 5428 | -S "SSL - Verification of the message MAC failed" |
| 5429 | |
| 5430 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5431 | 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] | 5432 | "$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] | 5433 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5434 | psk_identity=def psk=beef" \ |
| 5435 | 0 \ |
| 5436 | -C "skip PMS generation for opaque PSK"\ |
| 5437 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5438 | -C "session hash for extended master secret"\ |
| 5439 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5440 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5441 | -S "SSL - Unknown identity received" \ |
| 5442 | -S "SSL - Verification of the message MAC failed" |
| 5443 | |
| 5444 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5445 | 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] | 5446 | "$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] | 5447 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5448 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5449 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5450 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5451 | -c "session hash for extended master secret"\ |
| 5452 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5453 | -C "skip PMS generation for opaque PSK"\ |
| 5454 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5455 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5456 | -S "SSL - Unknown identity received" \ |
| 5457 | -S "SSL - Verification of the message MAC failed" |
| 5458 | |
| 5459 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5460 | 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] | 5461 | "$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] | 5462 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5463 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5464 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5465 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5466 | -c "session hash for extended master secret"\ |
| 5467 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5468 | -C "skip PMS generation for opaque PSK"\ |
| 5469 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5470 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5471 | -S "SSL - Unknown identity received" \ |
| 5472 | -S "SSL - Verification of the message MAC failed" |
| 5473 | |
| 5474 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5475 | 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] | 5476 | "$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] | 5477 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5478 | psk_identity=def psk=beef" \ |
| 5479 | 0 \ |
| 5480 | -C "skip PMS generation for opaque PSK"\ |
| 5481 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5482 | -C "session hash for extended master secret"\ |
| 5483 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5484 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5485 | -S "SSL - Unknown identity received" \ |
| 5486 | -S "SSL - Verification of the message MAC failed" |
| 5487 | |
| 5488 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5489 | 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] | 5490 | "$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] | 5491 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5492 | psk_identity=def psk=beef" \ |
| 5493 | 0 \ |
| 5494 | -C "skip PMS generation for opaque PSK"\ |
| 5495 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5496 | -C "session hash for extended master secret"\ |
| 5497 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5498 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5499 | -S "SSL - Unknown identity received" \ |
| 5500 | -S "SSL - Verification of the message MAC failed" |
| 5501 | |
| 5502 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5503 | 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] | 5504 | "$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] | 5505 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5506 | psk_identity=def psk=beef" \ |
| 5507 | 0 \ |
| 5508 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5509 | -C "session hash for extended master secret"\ |
| 5510 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5511 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5512 | -S "SSL - Unknown identity received" \ |
| 5513 | -S "SSL - Verification of the message MAC failed" |
| 5514 | |
| 5515 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5516 | 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] | 5517 | "$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] | 5518 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5519 | psk_identity=def psk=beef" \ |
| 5520 | 0 \ |
| 5521 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5522 | -C "session hash for extended master secret"\ |
| 5523 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5524 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5525 | -S "SSL - Unknown identity received" \ |
| 5526 | -S "SSL - Verification of the message MAC failed" |
| 5527 | |
| 5528 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5529 | 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] | 5530 | "$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] | 5531 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5532 | psk_identity=def psk=beef" \ |
| 5533 | 1 \ |
| 5534 | -s "SSL - Verification of the message MAC failed" |
| 5535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5536 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5537 | "$P_SRV" \ |
| 5538 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5539 | psk_identity=foo psk=abc123" \ |
| 5540 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5541 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5542 | -S "SSL - Unknown identity received" \ |
| 5543 | -S "SSL - Verification of the message MAC failed" |
| 5544 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5545 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5546 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5547 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5548 | psk_identity=foo psk=abc123" \ |
| 5549 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5550 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5551 | -s "SSL - Unknown identity received" \ |
| 5552 | -S "SSL - Verification of the message MAC failed" |
| 5553 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5554 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5555 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5556 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5557 | psk_identity=abc psk=dead" \ |
| 5558 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5559 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5560 | -S "SSL - Unknown identity received" \ |
| 5561 | -S "SSL - Verification of the message MAC failed" |
| 5562 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5563 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5564 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5565 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5566 | psk_identity=def psk=beef" \ |
| 5567 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5568 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5569 | -S "SSL - Unknown identity received" \ |
| 5570 | -S "SSL - Verification of the message MAC failed" |
| 5571 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5572 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5573 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5574 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5575 | psk_identity=ghi psk=beef" \ |
| 5576 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5577 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5578 | -s "SSL - Unknown identity received" \ |
| 5579 | -S "SSL - Verification of the message MAC failed" |
| 5580 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5581 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5582 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5583 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5584 | psk_identity=abc psk=beef" \ |
| 5585 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5586 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5587 | -S "SSL - Unknown identity received" \ |
| 5588 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5589 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5590 | # Tests for EC J-PAKE |
| 5591 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5592 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5593 | run_test "ECJPAKE: client not configured" \ |
| 5594 | "$P_SRV debug_level=3" \ |
| 5595 | "$P_CLI debug_level=3" \ |
| 5596 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5597 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5598 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5599 | -S "found ecjpake kkpp extension" \ |
| 5600 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5601 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5602 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5603 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5604 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5605 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5606 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5607 | run_test "ECJPAKE: server not configured" \ |
| 5608 | "$P_SRV debug_level=3" \ |
| 5609 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5610 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5611 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5612 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5613 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5614 | -s "found ecjpake kkpp extension" \ |
| 5615 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5616 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5617 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5618 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5619 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5620 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5621 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5622 | run_test "ECJPAKE: working, TLS" \ |
| 5623 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5624 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5625 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5626 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5627 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5628 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5629 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5630 | -s "found ecjpake kkpp extension" \ |
| 5631 | -S "skip ecjpake kkpp extension" \ |
| 5632 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5633 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5634 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5635 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5636 | -S "SSL - Verification of the message MAC failed" |
| 5637 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5638 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5639 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5640 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5641 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5642 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5643 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5644 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5645 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5646 | -s "SSL - Verification of the message MAC failed" |
| 5647 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5648 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5649 | run_test "ECJPAKE: working, DTLS" \ |
| 5650 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5651 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5652 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5653 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5654 | -c "re-using cached ecjpake parameters" \ |
| 5655 | -S "SSL - Verification of the message MAC failed" |
| 5656 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5657 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5658 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5659 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5660 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5661 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5662 | 0 \ |
| 5663 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5664 | -S "SSL - Verification of the message MAC failed" |
| 5665 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5666 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5667 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5668 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5669 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5670 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5671 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5672 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5673 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5674 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5675 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5676 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5677 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5678 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5679 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5680 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5681 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5682 | 0 |
| 5683 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5684 | # Test for ClientHello without extensions |
| 5685 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5686 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5687 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5688 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5689 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5690 | 0 \ |
| 5691 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5692 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5693 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5694 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5695 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5696 | "$P_SRV" \ |
| 5697 | "$P_CLI request_size=100" \ |
| 5698 | 0 \ |
| 5699 | -s "Read from client: 100 bytes read$" |
| 5700 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5701 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5702 | "$P_SRV" \ |
| 5703 | "$P_CLI request_size=500" \ |
| 5704 | 0 \ |
| 5705 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5706 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5707 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5708 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5709 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5710 | "$P_SRV" \ |
| 5711 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5712 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5713 | 0 \ |
| 5714 | -s "Read from client: 1 bytes read" |
| 5715 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5716 | 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] | 5717 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5718 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5719 | 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] | 5720 | 0 \ |
| 5721 | -s "Read from client: 1 bytes read" |
| 5722 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5723 | 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] | 5724 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5725 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5726 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5727 | 0 \ |
| 5728 | -s "Read from client: 1 bytes read" |
| 5729 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5730 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5731 | "$P_SRV" \ |
| 5732 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5733 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5734 | 0 \ |
| 5735 | -s "Read from client: 1 bytes read" |
| 5736 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5737 | 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] | 5738 | "$P_SRV" \ |
| 5739 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5740 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5741 | 0 \ |
| 5742 | -s "Read from client: 1 bytes read" |
| 5743 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5744 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5745 | |
| 5746 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5747 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5748 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5749 | "$P_CLI dtls=1 request_size=1 \ |
| 5750 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5751 | 0 \ |
| 5752 | -s "Read from client: 1 bytes read" |
| 5753 | |
| 5754 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5755 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5756 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5757 | "$P_CLI dtls=1 request_size=1 \ |
| 5758 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5759 | 0 \ |
| 5760 | -s "Read from client: 1 bytes read" |
| 5761 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5762 | # Tests for small server packets |
| 5763 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5764 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5765 | "$P_SRV response_size=1" \ |
| 5766 | "$P_CLI force_version=tls1_2 \ |
| 5767 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5768 | 0 \ |
| 5769 | -c "Read from server: 1 bytes read" |
| 5770 | |
| 5771 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5772 | "$P_SRV response_size=1" \ |
| 5773 | "$P_CLI force_version=tls1_2 \ |
| 5774 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5775 | 0 \ |
| 5776 | -c "Read from server: 1 bytes read" |
| 5777 | |
| 5778 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5779 | "$P_SRV response_size=1" \ |
| 5780 | "$P_CLI force_version=tls1_2 \ |
| 5781 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5782 | 0 \ |
| 5783 | -c "Read from server: 1 bytes read" |
| 5784 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5785 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5786 | "$P_SRV response_size=1" \ |
| 5787 | "$P_CLI force_version=tls1_2 \ |
| 5788 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5789 | 0 \ |
| 5790 | -c "Read from server: 1 bytes read" |
| 5791 | |
| 5792 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5793 | "$P_SRV response_size=1" \ |
| 5794 | "$P_CLI force_version=tls1_2 \ |
| 5795 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5796 | 0 \ |
| 5797 | -c "Read from server: 1 bytes read" |
| 5798 | |
| 5799 | # Tests for small server packets in DTLS |
| 5800 | |
| 5801 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5802 | run_test "Small server packet DTLS 1.2" \ |
| 5803 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5804 | "$P_CLI dtls=1 \ |
| 5805 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5806 | 0 \ |
| 5807 | -c "Read from server: 1 bytes read" |
| 5808 | |
| 5809 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5810 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5811 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5812 | "$P_CLI dtls=1 \ |
| 5813 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5814 | 0 \ |
| 5815 | -c "Read from server: 1 bytes read" |
| 5816 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5817 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5818 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5819 | # How many fragments do we expect to write $1 bytes? |
| 5820 | fragments_for_write() { |
| 5821 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5822 | } |
| 5823 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5824 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5825 | "$P_SRV" \ |
| 5826 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5827 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5828 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5829 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5830 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5831 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5832 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5833 | "$P_SRV" \ |
| 5834 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5835 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5836 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5837 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5838 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5839 | 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] | 5840 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5841 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5842 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5843 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5844 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5845 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5846 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5847 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5848 | "$P_SRV" \ |
| 5849 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5850 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5851 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5852 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5853 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5854 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5855 | 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] | 5856 | "$P_SRV" \ |
| 5857 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5858 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5859 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5860 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5861 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5862 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 5863 | # 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] | 5864 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5865 | "$P_SRV response_size=16384" \ |
| 5866 | "$P_CLI force_version=tls1_2 \ |
| 5867 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5868 | 0 \ |
| 5869 | -c "Read from server: 16384 bytes read" |
| 5870 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5871 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5872 | "$P_SRV response_size=16384" \ |
| 5873 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5874 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5875 | 0 \ |
| 5876 | -s "16384 bytes written in 1 fragments" \ |
| 5877 | -c "Read from server: 16384 bytes read" |
| 5878 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5879 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5880 | "$P_SRV response_size=16384" \ |
| 5881 | "$P_CLI force_version=tls1_2 \ |
| 5882 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5883 | 0 \ |
| 5884 | -c "Read from server: 16384 bytes read" |
| 5885 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5886 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5887 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5888 | "$P_CLI force_version=tls1_2 \ |
| 5889 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5890 | 0 \ |
| 5891 | -s "16384 bytes written in 1 fragments" \ |
| 5892 | -c "Read from server: 16384 bytes read" |
| 5893 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5894 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5895 | "$P_SRV response_size=16384" \ |
| 5896 | "$P_CLI force_version=tls1_2 \ |
| 5897 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5898 | 0 \ |
| 5899 | -c "Read from server: 16384 bytes read" |
| 5900 | |
| 5901 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5902 | "$P_SRV response_size=16384" \ |
| 5903 | "$P_CLI force_version=tls1_2 \ |
| 5904 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5905 | 0 \ |
| 5906 | -c "Read from server: 16384 bytes read" |
| 5907 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5908 | # Tests for restartable ECC |
| 5909 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5910 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 5911 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5912 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5913 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5914 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5915 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5916 | "$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] | 5917 | 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] | 5918 | debug_level=1" \ |
| 5919 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5920 | -C "x509_verify_cert.*4b00" \ |
| 5921 | -C "mbedtls_pk_verify.*4b00" \ |
| 5922 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5923 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5924 | |
| 5925 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5926 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5927 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5928 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5929 | "$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] | 5930 | 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] | 5931 | debug_level=1 ec_max_ops=0" \ |
| 5932 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5933 | -C "x509_verify_cert.*4b00" \ |
| 5934 | -C "mbedtls_pk_verify.*4b00" \ |
| 5935 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5936 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5937 | |
| 5938 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5939 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5940 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5941 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5942 | "$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] | 5943 | 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] | 5944 | debug_level=1 ec_max_ops=65535" \ |
| 5945 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5946 | -C "x509_verify_cert.*4b00" \ |
| 5947 | -C "mbedtls_pk_verify.*4b00" \ |
| 5948 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5949 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5950 | |
| 5951 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5952 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5953 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5954 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5955 | "$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] | 5956 | 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] | 5957 | debug_level=1 ec_max_ops=1000" \ |
| 5958 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5959 | -c "x509_verify_cert.*4b00" \ |
| 5960 | -c "mbedtls_pk_verify.*4b00" \ |
| 5961 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5962 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5963 | |
| 5964 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5965 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5966 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5967 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5968 | crt_file=data_files/server5-badsign.crt \ |
| 5969 | key_file=data_files/server5.key" \ |
| 5970 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5971 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5972 | debug_level=1 ec_max_ops=1000" \ |
| 5973 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5974 | -c "x509_verify_cert.*4b00" \ |
| 5975 | -C "mbedtls_pk_verify.*4b00" \ |
| 5976 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5977 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5978 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5979 | -c "! mbedtls_ssl_handshake returned" \ |
| 5980 | -c "X509 - Certificate verification failed" |
| 5981 | |
| 5982 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5983 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5984 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5985 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5986 | crt_file=data_files/server5-badsign.crt \ |
| 5987 | key_file=data_files/server5.key" \ |
| 5988 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5989 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5990 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5991 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5992 | -c "x509_verify_cert.*4b00" \ |
| 5993 | -c "mbedtls_pk_verify.*4b00" \ |
| 5994 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5995 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5996 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5997 | -C "! mbedtls_ssl_handshake returned" \ |
| 5998 | -C "X509 - Certificate verification failed" |
| 5999 | |
| 6000 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6001 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6002 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6003 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6004 | crt_file=data_files/server5-badsign.crt \ |
| 6005 | key_file=data_files/server5.key" \ |
| 6006 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6007 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6008 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6009 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6010 | -C "x509_verify_cert.*4b00" \ |
| 6011 | -c "mbedtls_pk_verify.*4b00" \ |
| 6012 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6013 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6014 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6015 | -C "! mbedtls_ssl_handshake returned" \ |
| 6016 | -C "X509 - Certificate verification failed" |
| 6017 | |
| 6018 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6019 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6020 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6021 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6022 | "$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] | 6023 | 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] | 6024 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6025 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6026 | -c "x509_verify_cert.*4b00" \ |
| 6027 | -c "mbedtls_pk_verify.*4b00" \ |
| 6028 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6029 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6030 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6031 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6032 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6033 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6034 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6035 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6036 | debug_level=1 ec_max_ops=1000" \ |
| 6037 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6038 | -c "x509_verify_cert.*4b00" \ |
| 6039 | -c "mbedtls_pk_verify.*4b00" \ |
| 6040 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6041 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6042 | |
| 6043 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6044 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6045 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6046 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6047 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6048 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6049 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6050 | -C "x509_verify_cert.*4b00" \ |
| 6051 | -C "mbedtls_pk_verify.*4b00" \ |
| 6052 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6053 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6054 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6055 | # Tests of asynchronous private key support in SSL |
| 6056 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6057 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6058 | run_test "SSL async private: sign, delay=0" \ |
| 6059 | "$P_SRV \ |
| 6060 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6061 | "$P_CLI" \ |
| 6062 | 0 \ |
| 6063 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6064 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6065 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6066 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6067 | run_test "SSL async private: sign, delay=1" \ |
| 6068 | "$P_SRV \ |
| 6069 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6070 | "$P_CLI" \ |
| 6071 | 0 \ |
| 6072 | -s "Async sign callback: using key slot " \ |
| 6073 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6074 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6075 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6076 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6077 | run_test "SSL async private: sign, delay=2" \ |
| 6078 | "$P_SRV \ |
| 6079 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6080 | "$P_CLI" \ |
| 6081 | 0 \ |
| 6082 | -s "Async sign callback: using key slot " \ |
| 6083 | -U "Async sign callback: using key slot " \ |
| 6084 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6085 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6086 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6087 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6088 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6089 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6090 | run_test "SSL async private: sign, SNI" \ |
| 6091 | "$P_SRV debug_level=3 \ |
| 6092 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6093 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6094 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6095 | "$P_CLI server_name=polarssl.example" \ |
| 6096 | 0 \ |
| 6097 | -s "Async sign callback: using key slot " \ |
| 6098 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6099 | -s "parse ServerName extension" \ |
| 6100 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6101 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6102 | |
| 6103 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6104 | run_test "SSL async private: decrypt, delay=0" \ |
| 6105 | "$P_SRV \ |
| 6106 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6107 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6108 | 0 \ |
| 6109 | -s "Async decrypt callback: using key slot " \ |
| 6110 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6111 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6112 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6113 | run_test "SSL async private: decrypt, delay=1" \ |
| 6114 | "$P_SRV \ |
| 6115 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6116 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6117 | 0 \ |
| 6118 | -s "Async decrypt callback: using key slot " \ |
| 6119 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6120 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6121 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6122 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6123 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6124 | "$P_SRV psk=abc123 \ |
| 6125 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6126 | "$P_CLI psk=abc123 \ |
| 6127 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6128 | 0 \ |
| 6129 | -s "Async decrypt callback: using key slot " \ |
| 6130 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6131 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6132 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6133 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6134 | "$P_SRV psk=abc123 \ |
| 6135 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6136 | "$P_CLI psk=abc123 \ |
| 6137 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6138 | 0 \ |
| 6139 | -s "Async decrypt callback: using key slot " \ |
| 6140 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6141 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6142 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6143 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6144 | run_test "SSL async private: sign callback not present" \ |
| 6145 | "$P_SRV \ |
| 6146 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6147 | "$P_CLI; [ \$? -eq 1 ] && |
| 6148 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6149 | 0 \ |
| 6150 | -S "Async sign callback" \ |
| 6151 | -s "! mbedtls_ssl_handshake returned" \ |
| 6152 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6153 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6154 | -s "Successful connection" |
| 6155 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6156 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6157 | run_test "SSL async private: decrypt callback not present" \ |
| 6158 | "$P_SRV debug_level=1 \ |
| 6159 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6160 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6161 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6162 | 0 \ |
| 6163 | -S "Async decrypt callback" \ |
| 6164 | -s "! mbedtls_ssl_handshake returned" \ |
| 6165 | -s "got no RSA private key" \ |
| 6166 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6167 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6168 | |
| 6169 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6170 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6171 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6172 | "$P_SRV \ |
| 6173 | async_operations=s async_private_delay1=1 \ |
| 6174 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6175 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6176 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6177 | 0 \ |
| 6178 | -s "Async sign callback: using key slot 0," \ |
| 6179 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6180 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6181 | |
| 6182 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6183 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6184 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6185 | "$P_SRV \ |
| 6186 | async_operations=s async_private_delay2=1 \ |
| 6187 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6188 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6189 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6190 | 0 \ |
| 6191 | -s "Async sign callback: using key slot 0," \ |
| 6192 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6193 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6194 | |
| 6195 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6196 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6197 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6198 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6199 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6200 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6201 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6202 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6203 | 0 \ |
| 6204 | -s "Async sign callback: using key slot 1," \ |
| 6205 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6206 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6207 | |
| 6208 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6209 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6210 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6211 | "$P_SRV \ |
| 6212 | async_operations=s async_private_delay1=1 \ |
| 6213 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6214 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6215 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6216 | 0 \ |
| 6217 | -s "Async sign callback: no key matches this certificate." |
| 6218 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6219 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6220 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6221 | "$P_SRV \ |
| 6222 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6223 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6224 | "$P_CLI" \ |
| 6225 | 1 \ |
| 6226 | -s "Async sign callback: injected error" \ |
| 6227 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6228 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6229 | -s "! mbedtls_ssl_handshake returned" |
| 6230 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6231 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6232 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6233 | "$P_SRV \ |
| 6234 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6235 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6236 | "$P_CLI" \ |
| 6237 | 1 \ |
| 6238 | -s "Async sign callback: using key slot " \ |
| 6239 | -S "Async resume" \ |
| 6240 | -s "Async cancel" |
| 6241 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6242 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6243 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6244 | "$P_SRV \ |
| 6245 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6246 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6247 | "$P_CLI" \ |
| 6248 | 1 \ |
| 6249 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6250 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6251 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6252 | -s "! mbedtls_ssl_handshake returned" |
| 6253 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6254 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6255 | run_test "SSL async private: decrypt, error in start" \ |
| 6256 | "$P_SRV \ |
| 6257 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6258 | async_private_error=1" \ |
| 6259 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6260 | 1 \ |
| 6261 | -s "Async decrypt callback: injected error" \ |
| 6262 | -S "Async resume" \ |
| 6263 | -S "Async cancel" \ |
| 6264 | -s "! mbedtls_ssl_handshake returned" |
| 6265 | |
| 6266 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6267 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6268 | "$P_SRV \ |
| 6269 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6270 | async_private_error=2" \ |
| 6271 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6272 | 1 \ |
| 6273 | -s "Async decrypt callback: using key slot " \ |
| 6274 | -S "Async resume" \ |
| 6275 | -s "Async cancel" |
| 6276 | |
| 6277 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6278 | run_test "SSL async private: decrypt, error in resume" \ |
| 6279 | "$P_SRV \ |
| 6280 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6281 | async_private_error=3" \ |
| 6282 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6283 | 1 \ |
| 6284 | -s "Async decrypt callback: using key slot " \ |
| 6285 | -s "Async resume callback: decrypt done but injected error" \ |
| 6286 | -S "Async cancel" \ |
| 6287 | -s "! mbedtls_ssl_handshake returned" |
| 6288 | |
| 6289 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6290 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6291 | "$P_SRV \ |
| 6292 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6293 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6294 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6295 | 0 \ |
| 6296 | -s "Async cancel" \ |
| 6297 | -s "! mbedtls_ssl_handshake returned" \ |
| 6298 | -s "Async resume" \ |
| 6299 | -s "Successful connection" |
| 6300 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6301 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6302 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6303 | "$P_SRV \ |
| 6304 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6305 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6306 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6307 | 0 \ |
| 6308 | -s "! mbedtls_ssl_handshake returned" \ |
| 6309 | -s "Async resume" \ |
| 6310 | -s "Successful connection" |
| 6311 | |
| 6312 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6313 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6314 | 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] | 6315 | "$P_SRV \ |
| 6316 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6317 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6318 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6319 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6320 | [ \$? -eq 1 ] && |
| 6321 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6322 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6323 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6324 | -S "Async resume" \ |
| 6325 | -s "Async cancel" \ |
| 6326 | -s "! mbedtls_ssl_handshake returned" \ |
| 6327 | -s "Async sign callback: no key matches this certificate." \ |
| 6328 | -s "Successful connection" |
| 6329 | |
| 6330 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6331 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6332 | 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] | 6333 | "$P_SRV \ |
| 6334 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6335 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6336 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6337 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6338 | [ \$? -eq 1 ] && |
| 6339 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6340 | 0 \ |
| 6341 | -s "Async resume" \ |
| 6342 | -s "! mbedtls_ssl_handshake returned" \ |
| 6343 | -s "Async sign callback: no key matches this certificate." \ |
| 6344 | -s "Successful connection" |
| 6345 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6346 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6347 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6348 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6349 | "$P_SRV \ |
| 6350 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6351 | exchanges=2 renegotiation=1" \ |
| 6352 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6353 | 0 \ |
| 6354 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6355 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6356 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6357 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6358 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6359 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6360 | "$P_SRV \ |
| 6361 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6362 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6363 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6364 | 0 \ |
| 6365 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6366 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6367 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6368 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6369 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6370 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6371 | "$P_SRV \ |
| 6372 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6373 | exchanges=2 renegotiation=1" \ |
| 6374 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6375 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6376 | 0 \ |
| 6377 | -s "Async decrypt callback: using key slot " \ |
| 6378 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6379 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6380 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6381 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6382 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6383 | "$P_SRV \ |
| 6384 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6385 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6386 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6387 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6388 | 0 \ |
| 6389 | -s "Async decrypt callback: using key slot " \ |
| 6390 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6391 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6392 | # Tests for ECC extensions (rfc 4492) |
| 6393 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6394 | requires_config_enabled MBEDTLS_AES_C |
| 6395 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6396 | requires_config_enabled MBEDTLS_SHA256_C |
| 6397 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6398 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6399 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6400 | "$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] | 6401 | 0 \ |
| 6402 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6403 | -C "client hello, adding supported_point_formats extension" \ |
| 6404 | -S "found supported elliptic curves extension" \ |
| 6405 | -S "found supported point formats extension" |
| 6406 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6407 | requires_config_enabled MBEDTLS_AES_C |
| 6408 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6409 | requires_config_enabled MBEDTLS_SHA256_C |
| 6410 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6411 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6412 | "$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] | 6413 | "$P_CLI debug_level=3" \ |
| 6414 | 0 \ |
| 6415 | -C "found supported_point_formats extension" \ |
| 6416 | -S "server hello, supported_point_formats extension" |
| 6417 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6418 | requires_config_enabled MBEDTLS_AES_C |
| 6419 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6420 | requires_config_enabled MBEDTLS_SHA256_C |
| 6421 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6422 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6423 | "$P_SRV debug_level=3" \ |
| 6424 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6425 | 0 \ |
| 6426 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6427 | -c "client hello, adding supported_point_formats extension" \ |
| 6428 | -s "found supported elliptic curves extension" \ |
| 6429 | -s "found supported point formats extension" |
| 6430 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6431 | requires_config_enabled MBEDTLS_AES_C |
| 6432 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6433 | requires_config_enabled MBEDTLS_SHA256_C |
| 6434 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6435 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6436 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6437 | "$P_CLI debug_level=3" \ |
| 6438 | 0 \ |
| 6439 | -c "found supported_point_formats extension" \ |
| 6440 | -s "server hello, supported_point_formats extension" |
| 6441 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6442 | # Tests for DTLS HelloVerifyRequest |
| 6443 | |
| 6444 | run_test "DTLS cookie: enabled" \ |
| 6445 | "$P_SRV dtls=1 debug_level=2" \ |
| 6446 | "$P_CLI dtls=1 debug_level=2" \ |
| 6447 | 0 \ |
| 6448 | -s "cookie verification failed" \ |
| 6449 | -s "cookie verification passed" \ |
| 6450 | -S "cookie verification skipped" \ |
| 6451 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6452 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6453 | -S "SSL - The requested feature is not available" |
| 6454 | |
| 6455 | run_test "DTLS cookie: disabled" \ |
| 6456 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6457 | "$P_CLI dtls=1 debug_level=2" \ |
| 6458 | 0 \ |
| 6459 | -S "cookie verification failed" \ |
| 6460 | -S "cookie verification passed" \ |
| 6461 | -s "cookie verification skipped" \ |
| 6462 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6463 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6464 | -S "SSL - The requested feature is not available" |
| 6465 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6466 | run_test "DTLS cookie: default (failing)" \ |
| 6467 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6468 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6469 | 1 \ |
| 6470 | -s "cookie verification failed" \ |
| 6471 | -S "cookie verification passed" \ |
| 6472 | -S "cookie verification skipped" \ |
| 6473 | -C "received hello verify request" \ |
| 6474 | -S "hello verification requested" \ |
| 6475 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6476 | |
| 6477 | requires_ipv6 |
| 6478 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6479 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6480 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6481 | 0 \ |
| 6482 | -s "cookie verification failed" \ |
| 6483 | -s "cookie verification passed" \ |
| 6484 | -S "cookie verification skipped" \ |
| 6485 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6486 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6487 | -S "SSL - The requested feature is not available" |
| 6488 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6489 | run_test "DTLS cookie: enabled, nbio" \ |
| 6490 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6491 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6492 | 0 \ |
| 6493 | -s "cookie verification failed" \ |
| 6494 | -s "cookie verification passed" \ |
| 6495 | -S "cookie verification skipped" \ |
| 6496 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6497 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6498 | -S "SSL - The requested feature is not available" |
| 6499 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6500 | # Tests for client reconnecting from the same port with DTLS |
| 6501 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6502 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6503 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6504 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6505 | "$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] | 6506 | 0 \ |
| 6507 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6508 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6509 | -S "Client initiated reconnection from same port" |
| 6510 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6511 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6512 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6513 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6514 | "$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] | 6515 | 0 \ |
| 6516 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6517 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6518 | -s "Client initiated reconnection from same port" |
| 6519 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6520 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6521 | 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] | 6522 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6523 | "$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] | 6524 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6525 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6526 | -s "Client initiated reconnection from same port" |
| 6527 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6528 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6529 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6530 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6531 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6532 | 0 \ |
| 6533 | -S "The operation timed out" \ |
| 6534 | -s "Client initiated reconnection from same port" |
| 6535 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6536 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6537 | "$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] | 6538 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6539 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6540 | -s "The operation timed out" \ |
| 6541 | -S "Client initiated reconnection from same port" |
| 6542 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6543 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6544 | -p "$P_PXY inject_clihlo=1" \ |
| 6545 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6546 | "$P_CLI dtls=1 exchanges=2" \ |
| 6547 | 0 \ |
| 6548 | -s "possible client reconnect from the same port" \ |
| 6549 | -S "Client initiated reconnection from same port" |
| 6550 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6551 | # Tests for various cases of client authentication with DTLS |
| 6552 | # (focused on handshake flows and message parsing) |
| 6553 | |
| 6554 | run_test "DTLS client auth: required" \ |
| 6555 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6556 | "$P_CLI dtls=1" \ |
| 6557 | 0 \ |
| 6558 | -s "Verifying peer X.509 certificate... ok" |
| 6559 | |
| 6560 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6561 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6562 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6563 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6564 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6565 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6566 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6567 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6568 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6569 | 0 \ |
| 6570 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6571 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6572 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6573 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6574 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6575 | "$P_CLI dtls=1 psk=abc124" \ |
| 6576 | 1 \ |
| 6577 | -s "SSL - Verification of the message MAC failed" \ |
| 6578 | -c "SSL - A fatal alert message was received from our peer" |
| 6579 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6580 | # Tests for receiving fragmented handshake messages with DTLS |
| 6581 | |
| 6582 | requires_gnutls |
| 6583 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6584 | "$G_SRV -u --mtu 2048 -a" \ |
| 6585 | "$P_CLI dtls=1 debug_level=2" \ |
| 6586 | 0 \ |
| 6587 | -C "found fragmented DTLS handshake message" \ |
| 6588 | -C "error" |
| 6589 | |
| 6590 | requires_gnutls |
| 6591 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6592 | "$G_SRV -u --mtu 512" \ |
| 6593 | "$P_CLI dtls=1 debug_level=2" \ |
| 6594 | 0 \ |
| 6595 | -c "found fragmented DTLS handshake message" \ |
| 6596 | -C "error" |
| 6597 | |
| 6598 | requires_gnutls |
| 6599 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6600 | "$G_SRV -u --mtu 128" \ |
| 6601 | "$P_CLI dtls=1 debug_level=2" \ |
| 6602 | 0 \ |
| 6603 | -c "found fragmented DTLS handshake message" \ |
| 6604 | -C "error" |
| 6605 | |
| 6606 | requires_gnutls |
| 6607 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6608 | "$G_SRV -u --mtu 128" \ |
| 6609 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6610 | 0 \ |
| 6611 | -c "found fragmented DTLS handshake message" \ |
| 6612 | -C "error" |
| 6613 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6614 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6615 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6616 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6617 | "$G_SRV -u --mtu 256" \ |
| 6618 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6619 | 0 \ |
| 6620 | -c "found fragmented DTLS handshake message" \ |
| 6621 | -c "client hello, adding renegotiation extension" \ |
| 6622 | -c "found renegotiation extension" \ |
| 6623 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6624 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6625 | -C "error" \ |
| 6626 | -s "Extra-header:" |
| 6627 | |
| 6628 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6629 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6630 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6631 | "$G_SRV -u --mtu 256" \ |
| 6632 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6633 | 0 \ |
| 6634 | -c "found fragmented DTLS handshake message" \ |
| 6635 | -c "client hello, adding renegotiation extension" \ |
| 6636 | -c "found renegotiation extension" \ |
| 6637 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6638 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6639 | -C "error" \ |
| 6640 | -s "Extra-header:" |
| 6641 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6642 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6643 | "$O_SRV -dtls -mtu 2048" \ |
| 6644 | "$P_CLI dtls=1 debug_level=2" \ |
| 6645 | 0 \ |
| 6646 | -C "found fragmented DTLS handshake message" \ |
| 6647 | -C "error" |
| 6648 | |
| 6649 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6650 | "$O_SRV -dtls -mtu 768" \ |
| 6651 | "$P_CLI dtls=1 debug_level=2" \ |
| 6652 | 0 \ |
| 6653 | -c "found fragmented DTLS handshake message" \ |
| 6654 | -C "error" |
| 6655 | |
| 6656 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6657 | "$O_SRV -dtls -mtu 256" \ |
| 6658 | "$P_CLI dtls=1 debug_level=2" \ |
| 6659 | 0 \ |
| 6660 | -c "found fragmented DTLS handshake message" \ |
| 6661 | -C "error" |
| 6662 | |
| 6663 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6664 | "$O_SRV -dtls -mtu 256" \ |
| 6665 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6666 | 0 \ |
| 6667 | -c "found fragmented DTLS handshake message" \ |
| 6668 | -C "error" |
| 6669 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6670 | # Tests for sending fragmented handshake messages with DTLS |
| 6671 | # |
| 6672 | # Use client auth when we need the client to send large messages, |
| 6673 | # and use large cert chains on both sides too (the long chains we have all use |
| 6674 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6675 | # Sizes reached (UDP payload): |
| 6676 | # - 2037B for server certificate |
| 6677 | # - 1542B for client certificate |
| 6678 | # - 1013B for newsessionticket |
| 6679 | # - all others below 512B |
| 6680 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6681 | |
| 6682 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6683 | requires_config_enabled MBEDTLS_RSA_C |
| 6684 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6685 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6686 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6687 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6688 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6689 | crt_file=data_files/server7_int-ca.crt \ |
| 6690 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6691 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6692 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6693 | "$P_CLI dtls=1 debug_level=2 \ |
| 6694 | crt_file=data_files/server8_int-ca2.crt \ |
| 6695 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6696 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6697 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6698 | 0 \ |
| 6699 | -S "found fragmented DTLS handshake message" \ |
| 6700 | -C "found fragmented DTLS handshake message" \ |
| 6701 | -C "error" |
| 6702 | |
| 6703 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6704 | requires_config_enabled MBEDTLS_RSA_C |
| 6705 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6706 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6707 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6708 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6709 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6710 | crt_file=data_files/server7_int-ca.crt \ |
| 6711 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6712 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6713 | max_frag_len=1024" \ |
| 6714 | "$P_CLI dtls=1 debug_level=2 \ |
| 6715 | crt_file=data_files/server8_int-ca2.crt \ |
| 6716 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6717 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6718 | max_frag_len=2048" \ |
| 6719 | 0 \ |
| 6720 | -S "found fragmented DTLS handshake message" \ |
| 6721 | -c "found fragmented DTLS handshake message" \ |
| 6722 | -C "error" |
| 6723 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6724 | # With the MFL extension, the server has no way of forcing |
| 6725 | # the client to not exceed a certain MTU; hence, the following |
| 6726 | # test can't be replicated with an MTU proxy such as the one |
| 6727 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6728 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6729 | requires_config_enabled MBEDTLS_RSA_C |
| 6730 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6731 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6732 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6733 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6734 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6735 | crt_file=data_files/server7_int-ca.crt \ |
| 6736 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6737 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6738 | max_frag_len=512" \ |
| 6739 | "$P_CLI dtls=1 debug_level=2 \ |
| 6740 | crt_file=data_files/server8_int-ca2.crt \ |
| 6741 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6742 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6743 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6744 | 0 \ |
| 6745 | -S "found fragmented DTLS handshake message" \ |
| 6746 | -c "found fragmented DTLS handshake message" \ |
| 6747 | -C "error" |
| 6748 | |
| 6749 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6750 | requires_config_enabled MBEDTLS_RSA_C |
| 6751 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6752 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6753 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6754 | 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] | 6755 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6756 | crt_file=data_files/server7_int-ca.crt \ |
| 6757 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6758 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6759 | max_frag_len=2048" \ |
| 6760 | "$P_CLI dtls=1 debug_level=2 \ |
| 6761 | crt_file=data_files/server8_int-ca2.crt \ |
| 6762 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6763 | hs_timeout=2500-60000 \ |
| 6764 | max_frag_len=1024" \ |
| 6765 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6766 | -S "found fragmented DTLS handshake message" \ |
| 6767 | -c "found fragmented DTLS handshake message" \ |
| 6768 | -C "error" |
| 6769 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6770 | # While not required by the standard defining the MFL extension |
| 6771 | # (according to which it only applies to records, not to datagrams), |
| 6772 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6773 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6774 | # to the peer. |
| 6775 | # The next test checks that no datagrams significantly larger than the |
| 6776 | # negotiated MFL are sent. |
| 6777 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6778 | requires_config_enabled MBEDTLS_RSA_C |
| 6779 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6780 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6781 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6782 | 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] | 6783 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6784 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6785 | crt_file=data_files/server7_int-ca.crt \ |
| 6786 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6787 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6788 | max_frag_len=2048" \ |
| 6789 | "$P_CLI dtls=1 debug_level=2 \ |
| 6790 | crt_file=data_files/server8_int-ca2.crt \ |
| 6791 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6792 | hs_timeout=2500-60000 \ |
| 6793 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6794 | 0 \ |
| 6795 | -S "found fragmented DTLS handshake message" \ |
| 6796 | -c "found fragmented DTLS handshake message" \ |
| 6797 | -C "error" |
| 6798 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6799 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6800 | requires_config_enabled MBEDTLS_RSA_C |
| 6801 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6802 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6803 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6804 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6805 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6806 | crt_file=data_files/server7_int-ca.crt \ |
| 6807 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6808 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6809 | max_frag_len=2048" \ |
| 6810 | "$P_CLI dtls=1 debug_level=2 \ |
| 6811 | crt_file=data_files/server8_int-ca2.crt \ |
| 6812 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6813 | hs_timeout=2500-60000 \ |
| 6814 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6815 | 0 \ |
| 6816 | -s "found fragmented DTLS handshake message" \ |
| 6817 | -c "found fragmented DTLS handshake message" \ |
| 6818 | -C "error" |
| 6819 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6820 | # While not required by the standard defining the MFL extension |
| 6821 | # (according to which it only applies to records, not to datagrams), |
| 6822 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6823 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6824 | # to the peer. |
| 6825 | # The next test checks that no datagrams significantly larger than the |
| 6826 | # negotiated MFL are sent. |
| 6827 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6828 | requires_config_enabled MBEDTLS_RSA_C |
| 6829 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6830 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6831 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6832 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6833 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6834 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6835 | crt_file=data_files/server7_int-ca.crt \ |
| 6836 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6837 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6838 | max_frag_len=2048" \ |
| 6839 | "$P_CLI dtls=1 debug_level=2 \ |
| 6840 | crt_file=data_files/server8_int-ca2.crt \ |
| 6841 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6842 | hs_timeout=2500-60000 \ |
| 6843 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6844 | 0 \ |
| 6845 | -s "found fragmented DTLS handshake message" \ |
| 6846 | -c "found fragmented DTLS handshake message" \ |
| 6847 | -C "error" |
| 6848 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6849 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6850 | requires_config_enabled MBEDTLS_RSA_C |
| 6851 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6852 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6853 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6854 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6855 | crt_file=data_files/server7_int-ca.crt \ |
| 6856 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6857 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6858 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6859 | "$P_CLI dtls=1 debug_level=2 \ |
| 6860 | crt_file=data_files/server8_int-ca2.crt \ |
| 6861 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6862 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6863 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6864 | 0 \ |
| 6865 | -S "found fragmented DTLS handshake message" \ |
| 6866 | -C "found fragmented DTLS handshake message" \ |
| 6867 | -C "error" |
| 6868 | |
| 6869 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6870 | requires_config_enabled MBEDTLS_RSA_C |
| 6871 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6872 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6873 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6874 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6875 | crt_file=data_files/server7_int-ca.crt \ |
| 6876 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6877 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6878 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6879 | "$P_CLI dtls=1 debug_level=2 \ |
| 6880 | crt_file=data_files/server8_int-ca2.crt \ |
| 6881 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6882 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6883 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6884 | 0 \ |
| 6885 | -s "found fragmented DTLS handshake message" \ |
| 6886 | -C "found fragmented DTLS handshake message" \ |
| 6887 | -C "error" |
| 6888 | |
| 6889 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6890 | requires_config_enabled MBEDTLS_RSA_C |
| 6891 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6892 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6893 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6894 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6895 | crt_file=data_files/server7_int-ca.crt \ |
| 6896 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6897 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6898 | mtu=512" \ |
| 6899 | "$P_CLI dtls=1 debug_level=2 \ |
| 6900 | crt_file=data_files/server8_int-ca2.crt \ |
| 6901 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6902 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6903 | mtu=2048" \ |
| 6904 | 0 \ |
| 6905 | -S "found fragmented DTLS handshake message" \ |
| 6906 | -c "found fragmented DTLS handshake message" \ |
| 6907 | -C "error" |
| 6908 | |
| 6909 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6910 | requires_config_enabled MBEDTLS_RSA_C |
| 6911 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6912 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6913 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6914 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6915 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6916 | crt_file=data_files/server7_int-ca.crt \ |
| 6917 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6918 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6919 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6920 | "$P_CLI dtls=1 debug_level=2 \ |
| 6921 | crt_file=data_files/server8_int-ca2.crt \ |
| 6922 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6923 | hs_timeout=2500-60000 \ |
| 6924 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6925 | 0 \ |
| 6926 | -s "found fragmented DTLS handshake message" \ |
| 6927 | -c "found fragmented DTLS handshake message" \ |
| 6928 | -C "error" |
| 6929 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6930 | # 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] | 6931 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6932 | requires_config_enabled MBEDTLS_RSA_C |
| 6933 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6934 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6935 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6936 | requires_config_enabled MBEDTLS_AES_C |
| 6937 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6938 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6939 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6940 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6941 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6942 | crt_file=data_files/server7_int-ca.crt \ |
| 6943 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6944 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6945 | mtu=512" \ |
| 6946 | "$P_CLI dtls=1 debug_level=2 \ |
| 6947 | crt_file=data_files/server8_int-ca2.crt \ |
| 6948 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6949 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6950 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6951 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6952 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6953 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6954 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6955 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6956 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6957 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6958 | # 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] | 6959 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6960 | # retransmissions, but in some cases (like both the server and client using |
| 6961 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6962 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6963 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6964 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6965 | requires_config_enabled MBEDTLS_RSA_C |
| 6966 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6967 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6968 | requires_config_enabled MBEDTLS_AES_C |
| 6969 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6970 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6971 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6972 | -p "$P_PXY mtu=508" \ |
| 6973 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6974 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6975 | key_file=data_files/server7.key \ |
| 6976 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6977 | "$P_CLI dtls=1 debug_level=2 \ |
| 6978 | crt_file=data_files/server8_int-ca2.crt \ |
| 6979 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6980 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6981 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6982 | 0 \ |
| 6983 | -s "found fragmented DTLS handshake message" \ |
| 6984 | -c "found fragmented DTLS handshake message" \ |
| 6985 | -C "error" |
| 6986 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6987 | # 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] | 6988 | only_with_valgrind |
| 6989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6990 | requires_config_enabled MBEDTLS_RSA_C |
| 6991 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6992 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6993 | requires_config_enabled MBEDTLS_AES_C |
| 6994 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6995 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6996 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6997 | -p "$P_PXY mtu=508" \ |
| 6998 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6999 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7000 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7001 | hs_timeout=250-10000" \ |
| 7002 | "$P_CLI dtls=1 debug_level=2 \ |
| 7003 | crt_file=data_files/server8_int-ca2.crt \ |
| 7004 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7005 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7006 | hs_timeout=250-10000" \ |
| 7007 | 0 \ |
| 7008 | -s "found fragmented DTLS handshake message" \ |
| 7009 | -c "found fragmented DTLS handshake message" \ |
| 7010 | -C "error" |
| 7011 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7012 | # 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] | 7013 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7014 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7015 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7016 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7017 | requires_config_enabled MBEDTLS_RSA_C |
| 7018 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7019 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7020 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7021 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7022 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7023 | crt_file=data_files/server7_int-ca.crt \ |
| 7024 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7025 | hs_timeout=10000-60000 \ |
| 7026 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7027 | "$P_CLI dtls=1 debug_level=2 \ |
| 7028 | crt_file=data_files/server8_int-ca2.crt \ |
| 7029 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7030 | hs_timeout=10000-60000 \ |
| 7031 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7032 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7033 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7034 | -s "found fragmented DTLS handshake message" \ |
| 7035 | -c "found fragmented DTLS handshake message" \ |
| 7036 | -C "error" |
| 7037 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7038 | # 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] | 7039 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7040 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7041 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7042 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7043 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7044 | requires_config_enabled MBEDTLS_RSA_C |
| 7045 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7046 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7047 | requires_config_enabled MBEDTLS_AES_C |
| 7048 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7049 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7050 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7051 | -p "$P_PXY mtu=512" \ |
| 7052 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7053 | crt_file=data_files/server7_int-ca.crt \ |
| 7054 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7055 | hs_timeout=10000-60000 \ |
| 7056 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7057 | "$P_CLI dtls=1 debug_level=2 \ |
| 7058 | crt_file=data_files/server8_int-ca2.crt \ |
| 7059 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7060 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7061 | hs_timeout=10000-60000 \ |
| 7062 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7063 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7064 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7065 | -s "found fragmented DTLS handshake message" \ |
| 7066 | -c "found fragmented DTLS handshake message" \ |
| 7067 | -C "error" |
| 7068 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7069 | not_with_valgrind # spurious autoreduction due to timeout |
| 7070 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7071 | requires_config_enabled MBEDTLS_RSA_C |
| 7072 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7073 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7074 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7075 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7076 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7077 | crt_file=data_files/server7_int-ca.crt \ |
| 7078 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7079 | hs_timeout=10000-60000 \ |
| 7080 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7081 | "$P_CLI dtls=1 debug_level=2 \ |
| 7082 | crt_file=data_files/server8_int-ca2.crt \ |
| 7083 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7084 | hs_timeout=10000-60000 \ |
| 7085 | mtu=1024 nbio=2" \ |
| 7086 | 0 \ |
| 7087 | -S "autoreduction" \ |
| 7088 | -s "found fragmented DTLS handshake message" \ |
| 7089 | -c "found fragmented DTLS handshake message" \ |
| 7090 | -C "error" |
| 7091 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7092 | # 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] | 7093 | not_with_valgrind # spurious autoreduction due to timeout |
| 7094 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7095 | requires_config_enabled MBEDTLS_RSA_C |
| 7096 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7097 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7098 | requires_config_enabled MBEDTLS_AES_C |
| 7099 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7100 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7101 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7102 | -p "$P_PXY mtu=512" \ |
| 7103 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7104 | crt_file=data_files/server7_int-ca.crt \ |
| 7105 | key_file=data_files/server7.key \ |
| 7106 | hs_timeout=10000-60000 \ |
| 7107 | mtu=512 nbio=2" \ |
| 7108 | "$P_CLI dtls=1 debug_level=2 \ |
| 7109 | crt_file=data_files/server8_int-ca2.crt \ |
| 7110 | key_file=data_files/server8.key \ |
| 7111 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7112 | hs_timeout=10000-60000 \ |
| 7113 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7114 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7115 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7116 | -s "found fragmented DTLS handshake message" \ |
| 7117 | -c "found fragmented DTLS handshake message" \ |
| 7118 | -C "error" |
| 7119 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7120 | # 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] | 7121 | # This ensures things still work after session_reset(). |
| 7122 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7123 | # Since we don't support reading fragmented ClientHello yet, |
| 7124 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7125 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7126 | # An autoreduction on the client-side might happen if the server is |
| 7127 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7128 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7129 | # resumed listening, which would result in a spurious autoreduction. |
| 7130 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7131 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7132 | requires_config_enabled MBEDTLS_RSA_C |
| 7133 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7134 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7135 | requires_config_enabled MBEDTLS_AES_C |
| 7136 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7137 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7138 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7139 | -p "$P_PXY mtu=1450" \ |
| 7140 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7141 | crt_file=data_files/server7_int-ca.crt \ |
| 7142 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7143 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7144 | mtu=1450" \ |
| 7145 | "$P_CLI dtls=1 debug_level=2 \ |
| 7146 | crt_file=data_files/server8_int-ca2.crt \ |
| 7147 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7148 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7149 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7150 | 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] | 7151 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7152 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7153 | -s "found fragmented DTLS handshake message" \ |
| 7154 | -c "found fragmented DTLS handshake message" \ |
| 7155 | -C "error" |
| 7156 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7157 | # An autoreduction on the client-side might happen if the server is |
| 7158 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7159 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7160 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7161 | requires_config_enabled MBEDTLS_RSA_C |
| 7162 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7163 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7164 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7165 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7166 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7167 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7168 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7169 | -p "$P_PXY mtu=512" \ |
| 7170 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7171 | crt_file=data_files/server7_int-ca.crt \ |
| 7172 | key_file=data_files/server7.key \ |
| 7173 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7174 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7175 | mtu=512" \ |
| 7176 | "$P_CLI dtls=1 debug_level=2 \ |
| 7177 | crt_file=data_files/server8_int-ca2.crt \ |
| 7178 | key_file=data_files/server8.key \ |
| 7179 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7180 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7181 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7182 | mtu=512" \ |
| 7183 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7184 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7185 | -s "found fragmented DTLS handshake message" \ |
| 7186 | -c "found fragmented DTLS handshake message" \ |
| 7187 | -C "error" |
| 7188 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7189 | # An autoreduction on the client-side might happen if the server is |
| 7190 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7191 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7192 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7193 | requires_config_enabled MBEDTLS_RSA_C |
| 7194 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7195 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7196 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7197 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7198 | requires_config_enabled MBEDTLS_AES_C |
| 7199 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7200 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7201 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7202 | -p "$P_PXY mtu=512" \ |
| 7203 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7204 | crt_file=data_files/server7_int-ca.crt \ |
| 7205 | key_file=data_files/server7.key \ |
| 7206 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7207 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7208 | mtu=512" \ |
| 7209 | "$P_CLI dtls=1 debug_level=2 \ |
| 7210 | crt_file=data_files/server8_int-ca2.crt \ |
| 7211 | key_file=data_files/server8.key \ |
| 7212 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7213 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7214 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7215 | mtu=512" \ |
| 7216 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7217 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7218 | -s "found fragmented DTLS handshake message" \ |
| 7219 | -c "found fragmented DTLS handshake message" \ |
| 7220 | -C "error" |
| 7221 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7222 | # An autoreduction on the client-side might happen if the server is |
| 7223 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7224 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7225 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7226 | requires_config_enabled MBEDTLS_RSA_C |
| 7227 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7228 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7229 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7230 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7231 | requires_config_enabled MBEDTLS_AES_C |
| 7232 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7233 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7234 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7235 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7236 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7237 | crt_file=data_files/server7_int-ca.crt \ |
| 7238 | key_file=data_files/server7.key \ |
| 7239 | exchanges=2 renegotiation=1 \ |
| 7240 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7241 | hs_timeout=10000-60000 \ |
| 7242 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7243 | "$P_CLI dtls=1 debug_level=2 \ |
| 7244 | crt_file=data_files/server8_int-ca2.crt \ |
| 7245 | key_file=data_files/server8.key \ |
| 7246 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7247 | hs_timeout=10000-60000 \ |
| 7248 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7249 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7250 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7251 | -s "found fragmented DTLS handshake message" \ |
| 7252 | -c "found fragmented DTLS handshake message" \ |
| 7253 | -C "error" |
| 7254 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7255 | # An autoreduction on the client-side might happen if the server is |
| 7256 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7257 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7258 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7259 | requires_config_enabled MBEDTLS_RSA_C |
| 7260 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7261 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7262 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7263 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7264 | requires_config_enabled MBEDTLS_AES_C |
| 7265 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7266 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7267 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7268 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7269 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7270 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7271 | crt_file=data_files/server7_int-ca.crt \ |
| 7272 | key_file=data_files/server7.key \ |
| 7273 | exchanges=2 renegotiation=1 \ |
| 7274 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7275 | hs_timeout=10000-60000 \ |
| 7276 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7277 | "$P_CLI dtls=1 debug_level=2 \ |
| 7278 | crt_file=data_files/server8_int-ca2.crt \ |
| 7279 | key_file=data_files/server8.key \ |
| 7280 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7281 | hs_timeout=10000-60000 \ |
| 7282 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7283 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7284 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7285 | -s "found fragmented DTLS handshake message" \ |
| 7286 | -c "found fragmented DTLS handshake message" \ |
| 7287 | -C "error" |
| 7288 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7289 | # An autoreduction on the client-side might happen if the server is |
| 7290 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7291 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7292 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7293 | requires_config_enabled MBEDTLS_RSA_C |
| 7294 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7295 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7296 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7297 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7298 | requires_config_enabled MBEDTLS_AES_C |
| 7299 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7300 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7301 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7302 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7303 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7304 | crt_file=data_files/server7_int-ca.crt \ |
| 7305 | key_file=data_files/server7.key \ |
| 7306 | exchanges=2 renegotiation=1 \ |
| 7307 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7308 | hs_timeout=10000-60000 \ |
| 7309 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7310 | "$P_CLI dtls=1 debug_level=2 \ |
| 7311 | crt_file=data_files/server8_int-ca2.crt \ |
| 7312 | key_file=data_files/server8.key \ |
| 7313 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7314 | hs_timeout=10000-60000 \ |
| 7315 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7316 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7317 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7318 | -s "found fragmented DTLS handshake message" \ |
| 7319 | -c "found fragmented DTLS handshake message" \ |
| 7320 | -C "error" |
| 7321 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7322 | # 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] | 7323 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7324 | requires_config_enabled MBEDTLS_RSA_C |
| 7325 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7326 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7327 | requires_config_enabled MBEDTLS_AES_C |
| 7328 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7329 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7330 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7331 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7332 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7333 | "$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] | 7334 | crt_file=data_files/server7_int-ca.crt \ |
| 7335 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7336 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7337 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7338 | crt_file=data_files/server8_int-ca2.crt \ |
| 7339 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7340 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7341 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7342 | 0 \ |
| 7343 | -s "found fragmented DTLS handshake message" \ |
| 7344 | -c "found fragmented DTLS handshake message" \ |
| 7345 | -C "error" |
| 7346 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7347 | # 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] | 7348 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7349 | requires_config_enabled MBEDTLS_RSA_C |
| 7350 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7351 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7352 | requires_config_enabled MBEDTLS_AES_C |
| 7353 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7354 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7355 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7356 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7357 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7358 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7359 | crt_file=data_files/server7_int-ca.crt \ |
| 7360 | key_file=data_files/server7.key \ |
| 7361 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7362 | "$P_CLI dtls=1 debug_level=2 \ |
| 7363 | crt_file=data_files/server8_int-ca2.crt \ |
| 7364 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7365 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7366 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7367 | 0 \ |
| 7368 | -s "found fragmented DTLS handshake message" \ |
| 7369 | -c "found fragmented DTLS handshake message" \ |
| 7370 | -C "error" |
| 7371 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7372 | # interop tests for DTLS fragmentating with reliable connection |
| 7373 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7374 | # here and below we just want to test that the we fragment in a way that |
| 7375 | # pleases other implementations, so we don't need the peer to fragment |
| 7376 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7377 | requires_config_enabled MBEDTLS_RSA_C |
| 7378 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7380 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7381 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7382 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7383 | "$G_SRV -u" \ |
| 7384 | "$P_CLI dtls=1 debug_level=2 \ |
| 7385 | crt_file=data_files/server8_int-ca2.crt \ |
| 7386 | key_file=data_files/server8.key \ |
| 7387 | mtu=512 force_version=dtls1_2" \ |
| 7388 | 0 \ |
| 7389 | -c "fragmenting handshake message" \ |
| 7390 | -C "error" |
| 7391 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7392 | # We use --insecure for the GnuTLS client because it expects |
| 7393 | # the hostname / IP it connects to to be the name used in the |
| 7394 | # certificate obtained from the server. Here, however, it |
| 7395 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7396 | # as the server name in the certificate. This will make the |
| 7397 | # certifiate validation fail, but passing --insecure makes |
| 7398 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7399 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7400 | requires_config_enabled MBEDTLS_RSA_C |
| 7401 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7403 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7404 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7405 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7406 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7407 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7408 | crt_file=data_files/server7_int-ca.crt \ |
| 7409 | key_file=data_files/server7.key \ |
| 7410 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7411 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7412 | 0 \ |
| 7413 | -s "fragmenting handshake message" |
| 7414 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7415 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7416 | requires_config_enabled MBEDTLS_RSA_C |
| 7417 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7419 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7420 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7421 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7422 | "$P_CLI dtls=1 debug_level=2 \ |
| 7423 | crt_file=data_files/server8_int-ca2.crt \ |
| 7424 | key_file=data_files/server8.key \ |
| 7425 | mtu=512 force_version=dtls1_2" \ |
| 7426 | 0 \ |
| 7427 | -c "fragmenting handshake message" \ |
| 7428 | -C "error" |
| 7429 | |
| 7430 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7431 | requires_config_enabled MBEDTLS_RSA_C |
| 7432 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7434 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7435 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7436 | "$P_SRV dtls=1 debug_level=2 \ |
| 7437 | crt_file=data_files/server7_int-ca.crt \ |
| 7438 | key_file=data_files/server7.key \ |
| 7439 | mtu=512 force_version=dtls1_2" \ |
| 7440 | "$O_CLI -dtls1_2" \ |
| 7441 | 0 \ |
| 7442 | -s "fragmenting handshake message" |
| 7443 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7444 | # interop tests for DTLS fragmentating with unreliable connection |
| 7445 | # |
| 7446 | # again we just want to test that the we fragment in a way that |
| 7447 | # pleases other implementations, so we don't need the peer to fragment |
| 7448 | requires_gnutls_next |
| 7449 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7450 | requires_config_enabled MBEDTLS_RSA_C |
| 7451 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7453 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7454 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7455 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7456 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7457 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7458 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7459 | crt_file=data_files/server8_int-ca2.crt \ |
| 7460 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7461 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7462 | 0 \ |
| 7463 | -c "fragmenting handshake message" \ |
| 7464 | -C "error" |
| 7465 | |
| 7466 | requires_gnutls_next |
| 7467 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7468 | requires_config_enabled MBEDTLS_RSA_C |
| 7469 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7471 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7472 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7473 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7474 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7475 | "$P_SRV dtls=1 debug_level=2 \ |
| 7476 | crt_file=data_files/server7_int-ca.crt \ |
| 7477 | key_file=data_files/server7.key \ |
| 7478 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7479 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7480 | 0 \ |
| 7481 | -s "fragmenting handshake message" |
| 7482 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7483 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7484 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7485 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7486 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7487 | ## (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] | 7488 | skip_next_test |
| 7489 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7490 | requires_config_enabled MBEDTLS_RSA_C |
| 7491 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7493 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7494 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7495 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7496 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7497 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7498 | "$P_CLI dtls=1 debug_level=2 \ |
| 7499 | crt_file=data_files/server8_int-ca2.crt \ |
| 7500 | key_file=data_files/server8.key \ |
| 7501 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7502 | 0 \ |
| 7503 | -c "fragmenting handshake message" \ |
| 7504 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7505 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7506 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7507 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7508 | requires_config_enabled MBEDTLS_RSA_C |
| 7509 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7511 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7512 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7513 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7514 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7515 | "$P_SRV dtls=1 debug_level=2 \ |
| 7516 | crt_file=data_files/server7_int-ca.crt \ |
| 7517 | key_file=data_files/server7.key \ |
| 7518 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7519 | "$O_CLI -dtls1_2" \ |
| 7520 | 0 \ |
| 7521 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7522 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7523 | # Tests for DTLS-SRTP (RFC 5764) |
| 7524 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7525 | run_test "DTLS-SRTP all profiles supported" \ |
| 7526 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7527 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7528 | 0 \ |
| 7529 | -s "found use_srtp extension" \ |
| 7530 | -s "found srtp profile" \ |
| 7531 | -s "selected srtp profile" \ |
| 7532 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7533 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7534 | -c "client hello, adding use_srtp extension" \ |
| 7535 | -c "found use_srtp extension" \ |
| 7536 | -c "found srtp profile" \ |
| 7537 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7538 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7539 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7540 | -C "error" |
| 7541 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7542 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7543 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7544 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7545 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7546 | "$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] | 7547 | 0 \ |
| 7548 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7549 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7550 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7551 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7552 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7553 | -c "client hello, adding use_srtp extension" \ |
| 7554 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7555 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7556 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7557 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7558 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7559 | -C "error" |
| 7560 | |
| 7561 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7562 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7563 | "$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] | 7564 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7565 | 0 \ |
| 7566 | -s "found use_srtp extension" \ |
| 7567 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7568 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7569 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7570 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7571 | -c "client hello, adding use_srtp extension" \ |
| 7572 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7573 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7574 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7575 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7576 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7577 | -C "error" |
| 7578 | |
| 7579 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7580 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7581 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7582 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7583 | 0 \ |
| 7584 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7585 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7586 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7587 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7588 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7589 | -c "client hello, adding use_srtp extension" \ |
| 7590 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7591 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7592 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7593 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7594 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7595 | -C "error" |
| 7596 | |
| 7597 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7598 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7599 | "$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] | 7600 | "$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] | 7601 | 0 \ |
| 7602 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7603 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7604 | -S "selected srtp profile" \ |
| 7605 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7606 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7607 | -c "client hello, adding use_srtp extension" \ |
| 7608 | -C "found use_srtp extension" \ |
| 7609 | -C "found srtp profile" \ |
| 7610 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7611 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7612 | -C "error" |
| 7613 | |
| 7614 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7615 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7616 | "$P_SRV dtls=1 debug_level=3" \ |
| 7617 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7618 | 0 \ |
| 7619 | -s "found use_srtp extension" \ |
| 7620 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7621 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7622 | -c "client hello, adding use_srtp extension" \ |
| 7623 | -C "found use_srtp extension" \ |
| 7624 | -C "found srtp profile" \ |
| 7625 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7626 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7627 | -C "error" |
| 7628 | |
| 7629 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7630 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7631 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7632 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7633 | 0 \ |
| 7634 | -s "found use_srtp extension" \ |
| 7635 | -s "found srtp profile" \ |
| 7636 | -s "selected srtp profile" \ |
| 7637 | -s "server hello, adding use_srtp extension" \ |
| 7638 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7639 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7640 | -c "client hello, adding use_srtp extension" \ |
| 7641 | -c "found use_srtp extension" \ |
| 7642 | -c "found srtp profile" \ |
| 7643 | -c "selected srtp profile" \ |
| 7644 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7645 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7646 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7647 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7648 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7649 | -C "error" |
| 7650 | |
| 7651 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7652 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7653 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7654 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7655 | 0 \ |
| 7656 | -s "found use_srtp extension" \ |
| 7657 | -s "found srtp profile" \ |
| 7658 | -s "selected srtp profile" \ |
| 7659 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7660 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7661 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7662 | -S "dumping 'using mki' (8 bytes)" \ |
| 7663 | -c "client hello, adding use_srtp extension" \ |
| 7664 | -c "found use_srtp extension" \ |
| 7665 | -c "found srtp profile" \ |
| 7666 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7667 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7668 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7669 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7670 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7671 | -C "dumping 'received mki' (8 bytes)" \ |
| 7672 | -C "error" |
| 7673 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7674 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7675 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7676 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7677 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7678 | 0 \ |
| 7679 | -s "found use_srtp extension" \ |
| 7680 | -s "found srtp profile" \ |
| 7681 | -s "selected srtp profile" \ |
| 7682 | -s "server hello, adding use_srtp extension" \ |
| 7683 | -s "DTLS-SRTP key material is"\ |
| 7684 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7685 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7686 | |
| 7687 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7688 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7689 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7690 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7691 | 0 \ |
| 7692 | -s "found use_srtp extension" \ |
| 7693 | -s "found srtp profile" \ |
| 7694 | -s "selected srtp profile" \ |
| 7695 | -s "server hello, adding use_srtp extension" \ |
| 7696 | -s "DTLS-SRTP key material is"\ |
| 7697 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7698 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7699 | |
| 7700 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7701 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7702 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7703 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7704 | 0 \ |
| 7705 | -s "found use_srtp extension" \ |
| 7706 | -s "found srtp profile" \ |
| 7707 | -s "selected srtp profile" \ |
| 7708 | -s "server hello, adding use_srtp extension" \ |
| 7709 | -s "DTLS-SRTP key material is"\ |
| 7710 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7711 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7712 | |
| 7713 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7714 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7715 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7716 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7717 | 0 \ |
| 7718 | -s "found use_srtp extension" \ |
| 7719 | -s "found srtp profile" \ |
| 7720 | -s "selected srtp profile" \ |
| 7721 | -s "server hello, adding use_srtp extension" \ |
| 7722 | -s "DTLS-SRTP key material is"\ |
| 7723 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7724 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7725 | |
| 7726 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7727 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7728 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7729 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7730 | 0 \ |
| 7731 | -s "found use_srtp extension" \ |
| 7732 | -s "found srtp profile" \ |
| 7733 | -s "selected srtp profile" \ |
| 7734 | -s "server hello, adding use_srtp extension" \ |
| 7735 | -s "DTLS-SRTP key material is"\ |
| 7736 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7737 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7738 | |
| 7739 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7740 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7741 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7742 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7743 | 0 \ |
| 7744 | -s "found use_srtp extension" \ |
| 7745 | -s "found srtp profile" \ |
| 7746 | -S "selected srtp profile" \ |
| 7747 | -S "server hello, adding use_srtp extension" \ |
| 7748 | -S "DTLS-SRTP key material is"\ |
| 7749 | -C "SRTP Extension negotiated, profile" |
| 7750 | |
| 7751 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7752 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7753 | "$P_SRV dtls=1 debug_level=3" \ |
| 7754 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7755 | 0 \ |
| 7756 | -s "found use_srtp extension" \ |
| 7757 | -S "server hello, adding use_srtp extension" \ |
| 7758 | -S "DTLS-SRTP key material is"\ |
| 7759 | -C "SRTP Extension negotiated, profile" |
| 7760 | |
| 7761 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7762 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7763 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7764 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7765 | 0 \ |
| 7766 | -c "client hello, adding use_srtp extension" \ |
| 7767 | -c "found use_srtp extension" \ |
| 7768 | -c "found srtp profile" \ |
| 7769 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7770 | -c "DTLS-SRTP key material is"\ |
| 7771 | -C "error" |
| 7772 | |
| 7773 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7774 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7775 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7776 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7777 | 0 \ |
| 7778 | -c "client hello, adding use_srtp extension" \ |
| 7779 | -c "found use_srtp extension" \ |
| 7780 | -c "found srtp profile" \ |
| 7781 | -c "selected srtp profile" \ |
| 7782 | -c "DTLS-SRTP key material is"\ |
| 7783 | -C "error" |
| 7784 | |
| 7785 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7786 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7787 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7788 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7789 | 0 \ |
| 7790 | -c "client hello, adding use_srtp extension" \ |
| 7791 | -c "found use_srtp extension" \ |
| 7792 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7793 | -c "selected srtp profile" \ |
| 7794 | -c "DTLS-SRTP key material is"\ |
| 7795 | -C "error" |
| 7796 | |
| 7797 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7798 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7799 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7800 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7801 | 0 \ |
| 7802 | -c "client hello, adding use_srtp extension" \ |
| 7803 | -c "found use_srtp extension" \ |
| 7804 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7805 | -c "selected srtp profile" \ |
| 7806 | -c "DTLS-SRTP key material is"\ |
| 7807 | -C "error" |
| 7808 | |
| 7809 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7810 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7811 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7812 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7813 | 0 \ |
| 7814 | -c "client hello, adding use_srtp extension" \ |
| 7815 | -c "found use_srtp extension" \ |
| 7816 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7817 | -c "selected srtp profile" \ |
| 7818 | -c "DTLS-SRTP key material is"\ |
| 7819 | -C "error" |
| 7820 | |
| 7821 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7822 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7823 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7824 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7825 | 0 \ |
| 7826 | -c "client hello, adding use_srtp extension" \ |
| 7827 | -C "found use_srtp extension" \ |
| 7828 | -C "found srtp profile" \ |
| 7829 | -C "selected srtp profile" \ |
| 7830 | -C "DTLS-SRTP key material is"\ |
| 7831 | -C "error" |
| 7832 | |
| 7833 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7834 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7835 | "$O_SRV -dtls" \ |
| 7836 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7837 | 0 \ |
| 7838 | -c "client hello, adding use_srtp extension" \ |
| 7839 | -C "found use_srtp extension" \ |
| 7840 | -C "found srtp profile" \ |
| 7841 | -C "selected srtp profile" \ |
| 7842 | -C "DTLS-SRTP key material is"\ |
| 7843 | -C "error" |
| 7844 | |
| 7845 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7846 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7847 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7848 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7849 | 0 \ |
| 7850 | -c "client hello, adding use_srtp extension" \ |
| 7851 | -c "found use_srtp extension" \ |
| 7852 | -c "found srtp profile" \ |
| 7853 | -c "selected srtp profile" \ |
| 7854 | -c "DTLS-SRTP key material is"\ |
| 7855 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7856 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7857 | -C "dumping 'received mki' (8 bytes)" \ |
| 7858 | -C "error" |
| 7859 | |
| 7860 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7861 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7862 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7863 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7864 | "$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] | 7865 | 0 \ |
| 7866 | -s "found use_srtp extension" \ |
| 7867 | -s "found srtp profile" \ |
| 7868 | -s "selected srtp profile" \ |
| 7869 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7870 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7871 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 7872 | |
| 7873 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7874 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7875 | 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] | 7876 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7877 | "$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] | 7878 | 0 \ |
| 7879 | -s "found use_srtp extension" \ |
| 7880 | -s "found srtp profile" \ |
| 7881 | -s "selected srtp profile" \ |
| 7882 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7883 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7884 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 7885 | |
| 7886 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7887 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7888 | 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] | 7889 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7890 | "$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] | 7891 | 0 \ |
| 7892 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7893 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7894 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7895 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7896 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7897 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7898 | |
| 7899 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7900 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7901 | 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] | 7902 | "$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] | 7903 | "$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] | 7904 | 0 \ |
| 7905 | -s "found use_srtp extension" \ |
| 7906 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7907 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7908 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7909 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7910 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 7911 | |
| 7912 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7913 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7914 | 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] | 7915 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7916 | "$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] | 7917 | 0 \ |
| 7918 | -s "found use_srtp extension" \ |
| 7919 | -s "found srtp profile" \ |
| 7920 | -s "selected srtp profile" \ |
| 7921 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7922 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7923 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7924 | |
| 7925 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7926 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7927 | 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] | 7928 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7929 | "$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] | 7930 | 0 \ |
| 7931 | -s "found use_srtp extension" \ |
| 7932 | -s "found srtp profile" \ |
| 7933 | -S "selected srtp profile" \ |
| 7934 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7935 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7936 | -C "SRTP profile:" |
| 7937 | |
| 7938 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7939 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7940 | 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] | 7941 | "$P_SRV dtls=1 debug_level=3" \ |
| 7942 | "$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] | 7943 | 0 \ |
| 7944 | -s "found use_srtp extension" \ |
| 7945 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7946 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7947 | -C "SRTP profile:" |
| 7948 | |
| 7949 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7950 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7951 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 7952 | "$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" \ |
| 7953 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7954 | 0 \ |
| 7955 | -c "client hello, adding use_srtp extension" \ |
| 7956 | -c "found use_srtp extension" \ |
| 7957 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7958 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7959 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7960 | -C "error" |
| 7961 | |
| 7962 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7963 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7964 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 7965 | "$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" \ |
| 7966 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7967 | 0 \ |
| 7968 | -c "client hello, adding use_srtp extension" \ |
| 7969 | -c "found use_srtp extension" \ |
| 7970 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7971 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7972 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7973 | -C "error" |
| 7974 | |
| 7975 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7976 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7977 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 7978 | "$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" \ |
| 7979 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7980 | 0 \ |
| 7981 | -c "client hello, adding use_srtp extension" \ |
| 7982 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7983 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7984 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7985 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7986 | -C "error" |
| 7987 | |
| 7988 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7989 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7990 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 7991 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7992 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7993 | 0 \ |
| 7994 | -c "client hello, adding use_srtp extension" \ |
| 7995 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7996 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7997 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7998 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7999 | -C "error" |
| 8000 | |
| 8001 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8002 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8003 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8004 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8005 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8006 | 0 \ |
| 8007 | -c "client hello, adding use_srtp extension" \ |
| 8008 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8009 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8010 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8011 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8012 | -C "error" |
| 8013 | |
| 8014 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8015 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8016 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8017 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8018 | "$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] | 8019 | 0 \ |
| 8020 | -c "client hello, adding use_srtp extension" \ |
| 8021 | -C "found use_srtp extension" \ |
| 8022 | -C "found srtp profile" \ |
| 8023 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8024 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8025 | -C "error" |
| 8026 | |
| 8027 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8028 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8029 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8030 | "$G_SRV -u" \ |
| 8031 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8032 | 0 \ |
| 8033 | -c "client hello, adding use_srtp extension" \ |
| 8034 | -C "found use_srtp extension" \ |
| 8035 | -C "found srtp profile" \ |
| 8036 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8037 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8038 | -C "error" |
| 8039 | |
| 8040 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8041 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8042 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8043 | "$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" \ |
| 8044 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8045 | 0 \ |
| 8046 | -c "client hello, adding use_srtp extension" \ |
| 8047 | -c "found use_srtp extension" \ |
| 8048 | -c "found srtp profile" \ |
| 8049 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8050 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8051 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8052 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8053 | -c "dumping 'received mki' (8 bytes)" \ |
| 8054 | -C "error" |
| 8055 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8056 | # Tests for specific things with "unreliable" UDP connection |
| 8057 | |
| 8058 | not_with_valgrind # spurious resend due to timeout |
| 8059 | run_test "DTLS proxy: reference" \ |
| 8060 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8061 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8062 | "$P_CLI dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8063 | 0 \ |
| 8064 | -C "replayed record" \ |
| 8065 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8066 | -C "Buffer record from epoch" \ |
| 8067 | -S "Buffer record from epoch" \ |
| 8068 | -C "ssl_buffer_message" \ |
| 8069 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8070 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8071 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8072 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8073 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8074 | -c "HTTP/1.0 200 OK" |
| 8075 | |
| 8076 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8077 | run_test "DTLS proxy: duplicate every packet" \ |
| 8078 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8079 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8080 | "$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] | 8081 | 0 \ |
| 8082 | -c "replayed record" \ |
| 8083 | -s "replayed record" \ |
| 8084 | -c "record from another epoch" \ |
| 8085 | -s "record from another epoch" \ |
| 8086 | -S "resend" \ |
| 8087 | -s "Extra-header:" \ |
| 8088 | -c "HTTP/1.0 200 OK" |
| 8089 | |
| 8090 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8091 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8092 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8093 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8094 | 0 \ |
| 8095 | -c "replayed record" \ |
| 8096 | -S "replayed record" \ |
| 8097 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8098 | -s "record from another epoch" \ |
| 8099 | -c "resend" \ |
| 8100 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8101 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8102 | -c "HTTP/1.0 200 OK" |
| 8103 | |
| 8104 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8105 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8106 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8107 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8108 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8109 | -c "next record in same datagram" \ |
| 8110 | -s "next record in same datagram" |
| 8111 | |
| 8112 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8113 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8114 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8115 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8116 | 0 \ |
| 8117 | -c "next record in same datagram" \ |
| 8118 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8119 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8120 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8121 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8122 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8123 | "$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] | 8124 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8125 | -c "discarding invalid record (mac)" \ |
| 8126 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8127 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8128 | -c "HTTP/1.0 200 OK" \ |
| 8129 | -S "too many records with bad MAC" \ |
| 8130 | -S "Verification of the message MAC failed" |
| 8131 | |
| 8132 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8133 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8134 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8135 | "$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] | 8136 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8137 | -C "discarding invalid record (mac)" \ |
| 8138 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8139 | -S "Extra-header:" \ |
| 8140 | -C "HTTP/1.0 200 OK" \ |
| 8141 | -s "too many records with bad MAC" \ |
| 8142 | -s "Verification of the message MAC failed" |
| 8143 | |
| 8144 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8145 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8146 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8147 | "$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] | 8148 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8149 | -c "discarding invalid record (mac)" \ |
| 8150 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8151 | -s "Extra-header:" \ |
| 8152 | -c "HTTP/1.0 200 OK" \ |
| 8153 | -S "too many records with bad MAC" \ |
| 8154 | -S "Verification of the message MAC failed" |
| 8155 | |
| 8156 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8157 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8158 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8159 | "$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] | 8160 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8161 | -c "discarding invalid record (mac)" \ |
| 8162 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8163 | -s "Extra-header:" \ |
| 8164 | -c "HTTP/1.0 200 OK" \ |
| 8165 | -s "too many records with bad MAC" \ |
| 8166 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8167 | |
| 8168 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8169 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8170 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8171 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8172 | 0 \ |
| 8173 | -c "record from another epoch" \ |
| 8174 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8175 | -s "Extra-header:" \ |
| 8176 | -c "HTTP/1.0 200 OK" |
| 8177 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8178 | # Tests for reordering support with DTLS |
| 8179 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8180 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8181 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8182 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8183 | hs_timeout=2500-60000" \ |
| 8184 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8185 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8186 | 0 \ |
| 8187 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8188 | -c "Next handshake message has been buffered - load"\ |
| 8189 | -S "Buffering HS message" \ |
| 8190 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8191 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8192 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8193 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8194 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8195 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8196 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8197 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8198 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8199 | hs_timeout=2500-60000" \ |
| 8200 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8201 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8202 | 0 \ |
| 8203 | -c "Buffering HS message" \ |
| 8204 | -c "found fragmented DTLS handshake message"\ |
| 8205 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8206 | -c "Next handshake message has been buffered - load"\ |
| 8207 | -S "Buffering HS message" \ |
| 8208 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8209 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8210 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8211 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8212 | -S "Remember CCS message" |
| 8213 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8214 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8215 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8216 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8217 | # while keeping the ServerKeyExchange. |
| 8218 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8219 | 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] | 8220 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8221 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8222 | hs_timeout=2500-60000" \ |
| 8223 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8224 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8225 | 0 \ |
| 8226 | -c "Buffering HS message" \ |
| 8227 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8228 | -C "attempt to make space by freeing buffered messages" \ |
| 8229 | -S "Buffering HS message" \ |
| 8230 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8231 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8232 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8233 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8234 | -S "Remember CCS message" |
| 8235 | |
| 8236 | # The size constraints ensure that the delayed certificate message can't |
| 8237 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8238 | # when dropping it first. |
| 8239 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8240 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8241 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8242 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8243 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8244 | hs_timeout=2500-60000" \ |
| 8245 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8246 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8247 | 0 \ |
| 8248 | -c "Buffering HS message" \ |
| 8249 | -c "attempt to make space by freeing buffered future messages" \ |
| 8250 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8251 | -S "Buffering HS message" \ |
| 8252 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8253 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8254 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8255 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8256 | -S "Remember CCS message" |
| 8257 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8258 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8259 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8260 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8261 | hs_timeout=2500-60000" \ |
| 8262 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8263 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8264 | 0 \ |
| 8265 | -C "Buffering HS message" \ |
| 8266 | -C "Next handshake message has been buffered - load"\ |
| 8267 | -s "Buffering HS message" \ |
| 8268 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8269 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8270 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8271 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8272 | -S "Remember CCS message" |
| 8273 | |
| 8274 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8275 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8276 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8277 | hs_timeout=2500-60000" \ |
| 8278 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8279 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8280 | 0 \ |
| 8281 | -C "Buffering HS message" \ |
| 8282 | -C "Next handshake message has been buffered - load"\ |
| 8283 | -S "Buffering HS message" \ |
| 8284 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8285 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8286 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8287 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8288 | -S "Remember CCS message" |
| 8289 | |
| 8290 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8291 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8292 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8293 | hs_timeout=2500-60000" \ |
| 8294 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8295 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8296 | 0 \ |
| 8297 | -C "Buffering HS message" \ |
| 8298 | -C "Next handshake message has been buffered - load"\ |
| 8299 | -S "Buffering HS message" \ |
| 8300 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8301 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8302 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8303 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8304 | -s "Remember CCS message" |
| 8305 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8306 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8307 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8308 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8309 | hs_timeout=2500-60000" \ |
| 8310 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8311 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8312 | 0 \ |
| 8313 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8314 | -s "Found buffered record from current epoch - load" \ |
| 8315 | -c "Buffer record from epoch 1" \ |
| 8316 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8317 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8318 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8319 | # from the server are delayed, so that the encrypted Finished message |
| 8320 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8321 | # in afterwards, the encrypted Finished message must be freed in order |
| 8322 | # to make space for the NewSessionTicket to be reassembled. |
| 8323 | # This works only in very particular circumstances: |
| 8324 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8325 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8326 | # the encrypted Finished message. |
| 8327 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8328 | # needs to be fragmented. |
| 8329 | # - All messages sent by the server must be small enough to be either sent |
| 8330 | # without fragmentation or be reassembled within the bounds of |
| 8331 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8332 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8333 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8334 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8335 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8336 | -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] | 8337 | "$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] | 8338 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8339 | 0 \ |
| 8340 | -s "Buffer record from epoch 1" \ |
| 8341 | -s "Found buffered record from current epoch - load" \ |
| 8342 | -c "Buffer record from epoch 1" \ |
| 8343 | -C "Found buffered record from current epoch - load" \ |
| 8344 | -c "Enough space available after freeing future epoch record" |
| 8345 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8346 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8347 | |
| 8348 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8349 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8350 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8351 | "$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] | 8352 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8353 | "$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] | 8354 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8355 | 0 \ |
| 8356 | -s "Extra-header:" \ |
| 8357 | -c "HTTP/1.0 200 OK" |
| 8358 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8359 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8360 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8361 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8362 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8363 | "$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] | 8364 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8365 | 0 \ |
| 8366 | -s "Extra-header:" \ |
| 8367 | -c "HTTP/1.0 200 OK" |
| 8368 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8369 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8370 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8371 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8372 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8373 | "$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] | 8374 | 0 \ |
| 8375 | -s "Extra-header:" \ |
| 8376 | -c "HTTP/1.0 200 OK" |
| 8377 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8378 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8379 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8380 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8381 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8382 | "$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] | 8383 | 0 \ |
| 8384 | -s "Extra-header:" \ |
| 8385 | -c "HTTP/1.0 200 OK" |
| 8386 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8387 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8388 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8389 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8390 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8391 | "$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] | 8392 | 0 \ |
| 8393 | -s "Extra-header:" \ |
| 8394 | -c "HTTP/1.0 200 OK" |
| 8395 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8396 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8397 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8398 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8399 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8400 | "$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] | 8401 | 0 \ |
| 8402 | -s "Extra-header:" \ |
| 8403 | -c "HTTP/1.0 200 OK" |
| 8404 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8405 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8406 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8407 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8408 | "$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] | 8409 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8410 | "$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] | 8411 | 0 \ |
| 8412 | -s "Extra-header:" \ |
| 8413 | -c "HTTP/1.0 200 OK" |
| 8414 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8415 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8416 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8417 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8418 | "$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] | 8419 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8420 | "$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] | 8421 | 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] | 8422 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8423 | 0 \ |
| 8424 | -s "a session has been resumed" \ |
| 8425 | -c "a session has been resumed" \ |
| 8426 | -s "Extra-header:" \ |
| 8427 | -c "HTTP/1.0 200 OK" |
| 8428 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8429 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8430 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8431 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8432 | "$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] | 8433 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8434 | "$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] | 8435 | 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] | 8436 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8437 | 0 \ |
| 8438 | -s "a session has been resumed" \ |
| 8439 | -c "a session has been resumed" \ |
| 8440 | -s "Extra-header:" \ |
| 8441 | -c "HTTP/1.0 200 OK" |
| 8442 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8443 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8444 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8445 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8446 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8447 | "$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] | 8448 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8449 | "$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] | 8450 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8451 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8452 | 0 \ |
| 8453 | -c "=> renegotiate" \ |
| 8454 | -s "=> renegotiate" \ |
| 8455 | -s "Extra-header:" \ |
| 8456 | -c "HTTP/1.0 200 OK" |
| 8457 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8458 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8460 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8461 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8462 | "$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] | 8463 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8464 | "$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] | 8465 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8466 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8467 | 0 \ |
| 8468 | -c "=> renegotiate" \ |
| 8469 | -s "=> renegotiate" \ |
| 8470 | -s "Extra-header:" \ |
| 8471 | -c "HTTP/1.0 200 OK" |
| 8472 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8473 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8474 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8475 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8476 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8477 | "$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] | 8478 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8479 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8480 | "$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] | 8481 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8482 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8483 | 0 \ |
| 8484 | -c "=> renegotiate" \ |
| 8485 | -s "=> renegotiate" \ |
| 8486 | -s "Extra-header:" \ |
| 8487 | -c "HTTP/1.0 200 OK" |
| 8488 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8489 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8490 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8491 | 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] | 8492 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8493 | "$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] | 8494 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8495 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8496 | "$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] | 8497 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8498 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8499 | 0 \ |
| 8500 | -c "=> renegotiate" \ |
| 8501 | -s "=> renegotiate" \ |
| 8502 | -s "Extra-header:" \ |
| 8503 | -c "HTTP/1.0 200 OK" |
| 8504 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8505 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8506 | ## all versions installed on the CI machines), reported here: |
| 8507 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8508 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8509 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8510 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8511 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8512 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8513 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8514 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8515 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8516 | "$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] | 8517 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8518 | -c "HTTP/1.0 200 OK" |
| 8519 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8520 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8521 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8522 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8523 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8524 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8525 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8526 | "$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] | 8527 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8528 | -c "HTTP/1.0 200 OK" |
| 8529 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8530 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8531 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8532 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8533 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8534 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8535 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8536 | "$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] | 8537 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8538 | -c "HTTP/1.0 200 OK" |
| 8539 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8540 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8541 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8542 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8543 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8544 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8545 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8546 | "$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] | 8547 | 0 \ |
| 8548 | -s "Extra-header:" \ |
| 8549 | -c "Extra-header:" |
| 8550 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8551 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8552 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8553 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8554 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8555 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8556 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8557 | "$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] | 8558 | 0 \ |
| 8559 | -s "Extra-header:" \ |
| 8560 | -c "Extra-header:" |
| 8561 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8562 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8563 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8564 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8565 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8566 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8567 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8568 | "$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] | 8569 | 0 \ |
| 8570 | -s "Extra-header:" \ |
| 8571 | -c "Extra-header:" |
| 8572 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8573 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8574 | run_test "export keys functionality" \ |
| 8575 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8576 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8577 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8578 | -c "EAP-TLS key material is:"\ |
| 8579 | -s "EAP-TLS key material is:"\ |
| 8580 | -c "EAP-TLS IV is:" \ |
| 8581 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8582 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8583 | # openssl feature tests: check if tls1.3 exists. |
| 8584 | requires_openssl_tls1_3 |
| 8585 | run_test "TLS1.3: Test openssl tls1_3 feature" \ |
| 8586 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8587 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8588 | 0 \ |
| 8589 | -c "TLS 1.3" \ |
| 8590 | -s "TLS 1.3" |
| 8591 | |
| 8592 | # gnutls feature tests: check if tls1.3 exists. |
| 8593 | requires_gnutls_tls1_3 |
| 8594 | run_test "TLS1.3: Test gnutls tls1_3 feature" \ |
| 8595 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 8596 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V" \ |
| 8597 | 0 \ |
| 8598 | -s "Version: TLS1.3" \ |
| 8599 | -c "Version: TLS1.3" |
| 8600 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8601 | # TLS1.3 test cases |
| 8602 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8604 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8605 | skip_handshake_stage_check |
| 8606 | run_test "TLS1.3: Not supported version check: tls1_2 and tls1_3" \ |
| 8607 | "$P_SRV debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8608 | "$P_CLI debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8609 | 1 \ |
| 8610 | -s "SSL - The requested feature is not available" \ |
| 8611 | -c "SSL - The requested feature is not available" \ |
| 8612 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8613 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8614 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8617 | run_test "TLS1.3: handshake dispatch test: tls1_3 only" \ |
| 8618 | "$P_SRV min_version=tls1_3 max_version=tls1_3" \ |
| 8619 | "$P_CLI min_version=tls1_3 max_version=tls1_3" \ |
| 8620 | 1 \ |
| 8621 | -s "SSL - The requested feature is not available" \ |
| 8622 | -c "SSL - The requested feature is not available" |
| 8623 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8624 | # Test heap memory usage after handshake |
| 8625 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8626 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8627 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8628 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8629 | run_tests_memory_after_hanshake |
| 8630 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8631 | # Final report |
| 8632 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8633 | echo "------------------------------------------------------------------------" |
| 8634 | |
| 8635 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8636 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8637 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8638 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8639 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8640 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8641 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8642 | |
| 8643 | exit $FAILS |