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} |
Jerry Yu | bbfa1d8 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 48 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 49 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 50 | : ${GNUTLS_CLI:=gnutls-cli} |
| 51 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 52 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 53 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 54 | guess_config_name() { |
| 55 | if git diff --quiet ../include/mbedtls/config.h 2>/dev/null; then |
| 56 | echo "default" |
| 57 | else |
| 58 | echo "unknown" |
| 59 | fi |
| 60 | } |
| 61 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 62 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 63 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 64 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 65 | 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] | 66 | 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] | 67 | 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] | 68 | 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] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 72 | |
| 73 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 74 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 75 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 76 | else |
| 77 | O_LEGACY_SRV=false |
| 78 | O_LEGACY_CLI=false |
| 79 | fi |
| 80 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 81 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 82 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 83 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 84 | else |
| 85 | O_NEXT_SRV=false |
| 86 | O_NEXT_CLI=false |
| 87 | fi |
| 88 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 89 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 90 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 91 | else |
| 92 | G_NEXT_SRV=false |
| 93 | fi |
| 94 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 95 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 96 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 97 | else |
| 98 | G_NEXT_CLI=false |
| 99 | fi |
| 100 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 101 | TESTS=0 |
| 102 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 103 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 104 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 105 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 106 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 107 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 108 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 109 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 110 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 111 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 112 | RUN_TEST_NUMBER='' |
| 113 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 114 | PRESERVE_LOGS=0 |
| 115 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 116 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 117 | # port which is this plus 10000. Each port number may be independently |
| 118 | # overridden by a command line option. |
| 119 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 120 | PXY_PORT=$((SRV_PORT + 10000)) |
| 121 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 122 | print_usage() { |
| 123 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 124 | printf " -h|--help\tPrint this help.\n" |
| 125 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 126 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 127 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 128 | 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] | 129 | 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] | 130 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 131 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 132 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 133 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 134 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 135 | 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] | 136 | } |
| 137 | |
| 138 | get_options() { |
| 139 | while [ $# -gt 0 ]; do |
| 140 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 141 | -f|--filter) |
| 142 | shift; FILTER=$1 |
| 143 | ;; |
| 144 | -e|--exclude) |
| 145 | shift; EXCLUDE=$1 |
| 146 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 147 | -m|--memcheck) |
| 148 | MEMCHECK=1 |
| 149 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 150 | -n|--number) |
| 151 | shift; RUN_TEST_NUMBER=$1 |
| 152 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 153 | -s|--show-numbers) |
| 154 | SHOW_TEST_NUMBER=1 |
| 155 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 156 | -p|--preserve-logs) |
| 157 | PRESERVE_LOGS=1 |
| 158 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 159 | --port) |
| 160 | shift; SRV_PORT=$1 |
| 161 | ;; |
| 162 | --proxy-port) |
| 163 | shift; PXY_PORT=$1 |
| 164 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 165 | --seed) |
| 166 | shift; SEED="$1" |
| 167 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 168 | -h|--help) |
| 169 | print_usage |
| 170 | exit 0 |
| 171 | ;; |
| 172 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 173 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 174 | print_usage |
| 175 | exit 1 |
| 176 | ;; |
| 177 | esac |
| 178 | shift |
| 179 | done |
| 180 | } |
| 181 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 182 | # Make the outcome file path relative to the original directory, not |
| 183 | # to .../tests |
| 184 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 185 | [!/]*) |
| 186 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 187 | ;; |
| 188 | esac |
| 189 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 190 | # Read boolean configuration options from config.h for easy and quick |
| 191 | # testing. Skip non-boolean options (with something other than spaces |
| 192 | # and a comment after "#define SYMBOL"). The variable contains a |
| 193 | # space-separated list of symbols. |
Jerry Yu | cf080ce | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 194 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 195 | # Skip next test; use this macro to skip tests which are legitimate |
| 196 | # in theory and expected to be re-introduced at some point, but |
| 197 | # aren't expected to succeed at the moment due to problems outside |
| 198 | # our control (such as bugs in other TLS implementations). |
| 199 | skip_next_test() { |
| 200 | SKIP_NEXT="YES" |
| 201 | } |
| 202 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 203 | # skip next test if the flag is not enabled in config.h |
| 204 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 205 | case $CONFIGS_ENABLED in |
Jerry Yu | 969c01a | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 206 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 207 | *) SKIP_NEXT="YES";; |
| 208 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 209 | } |
| 210 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 211 | # skip next test if the flag is enabled in config.h |
| 212 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 213 | case $CONFIGS_ENABLED in |
Jerry Yu | 969c01a | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 214 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 215 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 216 | } |
| 217 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 218 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 219 | # This function uses the query_config command line option to query the |
| 220 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 221 | # program. The command will always return a success value if the |
| 222 | # configuration is defined and the value will be printed to stdout. |
| 223 | # |
| 224 | # Note that if the configuration is not defined or is defined to nothing, |
| 225 | # the output of this function will be an empty string. |
| 226 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 230 | VAL="$( get_config_value_or_default "$1" )" |
| 231 | if [ -z "$VAL" ]; then |
| 232 | # Should never happen |
| 233 | echo "Mbed TLS configuration $1 is not defined" |
| 234 | exit 1 |
| 235 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 236 | SKIP_NEXT="YES" |
| 237 | fi |
| 238 | } |
| 239 | |
| 240 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 241 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 242 | if [ -z "$VAL" ]; then |
| 243 | # Should never happen |
| 244 | echo "Mbed TLS configuration $1 is not defined" |
| 245 | exit 1 |
| 246 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 247 | SKIP_NEXT="YES" |
| 248 | fi |
| 249 | } |
| 250 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 251 | requires_config_value_equals() { |
| 252 | VAL=$( get_config_value_or_default "$1" ) |
| 253 | if [ -z "$VAL" ]; then |
| 254 | # Should never happen |
| 255 | echo "Mbed TLS configuration $1 is not defined" |
| 256 | exit 1 |
| 257 | elif [ "$VAL" -ne "$2" ]; then |
| 258 | SKIP_NEXT="YES" |
| 259 | fi |
| 260 | } |
| 261 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 262 | # Space-separated list of ciphersuites supported by this build of |
| 263 | # Mbed TLS. |
| 264 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 265 | grep TLS- | |
| 266 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 267 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 268 | case $P_CIPHERSUITES in |
| 269 | *" $1 "*) :;; |
| 270 | *) SKIP_NEXT="YES";; |
| 271 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 272 | } |
| 273 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 274 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 275 | # If CMD (call to a TLS client or server program) requires a specific |
| 276 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
| 277 | # enabled. As an exception, do run the test case if it expects a ciphersuite |
| 278 | # mismatch. |
| 279 | maybe_requires_ciphersuite_enabled() { |
| 280 | case "$1" in |
| 281 | *\ force_ciphersuite=*) :;; |
| 282 | *) return;; # No specific required ciphersuite |
| 283 | esac |
| 284 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 285 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 286 | shift |
| 287 | |
| 288 | case "$*" in |
| 289 | *"-s SSL - The server has no ciphersuites in common"*) |
| 290 | # This test case expects a ciphersuite mismatch, so it doesn't |
| 291 | # require the ciphersuite to be enabled. |
| 292 | ;; |
| 293 | *) |
| 294 | requires_ciphersuite_enabled "$ciphersuite" |
| 295 | ;; |
| 296 | esac |
| 297 | |
| 298 | unset ciphersuite |
| 299 | } |
| 300 | |
Gilles Peskine | 89d892f | 2022-02-25 19:52:52 +0100 | [diff] [blame^] | 301 | adapt_cmd_for_psk () { |
| 302 | case "$2" in |
| 303 | *openssl*) s='-psk abc123 -nocert';; |
| 304 | *gnutls-*) s='--pskkey=abc123';; |
| 305 | *) s='psk=abc123';; |
| 306 | esac |
| 307 | eval $1='"$2 $s"' |
| 308 | unset s |
| 309 | } |
| 310 | |
| 311 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 312 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 313 | # |
| 314 | # If not running in a PSK-only build, do nothing. |
| 315 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 316 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 317 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 318 | # a pre-shared key, do nothing. |
| 319 | # |
| 320 | # This code does not consider builds with ECDH-PSK or RSA-PSK. |
| 321 | # |
| 322 | # Inputs: |
| 323 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 324 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 325 | # * "$@": options passed to run_test. |
| 326 | # |
| 327 | # Outputs: |
| 328 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 329 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 330 | maybe_adapt_for_psk() { |
| 331 | if [ "$PSK_ONLY" != "YES" ]; then |
| 332 | return |
| 333 | fi |
| 334 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 335 | return |
| 336 | fi |
| 337 | case "$CLI_CMD $SRV_CMD" in |
| 338 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 339 | return;; |
| 340 | *force_ciphersuite*) |
| 341 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 342 | # PSK cipher suite could be substituted, but we're not ready for |
| 343 | # that yet. |
| 344 | SKIP_NEXT="YES" |
| 345 | return;; |
| 346 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 347 | # The test case involves certificates. PSK won't do. |
| 348 | SKIP_NEXT="YES" |
| 349 | return;; |
| 350 | esac |
| 351 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 352 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 353 | } |
| 354 | |
| 355 | case " $CONFIGS_ENABLED " in |
| 356 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 357 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 358 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 359 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 360 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 361 | *) PSK_ONLY="NO";; |
| 362 | esac |
| 363 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 364 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 365 | requires_openssl_with_fallback_scsv() { |
| 366 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 367 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 368 | then |
| 369 | OPENSSL_HAS_FBSCSV="YES" |
| 370 | else |
| 371 | OPENSSL_HAS_FBSCSV="NO" |
| 372 | fi |
| 373 | fi |
| 374 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 375 | SKIP_NEXT="YES" |
| 376 | fi |
| 377 | } |
| 378 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 379 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 380 | requires_max_content_len() { |
| 381 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 382 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 383 | } |
| 384 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 385 | # skip next test if GnuTLS isn't available |
| 386 | requires_gnutls() { |
| 387 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 388 | 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] | 389 | GNUTLS_AVAILABLE="YES" |
| 390 | else |
| 391 | GNUTLS_AVAILABLE="NO" |
| 392 | fi |
| 393 | fi |
| 394 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 395 | SKIP_NEXT="YES" |
| 396 | fi |
| 397 | } |
| 398 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 399 | # skip next test if GnuTLS-next isn't available |
| 400 | requires_gnutls_next() { |
| 401 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 402 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 403 | GNUTLS_NEXT_AVAILABLE="YES" |
| 404 | else |
| 405 | GNUTLS_NEXT_AVAILABLE="NO" |
| 406 | fi |
| 407 | fi |
| 408 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 409 | SKIP_NEXT="YES" |
| 410 | fi |
| 411 | } |
| 412 | |
| 413 | # skip next test if OpenSSL-legacy isn't available |
| 414 | requires_openssl_legacy() { |
| 415 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 416 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 417 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 418 | else |
| 419 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 420 | fi |
| 421 | fi |
| 422 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 423 | SKIP_NEXT="YES" |
| 424 | fi |
| 425 | } |
| 426 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 427 | requires_openssl_next() { |
| 428 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 429 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 430 | OPENSSL_NEXT_AVAILABLE="YES" |
| 431 | else |
| 432 | OPENSSL_NEXT_AVAILABLE="NO" |
| 433 | fi |
| 434 | fi |
| 435 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 436 | SKIP_NEXT="YES" |
| 437 | fi |
| 438 | } |
| 439 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 440 | # skip next test if IPv6 isn't available on this host |
| 441 | requires_ipv6() { |
| 442 | if [ -z "${HAS_IPV6:-}" ]; then |
| 443 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 444 | SRV_PID=$! |
| 445 | sleep 1 |
| 446 | kill $SRV_PID >/dev/null 2>&1 |
| 447 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 448 | HAS_IPV6="NO" |
| 449 | else |
| 450 | HAS_IPV6="YES" |
| 451 | fi |
| 452 | rm -r $SRV_OUT |
| 453 | fi |
| 454 | |
| 455 | if [ "$HAS_IPV6" = "NO" ]; then |
| 456 | SKIP_NEXT="YES" |
| 457 | fi |
| 458 | } |
| 459 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 460 | # skip next test if it's i686 or uname is not available |
| 461 | requires_not_i686() { |
| 462 | if [ -z "${IS_I686:-}" ]; then |
| 463 | IS_I686="YES" |
| 464 | if which "uname" >/dev/null 2>&1; then |
| 465 | if [ -z "$(uname -a | grep i686)" ]; then |
| 466 | IS_I686="NO" |
| 467 | fi |
| 468 | fi |
| 469 | fi |
| 470 | if [ "$IS_I686" = "YES" ]; then |
| 471 | SKIP_NEXT="YES" |
| 472 | fi |
| 473 | } |
| 474 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 475 | # Calculate the input & output maximum content lengths set in the config |
Yuto Takano | ab9e4333 | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 476 | MAX_CONTENT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_MAX_CONTENT_LEN" ) |
| 477 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 478 | 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] | 479 | |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 480 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 481 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 482 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 483 | fi |
| 484 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 485 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 486 | fi |
| 487 | |
| 488 | # skip the next test if the SSL output buffer is less than 16KB |
| 489 | requires_full_size_output_buffer() { |
| 490 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 491 | SKIP_NEXT="YES" |
| 492 | fi |
| 493 | } |
| 494 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 495 | # skip the next test if valgrind is in use |
| 496 | not_with_valgrind() { |
| 497 | if [ "$MEMCHECK" -gt 0 ]; then |
| 498 | SKIP_NEXT="YES" |
| 499 | fi |
| 500 | } |
| 501 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 502 | # skip the next test if valgrind is NOT in use |
| 503 | only_with_valgrind() { |
| 504 | if [ "$MEMCHECK" -eq 0 ]; then |
| 505 | SKIP_NEXT="YES" |
| 506 | fi |
| 507 | } |
| 508 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 509 | # 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] | 510 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 511 | CLI_DELAY_FACTOR=$1 |
| 512 | } |
| 513 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 514 | # wait for the given seconds after the client finished in the next test |
| 515 | server_needs_more_time() { |
| 516 | SRV_DELAY_SECONDS=$1 |
| 517 | } |
| 518 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 519 | # print_name <name> |
| 520 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 521 | TESTS=$(( $TESTS + 1 )) |
| 522 | LINE="" |
| 523 | |
| 524 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 525 | LINE="$TESTS " |
| 526 | fi |
| 527 | |
| 528 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 529 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 530 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 531 | for i in `seq 1 $LEN`; do printf '.'; done |
| 532 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 533 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 534 | } |
| 535 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 536 | # record_outcome <outcome> [<failure-reason>] |
| 537 | # The test name must be in $NAME. |
| 538 | record_outcome() { |
| 539 | echo "$1" |
| 540 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 541 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 542 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 543 | "ssl-opt" "$NAME" \ |
| 544 | "$1" "${2-}" \ |
| 545 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 546 | fi |
| 547 | } |
| 548 | |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 549 | # True if the presence of the given pattern in a log definitely indicates |
| 550 | # that the test has failed. False if the presence is inconclusive. |
| 551 | # |
| 552 | # Inputs: |
| 553 | # * $1: pattern found in the logs |
| 554 | # * $TIMES_LEFT: >0 if retrying is an option |
| 555 | # |
| 556 | # Outputs: |
| 557 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 558 | # unchanged otherwise. |
| 559 | # * Return value: 1 if the pattern is inconclusive, |
| 560 | # 0 if the failure is definitive. |
| 561 | log_pattern_presence_is_conclusive() { |
| 562 | # If we've run out of attempts, then don't retry no matter what. |
| 563 | if [ $TIMES_LEFT -eq 0 ]; then |
| 564 | return 0 |
| 565 | fi |
| 566 | case $1 in |
| 567 | "resend") |
| 568 | # An undesired resend may have been caused by the OS dropping or |
| 569 | # delaying a packet at an inopportune time. |
| 570 | outcome="RETRY(resend)" |
| 571 | return 1;; |
| 572 | esac |
| 573 | } |
| 574 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 575 | # fail <message> |
| 576 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 577 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 578 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 579 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 580 | mv $SRV_OUT o-srv-${TESTS}.log |
| 581 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 582 | if [ -n "$PXY_CMD" ]; then |
| 583 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 584 | fi |
| 585 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 586 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 587 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 588 | echo " ! server output:" |
| 589 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 590 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 591 | echo " ! client output:" |
| 592 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 593 | if [ -n "$PXY_CMD" ]; then |
| 594 | echo " ! ========================================================" |
| 595 | echo " ! proxy output:" |
| 596 | cat o-pxy-${TESTS}.log |
| 597 | fi |
| 598 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 599 | fi |
| 600 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 601 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 602 | } |
| 603 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 604 | # is_polar <cmd_line> |
| 605 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 606 | case "$1" in |
| 607 | *ssl_client2*) true;; |
| 608 | *ssl_server2*) true;; |
| 609 | *) false;; |
| 610 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 611 | } |
| 612 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 613 | # openssl s_server doesn't have -www with DTLS |
| 614 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 615 | case "$SRV_CMD" in |
| 616 | *s_server*-dtls*) |
| 617 | NEEDS_INPUT=1 |
| 618 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 619 | *) NEEDS_INPUT=0;; |
| 620 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 621 | } |
| 622 | |
| 623 | # provide input to commands that need it |
| 624 | provide_input() { |
| 625 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 626 | return |
| 627 | fi |
| 628 | |
| 629 | while true; do |
| 630 | echo "HTTP/1.0 200 OK" |
| 631 | sleep 1 |
| 632 | done |
| 633 | } |
| 634 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 635 | # has_mem_err <log_file_name> |
| 636 | has_mem_err() { |
| 637 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 638 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 639 | then |
| 640 | return 1 # false: does not have errors |
| 641 | else |
| 642 | return 0 # true: has errors |
| 643 | fi |
| 644 | } |
| 645 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 646 | # 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] | 647 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 648 | wait_app_start() { |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 649 | newline=' |
| 650 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 651 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 652 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 653 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 654 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 655 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 656 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 657 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 6cd97ce | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 658 | while true; do |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 659 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 660 | # When we use a proxy, it will be listening on the same port we |
| 661 | # are checking for as well as the server and lsof will list both. |
| 662 | # If multiple PIDs are returned, each one will be on a separate |
| 663 | # line, each prepended with 'p'. |
| 664 | case ${newline}${SERVER_PIDS}${newline} in |
| 665 | *${newline}p${2}${newline}*) break;; |
| 666 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 667 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 668 | echo "$3 START TIMEOUT" |
| 669 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 670 | break |
| 671 | fi |
| 672 | # Linux and *BSD support decimal arguments to sleep. On other |
| 673 | # OSes this may be a tight loop. |
| 674 | sleep 0.1 2>/dev/null || true |
| 675 | done |
| 676 | } |
| 677 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 678 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 679 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 680 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 681 | } |
| 682 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 683 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 684 | # Wait for server process $2 to be listening on port $1. |
| 685 | wait_server_start() { |
| 686 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 687 | } |
| 688 | |
| 689 | # Wait for proxy process $2 to be listening on port $1. |
| 690 | wait_proxy_start() { |
| 691 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 692 | } |
| 693 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 694 | # 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] | 695 | # 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] | 696 | # acceptable bounds |
| 697 | check_server_hello_time() { |
| 698 | # 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] | 699 | 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] | 700 | # Get the Unix timestamp for now |
| 701 | CUR_TIME=$(date +'%s') |
| 702 | THRESHOLD_IN_SECS=300 |
| 703 | |
| 704 | # Check if the ServerHello time was printed |
| 705 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 706 | return 1 |
| 707 | fi |
| 708 | |
| 709 | # Check the time in ServerHello is within acceptable bounds |
| 710 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 711 | # The time in ServerHello is at least 5 minutes before now |
| 712 | return 1 |
| 713 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 714 | # 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] | 715 | return 1 |
| 716 | else |
| 717 | return 0 |
| 718 | fi |
| 719 | } |
| 720 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 721 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 722 | handshake_memory_get() { |
| 723 | OUTPUT_VARIABLE="$1" |
| 724 | OUTPUT_FILE="$2" |
| 725 | |
| 726 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 727 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 728 | |
| 729 | # Check if memory usage was read |
| 730 | if [ -z "$MEM_USAGE" ]; then |
| 731 | echo "Error: Can not read the value of handshake memory usage" |
| 732 | return 1 |
| 733 | else |
| 734 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 735 | return 0 |
| 736 | fi |
| 737 | } |
| 738 | |
| 739 | # Get handshake memory usage from server or client output and check if this value |
| 740 | # is not higher than the maximum given by the first argument |
| 741 | handshake_memory_check() { |
| 742 | MAX_MEMORY="$1" |
| 743 | OUTPUT_FILE="$2" |
| 744 | |
| 745 | # Get memory usage |
| 746 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 747 | return 1 |
| 748 | fi |
| 749 | |
| 750 | # Check if memory usage is below max value |
| 751 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 752 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 753 | "but should be below $MAX_MEMORY bytes" |
| 754 | return 1 |
| 755 | else |
| 756 | return 0 |
| 757 | fi |
| 758 | } |
| 759 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 760 | # wait for client to terminate and set CLI_EXIT |
| 761 | # must be called right after starting the client |
| 762 | wait_client_done() { |
| 763 | CLI_PID=$! |
| 764 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 765 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 766 | CLI_DELAY_FACTOR=1 |
| 767 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 768 | ( 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] | 769 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 770 | |
| 771 | wait $CLI_PID |
| 772 | CLI_EXIT=$? |
| 773 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 774 | kill $DOG_PID >/dev/null 2>&1 |
| 775 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 776 | |
| 777 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 778 | |
| 779 | sleep $SRV_DELAY_SECONDS |
| 780 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 781 | } |
| 782 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 783 | # check if the given command uses dtls and sets global variable DTLS |
| 784 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 785 | case "$1" in |
Paul Elliott | 405fccc | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 786 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 787 | *) DTLS=0;; |
| 788 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 789 | } |
| 790 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 791 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 792 | is_gnutls() { |
| 793 | case "$1" in |
| 794 | *gnutls-cli*) |
| 795 | CMD_IS_GNUTLS=1 |
| 796 | ;; |
| 797 | *gnutls-serv*) |
| 798 | CMD_IS_GNUTLS=1 |
| 799 | ;; |
| 800 | *) |
| 801 | CMD_IS_GNUTLS=0 |
| 802 | ;; |
| 803 | esac |
| 804 | } |
| 805 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 806 | # Compare file content |
| 807 | # Usage: find_in_both pattern file1 file2 |
| 808 | # extract from file1 the first line matching the pattern |
| 809 | # check in file2 that the same line can be found |
| 810 | find_in_both() { |
| 811 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 812 | if [ -z "$srv_pattern" ]; then |
| 813 | return 1; |
| 814 | fi |
| 815 | |
| 816 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 817 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 818 | else |
| 819 | return 1; |
| 820 | fi |
| 821 | } |
| 822 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 823 | # Analyze the commands that will be used in a test. |
| 824 | # |
| 825 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 826 | # extra arguments or go through wrappers. |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 827 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 828 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 829 | # 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] | 830 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 831 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 832 | case " $SRV_CMD " in |
| 833 | *' server_addr=::1 '*) |
| 834 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 835 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 836 | fi |
| 837 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 838 | # update CMD_IS_GNUTLS variable |
| 839 | is_gnutls "$SRV_CMD" |
| 840 | |
| 841 | # if the server uses gnutls but doesn't set priority, explicitly |
| 842 | # set the default priority |
| 843 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 844 | case "$SRV_CMD" in |
| 845 | *--priority*) :;; |
| 846 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 847 | esac |
| 848 | fi |
| 849 | |
| 850 | # update CMD_IS_GNUTLS variable |
| 851 | is_gnutls "$CLI_CMD" |
| 852 | |
| 853 | # if the client uses gnutls but doesn't set priority, explicitly |
| 854 | # set the default priority |
| 855 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 856 | case "$CLI_CMD" in |
| 857 | *--priority*) :;; |
| 858 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 859 | esac |
| 860 | fi |
| 861 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 862 | # fix client port |
| 863 | if [ -n "$PXY_CMD" ]; then |
| 864 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 865 | else |
| 866 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 867 | fi |
| 868 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 869 | # prepend valgrind to our commands if active |
| 870 | if [ "$MEMCHECK" -gt 0 ]; then |
| 871 | if is_polar "$SRV_CMD"; then |
| 872 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 873 | fi |
| 874 | if is_polar "$CLI_CMD"; then |
| 875 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 876 | fi |
| 877 | fi |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 878 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 879 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 880 | # Check for failure conditions after a test case. |
| 881 | # |
| 882 | # Inputs from run_test: |
| 883 | # * positional parameters: test options (see run_test documentation) |
| 884 | # * $CLI_EXIT: client return code |
| 885 | # * $CLI_EXPECT: expected client return code |
| 886 | # * $SRV_RET: server return code |
| 887 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 888 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 889 | # |
| 890 | # Outputs: |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 891 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 892 | check_test_failure() { |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 893 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 894 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 895 | if [ $TIMES_LEFT -gt 0 ] && |
| 896 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 897 | then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 898 | outcome="RETRY(client-timeout)" |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 899 | return |
| 900 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 901 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 902 | # 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] | 903 | # (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] | 904 | # expected client exit to incorrectly succeed in case of catastrophic |
| 905 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 906 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 907 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 908 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 909 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 910 | return |
| 911 | fi |
| 912 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 913 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 914 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 915 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 916 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 917 | return |
| 918 | fi |
| 919 | fi |
| 920 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 921 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 922 | # exit with status 0 when interrupted by a signal, and we don't really |
| 923 | # care anyway), in case e.g. the server reports a memory leak. |
| 924 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 925 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 926 | return |
| 927 | fi |
| 928 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 929 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 930 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 931 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 932 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 933 | 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] | 934 | return |
| 935 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 936 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 937 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 938 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 939 | # 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] | 940 | while [ $# -gt 0 ] |
| 941 | do |
| 942 | case $1 in |
| 943 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 944 | 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] | 945 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 946 | return |
| 947 | fi |
| 948 | ;; |
| 949 | |
| 950 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 951 | 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] | 952 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 953 | return |
| 954 | fi |
| 955 | ;; |
| 956 | |
| 957 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 958 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 959 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 960 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 961 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 962 | return |
| 963 | fi |
| 964 | ;; |
| 965 | |
| 966 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 967 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 968 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 969 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 970 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 971 | return |
| 972 | fi |
| 973 | ;; |
| 974 | |
| 975 | # The filtering in the following two options (-u and -U) do the following |
| 976 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 977 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 978 | # - keep one of each non-unique line |
| 979 | # - count how many lines remain |
| 980 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 981 | # if there were no duplicates. |
| 982 | "-U") |
| 983 | 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 |
| 984 | fail "lines following pattern '$2' must be unique in Server output" |
| 985 | return |
| 986 | fi |
| 987 | ;; |
| 988 | |
| 989 | "-u") |
| 990 | 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 |
| 991 | 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] | 992 | return |
| 993 | fi |
| 994 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 995 | "-F") |
| 996 | if ! $2 "$SRV_OUT"; then |
| 997 | fail "function call to '$2' failed on Server output" |
| 998 | return |
| 999 | fi |
| 1000 | ;; |
| 1001 | "-f") |
| 1002 | if ! $2 "$CLI_OUT"; then |
| 1003 | fail "function call to '$2' failed on Client output" |
| 1004 | return |
| 1005 | fi |
| 1006 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1007 | "-g") |
| 1008 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1009 | fail "function call to '$2' failed on Server and Client output" |
| 1010 | return |
| 1011 | fi |
| 1012 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1013 | |
| 1014 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1015 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1016 | exit 1 |
| 1017 | esac |
| 1018 | shift 2 |
| 1019 | done |
| 1020 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1021 | # check valgrind's results |
| 1022 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1023 | 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] | 1024 | fail "Server has memory errors" |
| 1025 | return |
| 1026 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1027 | 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] | 1028 | fail "Client has memory errors" |
| 1029 | return |
| 1030 | fi |
| 1031 | fi |
| 1032 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1033 | # if we're here, everything is ok |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1034 | outcome=PASS |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1035 | } |
| 1036 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1037 | # Run the current test case: start the server and if applicable the proxy, run |
| 1038 | # the client, wait for all processes to finish or time out. |
| 1039 | # |
| 1040 | # Inputs: |
| 1041 | # * $NAME: test case name |
| 1042 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1043 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1044 | # |
| 1045 | # Outputs: |
| 1046 | # * $CLI_EXIT: client return code |
| 1047 | # * $SRV_RET: server return code |
| 1048 | do_run_test_once() { |
| 1049 | # run the commands |
| 1050 | if [ -n "$PXY_CMD" ]; then |
| 1051 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1052 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1053 | PXY_PID=$! |
| 1054 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1055 | fi |
| 1056 | |
| 1057 | check_osrv_dtls |
| 1058 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1059 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1060 | SRV_PID=$! |
| 1061 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1062 | |
| 1063 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1064 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1065 | wait_client_done |
| 1066 | |
| 1067 | sleep 0.05 |
| 1068 | |
| 1069 | # terminate the server (and the proxy) |
| 1070 | kill $SRV_PID |
| 1071 | wait $SRV_PID |
| 1072 | SRV_RET=$? |
| 1073 | |
| 1074 | if [ -n "$PXY_CMD" ]; then |
| 1075 | kill $PXY_PID >/dev/null 2>&1 |
| 1076 | wait $PXY_PID |
| 1077 | fi |
| 1078 | } |
| 1079 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1080 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1081 | # Options: -s pattern pattern that must be present in server output |
| 1082 | # -c pattern pattern that must be present in client output |
| 1083 | # -u pattern lines after pattern must be unique in client output |
| 1084 | # -f call shell function on client output |
| 1085 | # -S pattern pattern that must be absent in server output |
| 1086 | # -C pattern pattern that must be absent in client output |
| 1087 | # -U pattern lines after pattern must be unique in server output |
| 1088 | # -F call shell function on server output |
| 1089 | # -g call shell function on server and client output |
| 1090 | run_test() { |
| 1091 | NAME="$1" |
| 1092 | shift 1 |
| 1093 | |
| 1094 | if is_excluded "$NAME"; then |
| 1095 | SKIP_NEXT="NO" |
| 1096 | # There was no request to run the test, so don't record its outcome. |
| 1097 | return |
| 1098 | fi |
| 1099 | |
| 1100 | print_name "$NAME" |
| 1101 | |
| 1102 | # Do we only run numbered tests? |
| 1103 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1104 | case ",$RUN_TEST_NUMBER," in |
| 1105 | *",$TESTS,"*) :;; |
| 1106 | *) SKIP_NEXT="YES";; |
| 1107 | esac |
| 1108 | fi |
| 1109 | |
| 1110 | # does this test use a proxy? |
| 1111 | if [ "X$1" = "X-p" ]; then |
| 1112 | PXY_CMD="$2" |
| 1113 | shift 2 |
| 1114 | else |
| 1115 | PXY_CMD="" |
| 1116 | fi |
| 1117 | |
| 1118 | # get commands and client output |
| 1119 | SRV_CMD="$1" |
| 1120 | CLI_CMD="$2" |
| 1121 | CLI_EXPECT="$3" |
| 1122 | shift 3 |
| 1123 | |
| 1124 | # Check if test uses files |
| 1125 | case "$SRV_CMD $CLI_CMD" in |
| 1126 | *data_files/*) |
| 1127 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1128 | esac |
| 1129 | |
Gilles Peskine | e5f4958 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1130 | # Check if the test uses DTLS. |
| 1131 | detect_dtls "$SRV_CMD" |
| 1132 | if [ "$DTLS" -eq 1 ]; then |
| 1133 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1134 | fi |
| 1135 | |
Gilles Peskine | 4502671 | 2022-02-25 19:47:04 +0100 | [diff] [blame] | 1136 | # Check more TLS protocol features. |
| 1137 | case "$SRV_CMD $CLI_CMD" in |
| 1138 | *[-_\ =]tickets=[^0]*) |
| 1139 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 1140 | esac |
| 1141 | case "$SRV_CMD $CLI_CMD" in |
| 1142 | *[-_\ =]alpn=*) |
| 1143 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 1144 | esac |
| 1145 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1146 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1147 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1148 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1149 | |
Gilles Peskine | 89d892f | 2022-02-25 19:52:52 +0100 | [diff] [blame^] | 1150 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1151 | maybe_adapt_for_psk "$@" |
| 1152 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1153 | # should we skip? |
| 1154 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1155 | SKIP_NEXT="NO" |
| 1156 | record_outcome "SKIP" |
| 1157 | SKIPS=$(( $SKIPS + 1 )) |
| 1158 | return |
| 1159 | fi |
| 1160 | |
| 1161 | analyze_test_commands "$@" |
| 1162 | |
Andrzej Kurek | 363553b | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1163 | # One regular run and two retries |
| 1164 | TIMES_LEFT=3 |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1165 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1166 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1167 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1168 | do_run_test_once |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1169 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1170 | check_test_failure "$@" |
| 1171 | case $outcome in |
| 1172 | PASS) break;; |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1173 | RETRY*) printf "$outcome ";; |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1174 | FAIL) return;; |
| 1175 | esac |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1176 | done |
| 1177 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1178 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1179 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1180 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1181 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1182 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1183 | if [ -n "$PXY_CMD" ]; then |
| 1184 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1185 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1186 | fi |
| 1187 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1188 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1189 | } |
| 1190 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1191 | run_test_psa() { |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1193 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1194 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1195 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1196 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1197 | 0 \ |
| 1198 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1199 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1200 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1201 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1202 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1203 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1204 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1205 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1206 | -C "Failed to setup PSA-based cipher context"\ |
| 1207 | -S "Failed to setup PSA-based cipher context"\ |
| 1208 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1209 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1210 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1211 | -S "error" \ |
| 1212 | -C "error" |
| 1213 | } |
| 1214 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1215 | run_test_psa_force_curve() { |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1217 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1218 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1219 | "$P_SRV debug_level=4 force_version=tls12" \ |
| 1220 | "$P_CLI debug_level=4 force_version=tls12 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1221 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1222 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1223 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1224 | -c "PSA calc verify" \ |
| 1225 | -c "calc PSA finished" \ |
| 1226 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1227 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1228 | -s "PSA calc verify" \ |
| 1229 | -s "calc PSA finished" \ |
| 1230 | -C "Failed to setup PSA-based cipher context"\ |
| 1231 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1232 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1233 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1234 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1235 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1236 | -C "error" |
| 1237 | } |
| 1238 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1239 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1240 | # a maximum fragment length. |
| 1241 | # first argument ($1) is MFL for SSL client |
| 1242 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1243 | run_test_memory_after_hanshake_with_mfl() |
| 1244 | { |
| 1245 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1246 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1247 | |
| 1248 | # Leave some margin for robustness |
| 1249 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1250 | |
| 1251 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1252 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1253 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1254 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1255 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1256 | 0 \ |
| 1257 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1258 | } |
| 1259 | |
| 1260 | |
| 1261 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1262 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1263 | run_tests_memory_after_hanshake() |
| 1264 | { |
| 1265 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1266 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1267 | |
| 1268 | # first test with default MFU is to get reference memory usage |
| 1269 | MEMORY_USAGE_MFL_16K=0 |
| 1270 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1271 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1272 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1273 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1274 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1275 | 0 \ |
| 1276 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1277 | |
| 1278 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1279 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1280 | |
| 1281 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1282 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1283 | |
| 1284 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1285 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1286 | |
| 1287 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1288 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1289 | } |
| 1290 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1291 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1292 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1293 | rm -f context_srv.txt |
| 1294 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1295 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1296 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1297 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1298 | 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] | 1299 | exit 1 |
| 1300 | } |
| 1301 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1302 | # |
| 1303 | # MAIN |
| 1304 | # |
| 1305 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1306 | get_options "$@" |
| 1307 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1308 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1309 | # patterns rather than regular expressions, use a case statement instead |
| 1310 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1311 | # detects simple cases: plain substring, everything, nothing. |
| 1312 | # |
| 1313 | # As an exception, the character '.' is treated as an ordinary character |
| 1314 | # if it is the only special character in the string. This is because it's |
| 1315 | # rare to need "any one character", but needing a literal '.' is common |
| 1316 | # (e.g. '-f "DTLS 1.2"'). |
| 1317 | need_grep= |
| 1318 | case "$FILTER" in |
| 1319 | '^$') simple_filter=;; |
| 1320 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1321 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1322 | need_grep=1;; |
| 1323 | *) # No regexp or shell-pattern special character |
| 1324 | simple_filter="*$FILTER*";; |
| 1325 | esac |
| 1326 | case "$EXCLUDE" in |
| 1327 | '^$') simple_exclude=;; |
| 1328 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1329 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1330 | need_grep=1;; |
| 1331 | *) # No regexp or shell-pattern special character |
| 1332 | simple_exclude="*$EXCLUDE*";; |
| 1333 | esac |
| 1334 | if [ -n "$need_grep" ]; then |
| 1335 | is_excluded () { |
| 1336 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1337 | } |
| 1338 | else |
| 1339 | is_excluded () { |
| 1340 | case "$1" in |
| 1341 | $simple_exclude) true;; |
| 1342 | $simple_filter) false;; |
| 1343 | *) true;; |
| 1344 | esac |
| 1345 | } |
| 1346 | fi |
| 1347 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1348 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1349 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1350 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1351 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1352 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1353 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1354 | exit 1 |
| 1355 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1356 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1357 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1358 | exit 1 |
| 1359 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1360 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1361 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1362 | exit 1 |
| 1363 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1364 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1365 | if which valgrind >/dev/null 2>&1; then :; else |
| 1366 | echo "Memcheck not possible. Valgrind not found" |
| 1367 | exit 1 |
| 1368 | fi |
| 1369 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1370 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1371 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1372 | exit 1 |
| 1373 | fi |
| 1374 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1375 | # used by watchdog |
| 1376 | MAIN_PID="$$" |
| 1377 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1378 | # We use somewhat arbitrary delays for tests: |
| 1379 | # - how long do we wait for the server to start (when lsof not available)? |
| 1380 | # - how long do we allow for the client to finish? |
| 1381 | # (not to check performance, just to avoid waiting indefinitely) |
| 1382 | # Things are slower with valgrind, so give extra time here. |
| 1383 | # |
| 1384 | # Note: without lsof, there is a trade-off between the running time of this |
| 1385 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1386 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1387 | # 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] | 1388 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1389 | START_DELAY=6 |
| 1390 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1391 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1392 | START_DELAY=2 |
| 1393 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1394 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1395 | |
| 1396 | # some particular tests need more time: |
| 1397 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1398 | # - for the server, we sleep for a number of seconds after the client exits |
| 1399 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1400 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1401 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1402 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1403 | # 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] | 1404 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1405 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1406 | # machines that will resolve to ::1, and we don't want ipv6 here. |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1407 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1408 | 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] | 1409 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" |
Gilles Peskine | 3aec89b | 2021-04-01 14:00:11 +0200 | [diff] [blame] | 1410 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1411 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1412 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1413 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1414 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1415 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1416 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1417 | O_LEGACY_CLI="$O_LEGACY_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1418 | fi |
| 1419 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 1420 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1421 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1422 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 1423 | fi |
| 1424 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1425 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1426 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1427 | fi |
| 1428 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1429 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1430 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1431 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1432 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1433 | # Allow SHA-1, because many of our test certificates use it |
| 1434 | P_SRV="$P_SRV allow_sha1=1" |
| 1435 | P_CLI="$P_CLI allow_sha1=1" |
| 1436 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1437 | # Also pick a unique name for intermediate files |
| 1438 | SRV_OUT="srv_out.$$" |
| 1439 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1440 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1441 | SESSION="session.$$" |
| 1442 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1443 | SKIP_NEXT="NO" |
| 1444 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1445 | trap cleanup INT TERM HUP |
| 1446 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1447 | # Basic test |
| 1448 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1449 | # Checks that: |
| 1450 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1451 | # - the expected (highest security) parameters are selected |
| 1452 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | dff48c1 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1454 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1455 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1456 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1457 | "$P_CLI" \ |
| 1458 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1459 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1460 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1461 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1462 | -s "ECDHE curve: secp521r1" \ |
| 1463 | -S "error" \ |
| 1464 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1465 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | dff48c1 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1467 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1468 | run_test "Default, DTLS" \ |
| 1469 | "$P_SRV dtls=1" \ |
| 1470 | "$P_CLI dtls=1" \ |
| 1471 | 0 \ |
| 1472 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1473 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1474 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1475 | run_test "TLS client auth: required" \ |
| 1476 | "$P_SRV auth_mode=required" \ |
| 1477 | "$P_CLI" \ |
| 1478 | 0 \ |
| 1479 | -s "Verifying peer X.509 certificate... ok" |
| 1480 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1481 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1482 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1483 | requires_config_enabled MBEDTLS_SHA256_C |
| 1484 | run_test "TLS: password protected client key" \ |
| 1485 | "$P_SRV auth_mode=required" \ |
| 1486 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1487 | 0 |
| 1488 | |
| 1489 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1490 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1491 | requires_config_enabled MBEDTLS_SHA256_C |
| 1492 | run_test "TLS: password protected server key" \ |
| 1493 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1494 | "$P_CLI" \ |
| 1495 | 0 |
| 1496 | |
| 1497 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1498 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1499 | requires_config_enabled MBEDTLS_RSA_C |
| 1500 | requires_config_enabled MBEDTLS_SHA256_C |
| 1501 | run_test "TLS: password protected server key, two certificates" \ |
| 1502 | "$P_SRV \ |
| 1503 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1504 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1505 | "$P_CLI" \ |
| 1506 | 0 |
| 1507 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1508 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1509 | run_test "Default (compression enabled)" \ |
| 1510 | "$P_SRV debug_level=3" \ |
| 1511 | "$P_CLI debug_level=3" \ |
| 1512 | 0 \ |
| 1513 | -s "Allocating compression buffer" \ |
| 1514 | -c "Allocating compression buffer" \ |
| 1515 | -s "Record expansion is unknown (compression)" \ |
| 1516 | -c "Record expansion is unknown (compression)" \ |
| 1517 | -S "error" \ |
| 1518 | -C "error" |
| 1519 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1520 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1521 | run_test "CA callback on client" \ |
| 1522 | "$P_SRV debug_level=3" \ |
| 1523 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1524 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1525 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1526 | -S "error" \ |
| 1527 | -C "error" |
| 1528 | |
| 1529 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1530 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1531 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1532 | requires_config_enabled MBEDTLS_SHA256_C |
| 1533 | run_test "CA callback on server" \ |
| 1534 | "$P_SRV auth_mode=required" \ |
| 1535 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1536 | key_file=data_files/server5.key" \ |
| 1537 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1538 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1539 | -s "Verifying peer X.509 certificate... ok" \ |
| 1540 | -S "error" \ |
| 1541 | -C "error" |
| 1542 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1543 | # Test using an opaque private key for client authentication |
| 1544 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1545 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1546 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1547 | requires_config_enabled MBEDTLS_SHA256_C |
| 1548 | run_test "Opaque key for client authentication" \ |
| 1549 | "$P_SRV auth_mode=required" \ |
| 1550 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1551 | key_file=data_files/server5.key" \ |
| 1552 | 0 \ |
| 1553 | -c "key type: Opaque" \ |
| 1554 | -s "Verifying peer X.509 certificate... ok" \ |
| 1555 | -S "error" \ |
| 1556 | -C "error" |
| 1557 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1558 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1559 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1560 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1561 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1562 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1563 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1564 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1565 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1566 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1567 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1568 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1569 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1570 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1571 | run_test_psa_force_curve "secp521r1" |
| 1572 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1573 | run_test_psa_force_curve "brainpoolP512r1" |
| 1574 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1575 | run_test_psa_force_curve "secp384r1" |
| 1576 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1577 | run_test_psa_force_curve "brainpoolP384r1" |
| 1578 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1579 | run_test_psa_force_curve "secp256r1" |
| 1580 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1581 | run_test_psa_force_curve "secp256k1" |
| 1582 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1583 | run_test_psa_force_curve "brainpoolP256r1" |
| 1584 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1585 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1586 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 52af769 | 2022-03-31 14:27:24 +0100 | [diff] [blame] | 1587 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1588 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1589 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1590 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1591 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1592 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1593 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1594 | run_test_psa_force_curve "secp192r1" |
| 1595 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1596 | run_test_psa_force_curve "secp192k1" |
| 1597 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1598 | # Test current time in ServerHello |
| 1599 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1600 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1601 | "$P_SRV debug_level=3" \ |
| 1602 | "$P_CLI debug_level=3" \ |
| 1603 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1604 | -f "check_server_hello_time" \ |
| 1605 | -F "check_server_hello_time" |
| 1606 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1607 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1608 | run_test "Unique IV in GCM" \ |
| 1609 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1610 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1611 | 0 \ |
| 1612 | -u "IV used" \ |
| 1613 | -U "IV used" |
| 1614 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1615 | # Tests for certificate verification callback |
| 1616 | run_test "Configuration-specific CRT verification callback" \ |
| 1617 | "$P_SRV debug_level=3" \ |
| 1618 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1619 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1620 | -S "error" \ |
| 1621 | -c "Verify requested for " \ |
| 1622 | -c "Use configuration-specific verification callback" \ |
| 1623 | -C "Use context-specific verification callback" \ |
| 1624 | -C "error" |
| 1625 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1626 | run_test "Context-specific CRT verification callback" \ |
| 1627 | "$P_SRV debug_level=3" \ |
| 1628 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1629 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1630 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1631 | -c "Verify requested for " \ |
| 1632 | -c "Use context-specific verification callback" \ |
| 1633 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1634 | -C "error" |
| 1635 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1636 | # Tests for rc4 option |
| 1637 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1638 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1639 | run_test "RC4: server disabled, client enabled" \ |
| 1640 | "$P_SRV" \ |
| 1641 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1642 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1643 | -s "SSL - The server has no ciphersuites in common" |
| 1644 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1645 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1646 | run_test "RC4: server half, client enabled" \ |
| 1647 | "$P_SRV arc4=1" \ |
| 1648 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1649 | 1 \ |
| 1650 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1651 | |
| 1652 | run_test "RC4: server enabled, client disabled" \ |
| 1653 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1654 | "$P_CLI" \ |
| 1655 | 1 \ |
| 1656 | -s "SSL - The server has no ciphersuites in common" |
| 1657 | |
| 1658 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1659 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1660 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1661 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1662 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1663 | -S "SSL - The server has no ciphersuites in common" |
| 1664 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1665 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1666 | |
| 1667 | requires_gnutls |
| 1668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1669 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1670 | "$G_SRV"\ |
| 1671 | "$P_CLI force_version=tls1_1" \ |
| 1672 | 0 |
| 1673 | |
| 1674 | requires_gnutls |
| 1675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1676 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1677 | "$G_SRV"\ |
| 1678 | "$P_CLI force_version=tls1" \ |
| 1679 | 0 |
| 1680 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1681 | # Tests for SHA-1 support |
| 1682 | |
| 1683 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1684 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1685 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1686 | 1 \ |
| 1687 | -c "The certificate is signed with an unacceptable hash" |
| 1688 | |
| 1689 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1690 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1691 | "$P_CLI allow_sha1=1" \ |
| 1692 | 0 |
| 1693 | |
| 1694 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1695 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1696 | "$P_CLI allow_sha1=0" \ |
| 1697 | 0 |
| 1698 | |
| 1699 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1700 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1701 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1702 | 1 \ |
| 1703 | -s "The certificate is signed with an unacceptable hash" |
| 1704 | |
| 1705 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1706 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1707 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1708 | 0 |
| 1709 | |
| 1710 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1711 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1712 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1713 | 0 |
| 1714 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1715 | # Tests for datagram packing |
| 1716 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1717 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1718 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1719 | 0 \ |
| 1720 | -c "next record in same datagram" \ |
| 1721 | -s "next record in same datagram" |
| 1722 | |
| 1723 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1724 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1725 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1726 | 0 \ |
| 1727 | -s "next record in same datagram" \ |
| 1728 | -C "next record in same datagram" |
| 1729 | |
| 1730 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1731 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1732 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1733 | 0 \ |
| 1734 | -S "next record in same datagram" \ |
| 1735 | -c "next record in same datagram" |
| 1736 | |
| 1737 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1738 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1739 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1740 | 0 \ |
| 1741 | -S "next record in same datagram" \ |
| 1742 | -C "next record in same datagram" |
| 1743 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1744 | # Tests for Truncated HMAC extension |
| 1745 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1746 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1747 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1748 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1749 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1750 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1751 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1752 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1753 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1754 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1755 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1756 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1757 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1758 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1759 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1760 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1761 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1762 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1763 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1764 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1765 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1766 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1767 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1768 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1769 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1770 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1771 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1772 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1773 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1774 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1775 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1776 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1777 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1778 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1779 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1780 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1781 | 0 \ |
| 1782 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1783 | -S "dumping 'expected mac' (10 bytes)" |
| 1784 | |
| 1785 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1786 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1787 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1788 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1789 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1790 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1791 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1792 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1793 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1794 | "$P_SRV dtls=1 debug_level=4" \ |
| 1795 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1796 | 0 \ |
| 1797 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1798 | -S "dumping 'expected mac' (10 bytes)" |
| 1799 | |
| 1800 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1801 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1802 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1803 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1804 | 0 \ |
| 1805 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1806 | -S "dumping 'expected mac' (10 bytes)" |
| 1807 | |
| 1808 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1809 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1810 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1811 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1812 | 0 \ |
| 1813 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1814 | -S "dumping 'expected mac' (10 bytes)" |
| 1815 | |
| 1816 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1817 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1818 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1819 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1820 | 0 \ |
| 1821 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1822 | -S "dumping 'expected mac' (10 bytes)" |
| 1823 | |
| 1824 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1825 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1826 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1827 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1828 | 0 \ |
| 1829 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1830 | -S "dumping 'expected mac' (10 bytes)" |
| 1831 | |
| 1832 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1833 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1834 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1835 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1836 | 0 \ |
| 1837 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1838 | -s "dumping 'expected mac' (10 bytes)" |
| 1839 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1840 | # Tests for Context serialization |
| 1841 | |
| 1842 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1843 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1844 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1845 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1846 | 0 \ |
| 1847 | -c "Deserializing connection..." \ |
| 1848 | -S "Deserializing connection..." |
| 1849 | |
| 1850 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1851 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1852 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1853 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1854 | 0 \ |
| 1855 | -c "Deserializing connection..." \ |
| 1856 | -S "Deserializing connection..." |
| 1857 | |
| 1858 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1859 | run_test "Context serialization, client serializes, GCM" \ |
| 1860 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1861 | "$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] | 1862 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1863 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1864 | -S "Deserializing connection..." |
| 1865 | |
| 1866 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1867 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1868 | run_test "Context serialization, client serializes, with CID" \ |
| 1869 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1870 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1871 | 0 \ |
| 1872 | -c "Deserializing connection..." \ |
| 1873 | -S "Deserializing connection..." |
| 1874 | |
| 1875 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1876 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1877 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1878 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1879 | 0 \ |
| 1880 | -C "Deserializing connection..." \ |
| 1881 | -s "Deserializing connection..." |
| 1882 | |
| 1883 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1884 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1885 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1886 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1887 | 0 \ |
| 1888 | -C "Deserializing connection..." \ |
| 1889 | -s "Deserializing connection..." |
| 1890 | |
| 1891 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1892 | run_test "Context serialization, server serializes, GCM" \ |
| 1893 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1894 | "$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] | 1895 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1896 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1897 | -s "Deserializing connection..." |
| 1898 | |
| 1899 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1900 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1901 | run_test "Context serialization, server serializes, with CID" \ |
| 1902 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1903 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1904 | 0 \ |
| 1905 | -C "Deserializing connection..." \ |
| 1906 | -s "Deserializing connection..." |
| 1907 | |
| 1908 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1909 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1910 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1911 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1912 | 0 \ |
| 1913 | -c "Deserializing connection..." \ |
| 1914 | -s "Deserializing connection..." |
| 1915 | |
| 1916 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1917 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1918 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1919 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1920 | 0 \ |
| 1921 | -c "Deserializing connection..." \ |
| 1922 | -s "Deserializing connection..." |
| 1923 | |
| 1924 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1925 | run_test "Context serialization, both serialize, GCM" \ |
| 1926 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1927 | "$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] | 1928 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1929 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1930 | -s "Deserializing connection..." |
| 1931 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1932 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1933 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1934 | run_test "Context serialization, both serialize, with CID" \ |
| 1935 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1936 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1937 | 0 \ |
| 1938 | -c "Deserializing connection..." \ |
| 1939 | -s "Deserializing connection..." |
| 1940 | |
| 1941 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1942 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1943 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1944 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1945 | 0 \ |
| 1946 | -c "Deserializing connection..." \ |
| 1947 | -S "Deserializing connection..." |
| 1948 | |
| 1949 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1950 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1951 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1952 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1953 | 0 \ |
| 1954 | -c "Deserializing connection..." \ |
| 1955 | -S "Deserializing connection..." |
| 1956 | |
| 1957 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1958 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1959 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1960 | "$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] | 1961 | 0 \ |
| 1962 | -c "Deserializing connection..." \ |
| 1963 | -S "Deserializing connection..." |
| 1964 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1965 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1966 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1967 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1968 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1969 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1970 | 0 \ |
| 1971 | -c "Deserializing connection..." \ |
| 1972 | -S "Deserializing connection..." |
| 1973 | |
| 1974 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1975 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1976 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1977 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1978 | 0 \ |
| 1979 | -C "Deserializing connection..." \ |
| 1980 | -s "Deserializing connection..." |
| 1981 | |
| 1982 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1983 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1984 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1985 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1986 | 0 \ |
| 1987 | -C "Deserializing connection..." \ |
| 1988 | -s "Deserializing connection..." |
| 1989 | |
| 1990 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1991 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1992 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1993 | "$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] | 1994 | 0 \ |
| 1995 | -C "Deserializing connection..." \ |
| 1996 | -s "Deserializing connection..." |
| 1997 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1998 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1999 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2000 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2001 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2002 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2003 | 0 \ |
| 2004 | -C "Deserializing connection..." \ |
| 2005 | -s "Deserializing connection..." |
| 2006 | |
| 2007 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2008 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2009 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2010 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2011 | 0 \ |
| 2012 | -c "Deserializing connection..." \ |
| 2013 | -s "Deserializing connection..." |
| 2014 | |
| 2015 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2016 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2017 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2018 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2019 | 0 \ |
| 2020 | -c "Deserializing connection..." \ |
| 2021 | -s "Deserializing connection..." |
| 2022 | |
| 2023 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2024 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2025 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2026 | "$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] | 2027 | 0 \ |
| 2028 | -c "Deserializing connection..." \ |
| 2029 | -s "Deserializing connection..." |
| 2030 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2031 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2032 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2033 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2034 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2035 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2036 | 0 \ |
| 2037 | -c "Deserializing connection..." \ |
| 2038 | -s "Deserializing connection..." |
| 2039 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2040 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2041 | run_test "Saving the serialized context to a file" \ |
| 2042 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2043 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2044 | 0 \ |
| 2045 | -s "Save serialized context to a file... ok" \ |
| 2046 | -c "Save serialized context to a file... ok" |
| 2047 | rm -f context_srv.txt |
| 2048 | rm -f context_cli.txt |
| 2049 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2050 | # Tests for DTLS Connection ID extension |
| 2051 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2052 | # So far, the CID API isn't implemented, so we can't |
| 2053 | # grep for output witnessing its use. This needs to be |
| 2054 | # changed once the CID extension is implemented. |
| 2055 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2056 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2057 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2058 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2059 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2060 | 0 \ |
| 2061 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2062 | -s "found CID extension" \ |
| 2063 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2064 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2065 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2066 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2067 | -C "found CID extension" \ |
| 2068 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2069 | -C "Copy CIDs into SSL transform" \ |
| 2070 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2071 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2072 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2073 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2074 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2075 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2076 | 0 \ |
| 2077 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2078 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2079 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2080 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2081 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2082 | -C "found CID extension" \ |
| 2083 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2084 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2085 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2086 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2087 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2088 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2089 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2090 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2091 | 0 \ |
| 2092 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2093 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2094 | -c "client hello, adding CID extension" \ |
| 2095 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2096 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2097 | -s "server hello, adding CID extension" \ |
| 2098 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2099 | -c "Use of CID extension negotiated" \ |
| 2100 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2101 | -c "Copy CIDs into SSL transform" \ |
| 2102 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2103 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2104 | -s "Use of Connection ID has been negotiated" \ |
| 2105 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2106 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2107 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2108 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2109 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2110 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2111 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2112 | 0 \ |
| 2113 | -c "Enable use of CID extension." \ |
| 2114 | -s "Enable use of CID extension." \ |
| 2115 | -c "client hello, adding CID extension" \ |
| 2116 | -s "found CID extension" \ |
| 2117 | -s "Use of CID extension negotiated" \ |
| 2118 | -s "server hello, adding CID extension" \ |
| 2119 | -c "found CID extension" \ |
| 2120 | -c "Use of CID extension negotiated" \ |
| 2121 | -s "Copy CIDs into SSL transform" \ |
| 2122 | -c "Copy CIDs into SSL transform" \ |
| 2123 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2124 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2125 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2126 | -c "Use of Connection ID has been negotiated" \ |
| 2127 | -c "ignoring unexpected CID" \ |
| 2128 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2129 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2130 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2131 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2132 | -p "$P_PXY mtu=800" \ |
| 2133 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2134 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2135 | 0 \ |
| 2136 | -c "Enable use of CID extension." \ |
| 2137 | -s "Enable use of CID extension." \ |
| 2138 | -c "client hello, adding CID extension" \ |
| 2139 | -s "found CID extension" \ |
| 2140 | -s "Use of CID extension negotiated" \ |
| 2141 | -s "server hello, adding CID extension" \ |
| 2142 | -c "found CID extension" \ |
| 2143 | -c "Use of CID extension negotiated" \ |
| 2144 | -s "Copy CIDs into SSL transform" \ |
| 2145 | -c "Copy CIDs into SSL transform" \ |
| 2146 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2147 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2148 | -s "Use of Connection ID has been negotiated" \ |
| 2149 | -c "Use of Connection ID has been negotiated" |
| 2150 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2151 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2152 | 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] | 2153 | -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] | 2154 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2155 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2156 | 0 \ |
| 2157 | -c "Enable use of CID extension." \ |
| 2158 | -s "Enable use of CID extension." \ |
| 2159 | -c "client hello, adding CID extension" \ |
| 2160 | -s "found CID extension" \ |
| 2161 | -s "Use of CID extension negotiated" \ |
| 2162 | -s "server hello, adding CID extension" \ |
| 2163 | -c "found CID extension" \ |
| 2164 | -c "Use of CID extension negotiated" \ |
| 2165 | -s "Copy CIDs into SSL transform" \ |
| 2166 | -c "Copy CIDs into SSL transform" \ |
| 2167 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2168 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2169 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2170 | -c "Use of Connection ID has been negotiated" \ |
| 2171 | -c "ignoring unexpected CID" \ |
| 2172 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2173 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2174 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2175 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2176 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2177 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2178 | 0 \ |
| 2179 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2180 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2181 | -c "client hello, adding CID extension" \ |
| 2182 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2183 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2184 | -s "server hello, adding CID extension" \ |
| 2185 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2186 | -c "Use of CID extension negotiated" \ |
| 2187 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2188 | -c "Copy CIDs into SSL transform" \ |
| 2189 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2190 | -s "Peer CID (length 0 Bytes):" \ |
| 2191 | -s "Use of Connection ID has been negotiated" \ |
| 2192 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2193 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2194 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2195 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2196 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2197 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2198 | 0 \ |
| 2199 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2200 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2201 | -c "client hello, adding CID extension" \ |
| 2202 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2203 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2204 | -s "server hello, adding CID extension" \ |
| 2205 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2206 | -c "Use of CID extension negotiated" \ |
| 2207 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2208 | -c "Copy CIDs into SSL transform" \ |
| 2209 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2210 | -c "Peer CID (length 0 Bytes):" \ |
| 2211 | -s "Use of Connection ID has been negotiated" \ |
| 2212 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2213 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2215 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2216 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2217 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2218 | 0 \ |
| 2219 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2220 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2221 | -c "client hello, adding CID extension" \ |
| 2222 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2223 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2224 | -s "server hello, adding CID extension" \ |
| 2225 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2226 | -c "Use of CID extension negotiated" \ |
| 2227 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2228 | -c "Copy CIDs into SSL transform" \ |
| 2229 | -S "Use of Connection ID has been negotiated" \ |
| 2230 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2231 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2232 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2233 | 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] | 2234 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2235 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2236 | 0 \ |
| 2237 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2238 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2239 | -c "client hello, adding CID extension" \ |
| 2240 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2241 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2242 | -s "server hello, adding CID extension" \ |
| 2243 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2244 | -c "Use of CID extension negotiated" \ |
| 2245 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2246 | -c "Copy CIDs into SSL transform" \ |
| 2247 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2248 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2249 | -s "Use of Connection ID has been negotiated" \ |
| 2250 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2251 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2252 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2253 | 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] | 2254 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2255 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2256 | 0 \ |
| 2257 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2258 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2259 | -c "client hello, adding CID extension" \ |
| 2260 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2261 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2262 | -s "server hello, adding CID extension" \ |
| 2263 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2264 | -c "Use of CID extension negotiated" \ |
| 2265 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2266 | -c "Copy CIDs into SSL transform" \ |
| 2267 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2268 | -s "Peer CID (length 0 Bytes):" \ |
| 2269 | -s "Use of Connection ID has been negotiated" \ |
| 2270 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2271 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2272 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2273 | 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] | 2274 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2275 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2276 | 0 \ |
| 2277 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2278 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2279 | -c "client hello, adding CID extension" \ |
| 2280 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2281 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2282 | -s "server hello, adding CID extension" \ |
| 2283 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2284 | -c "Use of CID extension negotiated" \ |
| 2285 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2286 | -c "Copy CIDs into SSL transform" \ |
| 2287 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2288 | -c "Peer CID (length 0 Bytes):" \ |
| 2289 | -s "Use of Connection ID has been negotiated" \ |
| 2290 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2291 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2292 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2293 | 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] | 2294 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2295 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2296 | 0 \ |
| 2297 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2298 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2299 | -c "client hello, adding CID extension" \ |
| 2300 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2301 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2302 | -s "server hello, adding CID extension" \ |
| 2303 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2304 | -c "Use of CID extension negotiated" \ |
| 2305 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2306 | -c "Copy CIDs into SSL transform" \ |
| 2307 | -S "Use of Connection ID has been negotiated" \ |
| 2308 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2309 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2310 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2311 | 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] | 2312 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2313 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2314 | 0 \ |
| 2315 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2316 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2317 | -c "client hello, adding CID extension" \ |
| 2318 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2319 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2320 | -s "server hello, adding CID extension" \ |
| 2321 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2322 | -c "Use of CID extension negotiated" \ |
| 2323 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2324 | -c "Copy CIDs into SSL transform" \ |
| 2325 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2326 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2327 | -s "Use of Connection ID has been negotiated" \ |
| 2328 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2329 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2330 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2331 | 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] | 2332 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2333 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2334 | 0 \ |
| 2335 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2336 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2337 | -c "client hello, adding CID extension" \ |
| 2338 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2339 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2340 | -s "server hello, adding CID extension" \ |
| 2341 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2342 | -c "Use of CID extension negotiated" \ |
| 2343 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2344 | -c "Copy CIDs into SSL transform" \ |
| 2345 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2346 | -s "Peer CID (length 0 Bytes):" \ |
| 2347 | -s "Use of Connection ID has been negotiated" \ |
| 2348 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2349 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2350 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2351 | 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] | 2352 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2353 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2354 | 0 \ |
| 2355 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2356 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2357 | -c "client hello, adding CID extension" \ |
| 2358 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2359 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2360 | -s "server hello, adding CID extension" \ |
| 2361 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2362 | -c "Use of CID extension negotiated" \ |
| 2363 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2364 | -c "Copy CIDs into SSL transform" \ |
| 2365 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2366 | -c "Peer CID (length 0 Bytes):" \ |
| 2367 | -s "Use of Connection ID has been negotiated" \ |
| 2368 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2369 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2370 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2371 | 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] | 2372 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2373 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2374 | 0 \ |
| 2375 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2376 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2377 | -c "client hello, adding CID extension" \ |
| 2378 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2379 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2380 | -s "server hello, adding CID extension" \ |
| 2381 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2382 | -c "Use of CID extension negotiated" \ |
| 2383 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2384 | -c "Copy CIDs into SSL transform" \ |
| 2385 | -S "Use of Connection ID has been negotiated" \ |
| 2386 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2387 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2388 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2390 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2391 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2392 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2393 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2394 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2395 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2396 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2397 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2398 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2399 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2400 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2401 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2402 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2403 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2404 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2405 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2406 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2407 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2408 | 0 \ |
| 2409 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2410 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2411 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2412 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2413 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2414 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2415 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2416 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2417 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2418 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2419 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2420 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2421 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2422 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2423 | 0 \ |
| 2424 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2425 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2426 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2427 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2428 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2429 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2430 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2431 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2432 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2433 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2435 | 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] | 2436 | -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] | 2437 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2438 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2439 | 0 \ |
| 2440 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2441 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2442 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2443 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2444 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2445 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2446 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2447 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2448 | -c "ignoring unexpected CID" \ |
| 2449 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2450 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2451 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2452 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2453 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2454 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2455 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2456 | 0 \ |
| 2457 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2458 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2459 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2460 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2461 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2462 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2463 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2464 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2465 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2466 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2467 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2468 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2469 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2470 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2471 | 0 \ |
| 2472 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2473 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2474 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2475 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2476 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2477 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2478 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2479 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2480 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2481 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2482 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2483 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2484 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2485 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2486 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2487 | 0 \ |
| 2488 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2489 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2490 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2491 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2492 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2493 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2494 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2495 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2496 | -c "ignoring unexpected CID" \ |
| 2497 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2498 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2499 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2500 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2501 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2502 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2503 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2504 | 0 \ |
| 2505 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2506 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2507 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2508 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2509 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2510 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2511 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2512 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2513 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2514 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2515 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2516 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2517 | 0 \ |
| 2518 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2519 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2520 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2521 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2522 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2523 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2524 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2525 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2526 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2527 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2528 | -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] | 2529 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2530 | "$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" \ |
| 2531 | 0 \ |
| 2532 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2533 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2534 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2535 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2536 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2537 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2538 | -c "ignoring unexpected CID" \ |
| 2539 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2540 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2541 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2542 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2543 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2544 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2545 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2546 | 0 \ |
| 2547 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2548 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2549 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2550 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2551 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2552 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2553 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2554 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2555 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2556 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2557 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2558 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2559 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2560 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2561 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2562 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2563 | 0 \ |
| 2564 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2565 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2566 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2567 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2568 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2569 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2570 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2571 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2572 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2573 | -c "ignoring unexpected CID" \ |
| 2574 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2575 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2576 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2577 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2578 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2579 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2580 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2581 | 0 \ |
| 2582 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2583 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2584 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2585 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2586 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2587 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2588 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2589 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2590 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2591 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2592 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2593 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2594 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2595 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2596 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2597 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2598 | 0 \ |
| 2599 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2600 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2601 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2602 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2603 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2604 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2605 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2606 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2607 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2608 | -c "ignoring unexpected CID" \ |
| 2609 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2610 | |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2611 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
| 2612 | # tests check that the buffer contents are reallocated when the message is |
| 2613 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2614 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2615 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2616 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2617 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2618 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2619 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2620 | 0 \ |
| 2621 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2622 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2623 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2624 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2625 | -s "Reallocating in_buf" \ |
| 2626 | -s "Reallocating out_buf" |
| 2627 | |
| 2628 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2629 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2630 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2631 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2632 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2633 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2634 | 0 \ |
| 2635 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2636 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2637 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2638 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2639 | -s "Reallocating in_buf" \ |
| 2640 | -s "Reallocating out_buf" |
| 2641 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2642 | # Tests for Encrypt-then-MAC extension |
| 2643 | |
| 2644 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2645 | "$P_SRV debug_level=3 \ |
| 2646 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2647 | "$P_CLI debug_level=3" \ |
| 2648 | 0 \ |
| 2649 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2650 | -s "found encrypt then mac extension" \ |
| 2651 | -s "server hello, adding encrypt then mac extension" \ |
| 2652 | -c "found encrypt_then_mac extension" \ |
| 2653 | -c "using encrypt then mac" \ |
| 2654 | -s "using encrypt then mac" |
| 2655 | |
| 2656 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2657 | "$P_SRV debug_level=3 etm=0 \ |
| 2658 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2659 | "$P_CLI debug_level=3 etm=1" \ |
| 2660 | 0 \ |
| 2661 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2662 | -s "found encrypt then mac extension" \ |
| 2663 | -S "server hello, adding encrypt then mac extension" \ |
| 2664 | -C "found encrypt_then_mac extension" \ |
| 2665 | -C "using encrypt then mac" \ |
| 2666 | -S "using encrypt then mac" |
| 2667 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2668 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2669 | "$P_SRV debug_level=3 etm=1 \ |
| 2670 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2671 | "$P_CLI debug_level=3 etm=1" \ |
| 2672 | 0 \ |
| 2673 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2674 | -s "found encrypt then mac extension" \ |
| 2675 | -S "server hello, adding encrypt then mac extension" \ |
| 2676 | -C "found encrypt_then_mac extension" \ |
| 2677 | -C "using encrypt then mac" \ |
| 2678 | -S "using encrypt then mac" |
| 2679 | |
| 2680 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2681 | "$P_SRV debug_level=3 etm=1 \ |
| 2682 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2683 | "$P_CLI debug_level=3 etm=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2684 | 0 \ |
| 2685 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2686 | -s "found encrypt then mac extension" \ |
| 2687 | -S "server hello, adding encrypt then mac extension" \ |
| 2688 | -C "found encrypt_then_mac extension" \ |
| 2689 | -C "using encrypt then mac" \ |
| 2690 | -S "using encrypt then mac" |
| 2691 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2692 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2693 | "$P_SRV debug_level=3 etm=1 \ |
| 2694 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2695 | "$P_CLI debug_level=3 etm=0" \ |
| 2696 | 0 \ |
| 2697 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2698 | -S "found encrypt then mac extension" \ |
| 2699 | -S "server hello, adding encrypt then mac extension" \ |
| 2700 | -C "found encrypt_then_mac extension" \ |
| 2701 | -C "using encrypt then mac" \ |
| 2702 | -S "using encrypt then mac" |
| 2703 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2704 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2705 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2706 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2707 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2708 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2709 | 0 \ |
| 2710 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2711 | -S "found encrypt then mac extension" \ |
| 2712 | -S "server hello, adding encrypt then mac extension" \ |
| 2713 | -C "found encrypt_then_mac extension" \ |
| 2714 | -C "using encrypt then mac" \ |
| 2715 | -S "using encrypt then mac" |
| 2716 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2717 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2718 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2719 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2720 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2721 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2722 | 0 \ |
| 2723 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2724 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2725 | -S "server hello, adding encrypt then mac extension" \ |
| 2726 | -C "found encrypt_then_mac extension" \ |
| 2727 | -C "using encrypt then mac" \ |
| 2728 | -S "using encrypt then mac" |
| 2729 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2730 | # Tests for Extended Master Secret extension |
| 2731 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2732 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2733 | run_test "Extended Master Secret: default" \ |
| 2734 | "$P_SRV debug_level=3" \ |
| 2735 | "$P_CLI debug_level=3" \ |
| 2736 | 0 \ |
| 2737 | -c "client hello, adding extended_master_secret extension" \ |
| 2738 | -s "found extended master secret extension" \ |
| 2739 | -s "server hello, adding extended master secret extension" \ |
| 2740 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2741 | -c "session hash for extended master secret" \ |
| 2742 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2743 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2744 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2745 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2746 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2747 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2748 | 0 \ |
| 2749 | -c "client hello, adding extended_master_secret extension" \ |
| 2750 | -s "found extended master secret extension" \ |
| 2751 | -S "server hello, adding extended master secret extension" \ |
| 2752 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2753 | -C "session hash for extended master secret" \ |
| 2754 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2755 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2756 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2757 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2758 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2759 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2760 | 0 \ |
| 2761 | -C "client hello, adding extended_master_secret extension" \ |
| 2762 | -S "found extended master secret extension" \ |
| 2763 | -S "server hello, adding extended master secret extension" \ |
| 2764 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2765 | -C "session hash for extended master secret" \ |
| 2766 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2767 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2768 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2769 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2770 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2771 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2772 | 0 \ |
| 2773 | -C "client hello, adding extended_master_secret extension" \ |
| 2774 | -S "found extended master secret extension" \ |
| 2775 | -S "server hello, adding extended master secret extension" \ |
| 2776 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2777 | -C "session hash for extended master secret" \ |
| 2778 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2779 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2780 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2781 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2782 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2783 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2784 | 0 \ |
| 2785 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2786 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2787 | -S "server hello, adding extended master secret extension" \ |
| 2788 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2789 | -C "session hash for extended master secret" \ |
| 2790 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2791 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2792 | # Tests for FALLBACK_SCSV |
| 2793 | |
| 2794 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2795 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2796 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2797 | 0 \ |
| 2798 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2799 | -S "received FALLBACK_SCSV" \ |
| 2800 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2801 | -C "is a fatal alert message (msg 86)" |
| 2802 | |
| 2803 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2804 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2805 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2806 | 0 \ |
| 2807 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2808 | -S "received FALLBACK_SCSV" \ |
| 2809 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2810 | -C "is a fatal alert message (msg 86)" |
| 2811 | |
| 2812 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2813 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2814 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2815 | 1 \ |
| 2816 | -c "adding FALLBACK_SCSV" \ |
| 2817 | -s "received FALLBACK_SCSV" \ |
| 2818 | -s "inapropriate fallback" \ |
| 2819 | -c "is a fatal alert message (msg 86)" |
| 2820 | |
| 2821 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2822 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2823 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2824 | 0 \ |
| 2825 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2826 | -s "received FALLBACK_SCSV" \ |
| 2827 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2828 | -C "is a fatal alert message (msg 86)" |
| 2829 | |
| 2830 | requires_openssl_with_fallback_scsv |
| 2831 | run_test "Fallback SCSV: default, openssl server" \ |
| 2832 | "$O_SRV" \ |
| 2833 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2834 | 0 \ |
| 2835 | -C "adding FALLBACK_SCSV" \ |
| 2836 | -C "is a fatal alert message (msg 86)" |
| 2837 | |
| 2838 | requires_openssl_with_fallback_scsv |
| 2839 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2840 | "$O_SRV" \ |
| 2841 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2842 | 1 \ |
| 2843 | -c "adding FALLBACK_SCSV" \ |
| 2844 | -c "is a fatal alert message (msg 86)" |
| 2845 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2846 | requires_openssl_with_fallback_scsv |
| 2847 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2848 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2849 | "$O_CLI -tls1_1" \ |
| 2850 | 0 \ |
| 2851 | -S "received FALLBACK_SCSV" \ |
| 2852 | -S "inapropriate fallback" |
| 2853 | |
| 2854 | requires_openssl_with_fallback_scsv |
| 2855 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2856 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2857 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2858 | 1 \ |
| 2859 | -s "received FALLBACK_SCSV" \ |
| 2860 | -s "inapropriate fallback" |
| 2861 | |
| 2862 | requires_openssl_with_fallback_scsv |
| 2863 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2864 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2865 | "$O_CLI -fallback_scsv" \ |
| 2866 | 0 \ |
| 2867 | -s "received FALLBACK_SCSV" \ |
| 2868 | -S "inapropriate fallback" |
| 2869 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2870 | # Test sending and receiving empty application data records |
| 2871 | |
| 2872 | run_test "Encrypt then MAC: empty application data record" \ |
| 2873 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2874 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2875 | 0 \ |
| 2876 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2877 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2878 | -c "0 bytes written in 1 fragments" |
| 2879 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2880 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2881 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2882 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2883 | 0 \ |
| 2884 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2885 | -c "0 bytes written in 1 fragments" |
| 2886 | |
| 2887 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2888 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2889 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2890 | 0 \ |
| 2891 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2892 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2893 | -c "0 bytes written in 1 fragments" |
| 2894 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2895 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2896 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2897 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2898 | 0 \ |
| 2899 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2900 | -c "0 bytes written in 1 fragments" |
| 2901 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2902 | ## ClientHello generated with |
| 2903 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2904 | ## then manually twiddling the ciphersuite list. |
| 2905 | ## The ClientHello content is spelled out below as a hex string as |
| 2906 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2907 | ## The expected response is an inappropriate_fallback alert. |
| 2908 | requires_openssl_with_fallback_scsv |
| 2909 | run_test "Fallback SCSV: beginning of list" \ |
| 2910 | "$P_SRV debug_level=2" \ |
| 2911 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2912 | 0 \ |
| 2913 | -s "received FALLBACK_SCSV" \ |
| 2914 | -s "inapropriate fallback" |
| 2915 | |
| 2916 | requires_openssl_with_fallback_scsv |
| 2917 | run_test "Fallback SCSV: end of list" \ |
| 2918 | "$P_SRV debug_level=2" \ |
| 2919 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2920 | 0 \ |
| 2921 | -s "received FALLBACK_SCSV" \ |
| 2922 | -s "inapropriate fallback" |
| 2923 | |
| 2924 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2925 | requires_openssl_with_fallback_scsv |
| 2926 | run_test "Fallback SCSV: not in list" \ |
| 2927 | "$P_SRV debug_level=2" \ |
| 2928 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2929 | 0 \ |
| 2930 | -S "received FALLBACK_SCSV" \ |
| 2931 | -S "inapropriate fallback" |
| 2932 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2933 | # Tests for CBC 1/n-1 record splitting |
| 2934 | |
| 2935 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2936 | "$P_SRV" \ |
| 2937 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2938 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2939 | 0 \ |
| 2940 | -s "Read from client: 123 bytes read" \ |
| 2941 | -S "Read from client: 1 bytes read" \ |
| 2942 | -S "122 bytes read" |
| 2943 | |
| 2944 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2945 | "$P_SRV" \ |
| 2946 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2947 | request_size=123 force_version=tls1_1" \ |
| 2948 | 0 \ |
| 2949 | -s "Read from client: 123 bytes read" \ |
| 2950 | -S "Read from client: 1 bytes read" \ |
| 2951 | -S "122 bytes read" |
| 2952 | |
| 2953 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2954 | "$P_SRV" \ |
| 2955 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2956 | request_size=123 force_version=tls1" \ |
| 2957 | 0 \ |
| 2958 | -S "Read from client: 123 bytes read" \ |
| 2959 | -s "Read from client: 1 bytes read" \ |
| 2960 | -s "122 bytes read" |
| 2961 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2962 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2963 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2964 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2965 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2966 | request_size=123 force_version=ssl3" \ |
| 2967 | 0 \ |
| 2968 | -S "Read from client: 123 bytes read" \ |
| 2969 | -s "Read from client: 1 bytes read" \ |
| 2970 | -s "122 bytes read" |
| 2971 | |
| 2972 | run_test "CBC Record splitting: TLS 1.0 RC4, no splitting" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2973 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2974 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2975 | request_size=123 force_version=tls1" \ |
| 2976 | 0 \ |
| 2977 | -s "Read from client: 123 bytes read" \ |
| 2978 | -S "Read from client: 1 bytes read" \ |
| 2979 | -S "122 bytes read" |
| 2980 | |
| 2981 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2982 | "$P_SRV" \ |
| 2983 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2984 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2985 | 0 \ |
| 2986 | -s "Read from client: 123 bytes read" \ |
| 2987 | -S "Read from client: 1 bytes read" \ |
| 2988 | -S "122 bytes read" |
| 2989 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2990 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2991 | "$P_SRV nbio=2" \ |
| 2992 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2993 | request_size=123 force_version=tls1" \ |
| 2994 | 0 \ |
| 2995 | -S "Read from client: 123 bytes read" \ |
| 2996 | -s "Read from client: 1 bytes read" \ |
| 2997 | -s "122 bytes read" |
| 2998 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2999 | # Tests for Session Tickets |
| 3000 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3001 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3002 | "$P_SRV debug_level=3 tickets=1" \ |
| 3003 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3004 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3005 | -c "client hello, adding session ticket extension" \ |
| 3006 | -s "found session ticket extension" \ |
| 3007 | -s "server hello, adding session ticket extension" \ |
| 3008 | -c "found session_ticket extension" \ |
| 3009 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3010 | -S "session successfully restored from cache" \ |
| 3011 | -s "session successfully restored from ticket" \ |
| 3012 | -s "a session has been resumed" \ |
| 3013 | -c "a session has been resumed" |
| 3014 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3015 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3016 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3017 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3018 | 0 \ |
| 3019 | -c "client hello, adding session ticket extension" \ |
| 3020 | -s "found session ticket extension" \ |
| 3021 | -s "server hello, adding session ticket extension" \ |
| 3022 | -c "found session_ticket extension" \ |
| 3023 | -c "parse new session ticket" \ |
| 3024 | -S "session successfully restored from cache" \ |
| 3025 | -s "session successfully restored from ticket" \ |
| 3026 | -s "a session has been resumed" \ |
| 3027 | -c "a session has been resumed" |
| 3028 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3029 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3030 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3031 | "$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] | 3032 | 0 \ |
| 3033 | -c "client hello, adding session ticket extension" \ |
| 3034 | -s "found session ticket extension" \ |
| 3035 | -s "server hello, adding session ticket extension" \ |
| 3036 | -c "found session_ticket extension" \ |
| 3037 | -c "parse new session ticket" \ |
| 3038 | -S "session successfully restored from cache" \ |
| 3039 | -S "session successfully restored from ticket" \ |
| 3040 | -S "a session has been resumed" \ |
| 3041 | -C "a session has been resumed" |
| 3042 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3043 | run_test "Session resume using tickets: session copy" \ |
| 3044 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3045 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3046 | 0 \ |
| 3047 | -c "client hello, adding session ticket extension" \ |
| 3048 | -s "found session ticket extension" \ |
| 3049 | -s "server hello, adding session ticket extension" \ |
| 3050 | -c "found session_ticket extension" \ |
| 3051 | -c "parse new session ticket" \ |
| 3052 | -S "session successfully restored from cache" \ |
| 3053 | -s "session successfully restored from ticket" \ |
| 3054 | -s "a session has been resumed" \ |
| 3055 | -c "a session has been resumed" |
| 3056 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3057 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3058 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3059 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3060 | 0 \ |
| 3061 | -c "client hello, adding session ticket extension" \ |
| 3062 | -c "found session_ticket extension" \ |
| 3063 | -c "parse new session ticket" \ |
| 3064 | -c "a session has been resumed" |
| 3065 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3066 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3067 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3068 | "( $O_CLI -sess_out $SESSION; \ |
| 3069 | $O_CLI -sess_in $SESSION; \ |
| 3070 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3071 | 0 \ |
| 3072 | -s "found session ticket extension" \ |
| 3073 | -s "server hello, adding session ticket extension" \ |
| 3074 | -S "session successfully restored from cache" \ |
| 3075 | -s "session successfully restored from ticket" \ |
| 3076 | -s "a session has been resumed" |
| 3077 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3078 | # Tests for Session Tickets with DTLS |
| 3079 | |
| 3080 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3081 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3082 | "$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] | 3083 | 0 \ |
| 3084 | -c "client hello, adding session ticket extension" \ |
| 3085 | -s "found session ticket extension" \ |
| 3086 | -s "server hello, adding session ticket extension" \ |
| 3087 | -c "found session_ticket extension" \ |
| 3088 | -c "parse new session ticket" \ |
| 3089 | -S "session successfully restored from cache" \ |
| 3090 | -s "session successfully restored from ticket" \ |
| 3091 | -s "a session has been resumed" \ |
| 3092 | -c "a session has been resumed" |
| 3093 | |
| 3094 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3095 | "$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] | 3096 | "$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] | 3097 | 0 \ |
| 3098 | -c "client hello, adding session ticket extension" \ |
| 3099 | -s "found session ticket extension" \ |
| 3100 | -s "server hello, adding session ticket extension" \ |
| 3101 | -c "found session_ticket extension" \ |
| 3102 | -c "parse new session ticket" \ |
| 3103 | -S "session successfully restored from cache" \ |
| 3104 | -s "session successfully restored from ticket" \ |
| 3105 | -s "a session has been resumed" \ |
| 3106 | -c "a session has been resumed" |
| 3107 | |
| 3108 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3109 | "$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] | 3110 | "$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] | 3111 | 0 \ |
| 3112 | -c "client hello, adding session ticket extension" \ |
| 3113 | -s "found session ticket extension" \ |
| 3114 | -s "server hello, adding session ticket extension" \ |
| 3115 | -c "found session_ticket extension" \ |
| 3116 | -c "parse new session ticket" \ |
| 3117 | -S "session successfully restored from cache" \ |
| 3118 | -S "session successfully restored from ticket" \ |
| 3119 | -S "a session has been resumed" \ |
| 3120 | -C "a session has been resumed" |
| 3121 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3122 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3123 | "$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] | 3124 | "$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] | 3125 | 0 \ |
| 3126 | -c "client hello, adding session ticket extension" \ |
| 3127 | -s "found session ticket extension" \ |
| 3128 | -s "server hello, adding session ticket extension" \ |
| 3129 | -c "found session_ticket extension" \ |
| 3130 | -c "parse new session ticket" \ |
| 3131 | -S "session successfully restored from cache" \ |
| 3132 | -s "session successfully restored from ticket" \ |
| 3133 | -s "a session has been resumed" \ |
| 3134 | -c "a session has been resumed" |
| 3135 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3136 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3137 | "$O_SRV -dtls1" \ |
| 3138 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3139 | 0 \ |
| 3140 | -c "client hello, adding session ticket extension" \ |
| 3141 | -c "found session_ticket extension" \ |
| 3142 | -c "parse new session ticket" \ |
| 3143 | -c "a session has been resumed" |
| 3144 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3145 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 7ca2f39 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 3146 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3147 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3148 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3149 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3150 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3151 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3152 | rm -f $SESSION )" \ |
| 3153 | 0 \ |
| 3154 | -s "found session ticket extension" \ |
| 3155 | -s "server hello, adding session ticket extension" \ |
| 3156 | -S "session successfully restored from cache" \ |
| 3157 | -s "session successfully restored from ticket" \ |
| 3158 | -s "a session has been resumed" |
| 3159 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3160 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3161 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3162 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3163 | "$P_SRV debug_level=3 tickets=0" \ |
| 3164 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3165 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3166 | -c "client hello, adding session ticket extension" \ |
| 3167 | -s "found session ticket extension" \ |
| 3168 | -S "server hello, adding session ticket extension" \ |
| 3169 | -C "found session_ticket extension" \ |
| 3170 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3171 | -s "session successfully restored from cache" \ |
| 3172 | -S "session successfully restored from ticket" \ |
| 3173 | -s "a session has been resumed" \ |
| 3174 | -c "a session has been resumed" |
| 3175 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3176 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3177 | "$P_SRV debug_level=3 tickets=1" \ |
| 3178 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3179 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3180 | -C "client hello, adding session ticket extension" \ |
| 3181 | -S "found session ticket extension" \ |
| 3182 | -S "server hello, adding session ticket extension" \ |
| 3183 | -C "found session_ticket extension" \ |
| 3184 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3185 | -s "session successfully restored from cache" \ |
| 3186 | -S "session successfully restored from ticket" \ |
| 3187 | -s "a session has been resumed" \ |
| 3188 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3189 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3190 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3191 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3192 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3193 | 0 \ |
| 3194 | -S "session successfully restored from cache" \ |
| 3195 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3196 | -S "a session has been resumed" \ |
| 3197 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3198 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3199 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3200 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3201 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3202 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3203 | 0 \ |
| 3204 | -s "session successfully restored from cache" \ |
| 3205 | -S "session successfully restored from ticket" \ |
| 3206 | -s "a session has been resumed" \ |
| 3207 | -c "a session has been resumed" |
| 3208 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3209 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3210 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3211 | "$P_SRV debug_level=3 tickets=0" \ |
| 3212 | "$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] | 3213 | 0 \ |
| 3214 | -s "session successfully restored from cache" \ |
| 3215 | -S "session successfully restored from ticket" \ |
| 3216 | -s "a session has been resumed" \ |
| 3217 | -c "a session has been resumed" |
| 3218 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3219 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3220 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3221 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3222 | "$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] | 3223 | 0 \ |
| 3224 | -S "session successfully restored from cache" \ |
| 3225 | -S "session successfully restored from ticket" \ |
| 3226 | -S "a session has been resumed" \ |
| 3227 | -C "a session has been resumed" |
| 3228 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3229 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3230 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3231 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3232 | "$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] | 3233 | 0 \ |
| 3234 | -s "session successfully restored from cache" \ |
| 3235 | -S "session successfully restored from ticket" \ |
| 3236 | -s "a session has been resumed" \ |
| 3237 | -c "a session has been resumed" |
| 3238 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3239 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3240 | run_test "Session resume using cache: session copy" \ |
| 3241 | "$P_SRV debug_level=3 tickets=0" \ |
| 3242 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3243 | 0 \ |
| 3244 | -s "session successfully restored from cache" \ |
| 3245 | -S "session successfully restored from ticket" \ |
| 3246 | -s "a session has been resumed" \ |
| 3247 | -c "a session has been resumed" |
| 3248 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3249 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3250 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3251 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3252 | "( $O_CLI -sess_out $SESSION; \ |
| 3253 | $O_CLI -sess_in $SESSION; \ |
| 3254 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3255 | 0 \ |
| 3256 | -s "found session ticket extension" \ |
| 3257 | -S "server hello, adding session ticket extension" \ |
| 3258 | -s "session successfully restored from cache" \ |
| 3259 | -S "session successfully restored from ticket" \ |
| 3260 | -s "a session has been resumed" |
| 3261 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3262 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3263 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3264 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3265 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3266 | 0 \ |
| 3267 | -C "found session_ticket extension" \ |
| 3268 | -C "parse new session ticket" \ |
| 3269 | -c "a session has been resumed" |
| 3270 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3271 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3272 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3273 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3274 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3275 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3276 | "$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] | 3277 | 0 \ |
| 3278 | -c "client hello, adding session ticket extension" \ |
| 3279 | -s "found session ticket extension" \ |
| 3280 | -S "server hello, adding session ticket extension" \ |
| 3281 | -C "found session_ticket extension" \ |
| 3282 | -C "parse new session ticket" \ |
| 3283 | -s "session successfully restored from cache" \ |
| 3284 | -S "session successfully restored from ticket" \ |
| 3285 | -s "a session has been resumed" \ |
| 3286 | -c "a session has been resumed" |
| 3287 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3288 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3289 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3290 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3291 | "$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] | 3292 | 0 \ |
| 3293 | -C "client hello, adding session ticket extension" \ |
| 3294 | -S "found session ticket extension" \ |
| 3295 | -S "server hello, adding session ticket extension" \ |
| 3296 | -C "found session_ticket extension" \ |
| 3297 | -C "parse new session ticket" \ |
| 3298 | -s "session successfully restored from cache" \ |
| 3299 | -S "session successfully restored from ticket" \ |
| 3300 | -s "a session has been resumed" \ |
| 3301 | -c "a session has been resumed" |
| 3302 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3303 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3304 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3305 | "$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] | 3306 | "$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] | 3307 | 0 \ |
| 3308 | -S "session successfully restored from cache" \ |
| 3309 | -S "session successfully restored from ticket" \ |
| 3310 | -S "a session has been resumed" \ |
| 3311 | -C "a session has been resumed" |
| 3312 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3313 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3314 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3315 | "$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] | 3316 | "$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] | 3317 | 0 \ |
| 3318 | -s "session successfully restored from cache" \ |
| 3319 | -S "session successfully restored from ticket" \ |
| 3320 | -s "a session has been resumed" \ |
| 3321 | -c "a session has been resumed" |
| 3322 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3323 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3324 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3325 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3326 | "$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] | 3327 | 0 \ |
| 3328 | -s "session successfully restored from cache" \ |
| 3329 | -S "session successfully restored from ticket" \ |
| 3330 | -s "a session has been resumed" \ |
| 3331 | -c "a session has been resumed" |
| 3332 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3333 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3334 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3335 | "$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] | 3336 | "$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] | 3337 | 0 \ |
| 3338 | -S "session successfully restored from cache" \ |
| 3339 | -S "session successfully restored from ticket" \ |
| 3340 | -S "a session has been resumed" \ |
| 3341 | -C "a session has been resumed" |
| 3342 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3343 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3344 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3345 | "$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] | 3346 | "$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] | 3347 | 0 \ |
| 3348 | -s "session successfully restored from cache" \ |
| 3349 | -S "session successfully restored from ticket" \ |
| 3350 | -s "a session has been resumed" \ |
| 3351 | -c "a session has been resumed" |
| 3352 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3353 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3354 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3355 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3356 | "$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] | 3357 | 0 \ |
| 3358 | -s "session successfully restored from cache" \ |
| 3359 | -S "session successfully restored from ticket" \ |
| 3360 | -s "a session has been resumed" \ |
| 3361 | -c "a session has been resumed" |
| 3362 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3363 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 7ca2f39 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 3364 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3365 | requires_openssl_next |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3366 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3367 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3368 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3369 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3370 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3371 | rm -f $SESSION )" \ |
| 3372 | 0 \ |
| 3373 | -s "found session ticket extension" \ |
| 3374 | -S "server hello, adding session ticket extension" \ |
| 3375 | -s "session successfully restored from cache" \ |
| 3376 | -S "session successfully restored from ticket" \ |
| 3377 | -s "a session has been resumed" |
| 3378 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3379 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3380 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3381 | "$O_SRV -dtls1" \ |
| 3382 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3383 | 0 \ |
| 3384 | -C "found session_ticket extension" \ |
| 3385 | -C "parse new session ticket" \ |
| 3386 | -c "a session has been resumed" |
| 3387 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3388 | # Tests for Max Fragment Length extension |
| 3389 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3390 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3391 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3392 | "$P_SRV debug_level=3" \ |
| 3393 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3394 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3395 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3396 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3397 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3398 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3399 | -C "client hello, adding max_fragment_length extension" \ |
| 3400 | -S "found max fragment length extension" \ |
| 3401 | -S "server hello, max_fragment_length extension" \ |
| 3402 | -C "found max_fragment_length extension" |
| 3403 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3404 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3405 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3406 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3407 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3408 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3409 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3410 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3411 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3412 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3413 | -C "client hello, adding max_fragment_length extension" \ |
| 3414 | -S "found max fragment length extension" \ |
| 3415 | -S "server hello, max_fragment_length extension" \ |
| 3416 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3417 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3418 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3419 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3420 | |
| 3421 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3422 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3423 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3424 | "$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] | 3425 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3426 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3427 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3428 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3429 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3430 | -C "client hello, adding max_fragment_length extension" \ |
| 3431 | -S "found max fragment length extension" \ |
| 3432 | -S "server hello, max_fragment_length extension" \ |
| 3433 | -C "found max_fragment_length extension" \ |
| 3434 | -c "fragment larger than.*maximum " |
| 3435 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3436 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3437 | # (session fragment length will be 16384 regardless of mbedtls |
| 3438 | # content length configuration.) |
| 3439 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3440 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3441 | run_test "Max fragment length: disabled, larger message" \ |
| 3442 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3443 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3444 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3445 | -C "Maximum input fragment length is 16384" \ |
| 3446 | -C "Maximum output fragment length is 16384" \ |
| 3447 | -S "Maximum input fragment length is 16384" \ |
| 3448 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3449 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3450 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3451 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3452 | |
| 3453 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3454 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3455 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3456 | "$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] | 3457 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3458 | -C "Maximum input fragment length is 16384" \ |
| 3459 | -C "Maximum output fragment length is 16384" \ |
| 3460 | -S "Maximum input fragment length is 16384" \ |
| 3461 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3462 | -c "fragment larger than.*maximum " |
| 3463 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3464 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3465 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3466 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3467 | "$P_SRV debug_level=3" \ |
| 3468 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3469 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3470 | -c "Maximum input fragment length is 4096" \ |
| 3471 | -c "Maximum output fragment length is 4096" \ |
| 3472 | -s "Maximum input fragment length is 4096" \ |
| 3473 | -s "Maximum output fragment length is 4096" \ |
| 3474 | -c "client hello, adding max_fragment_length extension" \ |
| 3475 | -s "found max fragment length extension" \ |
| 3476 | -s "server hello, max_fragment_length extension" \ |
| 3477 | -c "found max_fragment_length extension" |
| 3478 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3479 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3480 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3481 | run_test "Max fragment length: client 512, server 1024" \ |
| 3482 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3483 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3484 | 0 \ |
| 3485 | -c "Maximum input fragment length is 512" \ |
| 3486 | -c "Maximum output fragment length is 512" \ |
| 3487 | -s "Maximum input fragment length is 512" \ |
| 3488 | -s "Maximum output fragment length is 512" \ |
| 3489 | -c "client hello, adding max_fragment_length extension" \ |
| 3490 | -s "found max fragment length extension" \ |
| 3491 | -s "server hello, max_fragment_length extension" \ |
| 3492 | -c "found max_fragment_length extension" |
| 3493 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3494 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3495 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3496 | run_test "Max fragment length: client 512, server 2048" \ |
| 3497 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3498 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3499 | 0 \ |
| 3500 | -c "Maximum input fragment length is 512" \ |
| 3501 | -c "Maximum output fragment length is 512" \ |
| 3502 | -s "Maximum input fragment length is 512" \ |
| 3503 | -s "Maximum output fragment length is 512" \ |
| 3504 | -c "client hello, adding max_fragment_length extension" \ |
| 3505 | -s "found max fragment length extension" \ |
| 3506 | -s "server hello, max_fragment_length extension" \ |
| 3507 | -c "found max_fragment_length extension" |
| 3508 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3509 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3510 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3511 | run_test "Max fragment length: client 512, server 4096" \ |
| 3512 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3513 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3514 | 0 \ |
| 3515 | -c "Maximum input fragment length is 512" \ |
| 3516 | -c "Maximum output fragment length is 512" \ |
| 3517 | -s "Maximum input fragment length is 512" \ |
| 3518 | -s "Maximum output fragment length is 512" \ |
| 3519 | -c "client hello, adding max_fragment_length extension" \ |
| 3520 | -s "found max fragment length extension" \ |
| 3521 | -s "server hello, max_fragment_length extension" \ |
| 3522 | -c "found max_fragment_length extension" |
| 3523 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3524 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3525 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3526 | run_test "Max fragment length: client 1024, server 512" \ |
| 3527 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3528 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3529 | 0 \ |
| 3530 | -c "Maximum input fragment length is 1024" \ |
| 3531 | -c "Maximum output fragment length is 1024" \ |
| 3532 | -s "Maximum input fragment length is 1024" \ |
| 3533 | -s "Maximum output fragment length is 512" \ |
| 3534 | -c "client hello, adding max_fragment_length extension" \ |
| 3535 | -s "found max fragment length extension" \ |
| 3536 | -s "server hello, max_fragment_length extension" \ |
| 3537 | -c "found max_fragment_length extension" |
| 3538 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3539 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3540 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3541 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3542 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3543 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3544 | 0 \ |
| 3545 | -c "Maximum input fragment length is 1024" \ |
| 3546 | -c "Maximum output fragment length is 1024" \ |
| 3547 | -s "Maximum input fragment length is 1024" \ |
| 3548 | -s "Maximum output fragment length is 1024" \ |
| 3549 | -c "client hello, adding max_fragment_length extension" \ |
| 3550 | -s "found max fragment length extension" \ |
| 3551 | -s "server hello, max_fragment_length extension" \ |
| 3552 | -c "found max_fragment_length extension" |
| 3553 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3554 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3555 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3556 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3557 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3558 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3559 | 0 \ |
| 3560 | -c "Maximum input fragment length is 1024" \ |
| 3561 | -c "Maximum output fragment length is 1024" \ |
| 3562 | -s "Maximum input fragment length is 1024" \ |
| 3563 | -s "Maximum output fragment length is 1024" \ |
| 3564 | -c "client hello, adding max_fragment_length extension" \ |
| 3565 | -s "found max fragment length extension" \ |
| 3566 | -s "server hello, max_fragment_length extension" \ |
| 3567 | -c "found max_fragment_length extension" |
| 3568 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3569 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3570 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3571 | run_test "Max fragment length: client 2048, server 512" \ |
| 3572 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3573 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3574 | 0 \ |
| 3575 | -c "Maximum input fragment length is 2048" \ |
| 3576 | -c "Maximum output fragment length is 2048" \ |
| 3577 | -s "Maximum input fragment length is 2048" \ |
| 3578 | -s "Maximum output fragment length is 512" \ |
| 3579 | -c "client hello, adding max_fragment_length extension" \ |
| 3580 | -s "found max fragment length extension" \ |
| 3581 | -s "server hello, max_fragment_length extension" \ |
| 3582 | -c "found max_fragment_length extension" |
| 3583 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3584 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3585 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3586 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3587 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3588 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3589 | 0 \ |
| 3590 | -c "Maximum input fragment length is 2048" \ |
| 3591 | -c "Maximum output fragment length is 2048" \ |
| 3592 | -s "Maximum input fragment length is 2048" \ |
| 3593 | -s "Maximum output fragment length is 1024" \ |
| 3594 | -c "client hello, adding max_fragment_length extension" \ |
| 3595 | -s "found max fragment length extension" \ |
| 3596 | -s "server hello, max_fragment_length extension" \ |
| 3597 | -c "found max_fragment_length extension" |
| 3598 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3599 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3600 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3601 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3602 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3603 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3604 | 0 \ |
| 3605 | -c "Maximum input fragment length is 2048" \ |
| 3606 | -c "Maximum output fragment length is 2048" \ |
| 3607 | -s "Maximum input fragment length is 2048" \ |
| 3608 | -s "Maximum output fragment length is 2048" \ |
| 3609 | -c "client hello, adding max_fragment_length extension" \ |
| 3610 | -s "found max fragment length extension" \ |
| 3611 | -s "server hello, max_fragment_length extension" \ |
| 3612 | -c "found max_fragment_length extension" |
| 3613 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3614 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3615 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3616 | run_test "Max fragment length: client 4096, server 512" \ |
| 3617 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3618 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3619 | 0 \ |
| 3620 | -c "Maximum input fragment length is 4096" \ |
| 3621 | -c "Maximum output fragment length is 4096" \ |
| 3622 | -s "Maximum input fragment length is 4096" \ |
| 3623 | -s "Maximum output fragment length is 512" \ |
| 3624 | -c "client hello, adding max_fragment_length extension" \ |
| 3625 | -s "found max fragment length extension" \ |
| 3626 | -s "server hello, max_fragment_length extension" \ |
| 3627 | -c "found max_fragment_length extension" |
| 3628 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3629 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3630 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3631 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3632 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3633 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3634 | 0 \ |
| 3635 | -c "Maximum input fragment length is 4096" \ |
| 3636 | -c "Maximum output fragment length is 4096" \ |
| 3637 | -s "Maximum input fragment length is 4096" \ |
| 3638 | -s "Maximum output fragment length is 1024" \ |
| 3639 | -c "client hello, adding max_fragment_length extension" \ |
| 3640 | -s "found max fragment length extension" \ |
| 3641 | -s "server hello, max_fragment_length extension" \ |
| 3642 | -c "found max_fragment_length extension" |
| 3643 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3644 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3645 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3646 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3647 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3648 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3649 | 0 \ |
| 3650 | -c "Maximum input fragment length is 4096" \ |
| 3651 | -c "Maximum output fragment length is 4096" \ |
| 3652 | -s "Maximum input fragment length is 4096" \ |
| 3653 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3654 | -c "client hello, adding max_fragment_length extension" \ |
| 3655 | -s "found max fragment length extension" \ |
| 3656 | -s "server hello, max_fragment_length extension" \ |
| 3657 | -c "found max_fragment_length extension" |
| 3658 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3659 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3660 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3661 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3662 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3663 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3664 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3665 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3666 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3667 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3668 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3669 | -C "client hello, adding max_fragment_length extension" \ |
| 3670 | -S "found max fragment length extension" \ |
| 3671 | -S "server hello, max_fragment_length extension" \ |
| 3672 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3673 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3674 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3675 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3676 | requires_gnutls |
| 3677 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3678 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3679 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3680 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3681 | -c "Maximum input fragment length is 4096" \ |
| 3682 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3683 | -c "client hello, adding max_fragment_length extension" \ |
| 3684 | -c "found max_fragment_length extension" |
| 3685 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3686 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3687 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3688 | run_test "Max fragment length: client, message just fits" \ |
| 3689 | "$P_SRV debug_level=3" \ |
| 3690 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3691 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3692 | -c "Maximum input fragment length is 2048" \ |
| 3693 | -c "Maximum output fragment length is 2048" \ |
| 3694 | -s "Maximum input fragment length is 2048" \ |
| 3695 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3696 | -c "client hello, adding max_fragment_length extension" \ |
| 3697 | -s "found max fragment length extension" \ |
| 3698 | -s "server hello, max_fragment_length extension" \ |
| 3699 | -c "found max_fragment_length extension" \ |
| 3700 | -c "2048 bytes written in 1 fragments" \ |
| 3701 | -s "2048 bytes read" |
| 3702 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3703 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3704 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3705 | run_test "Max fragment length: client, larger message" \ |
| 3706 | "$P_SRV debug_level=3" \ |
| 3707 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3708 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3709 | -c "Maximum input fragment length is 2048" \ |
| 3710 | -c "Maximum output fragment length is 2048" \ |
| 3711 | -s "Maximum input fragment length is 2048" \ |
| 3712 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3713 | -c "client hello, adding max_fragment_length extension" \ |
| 3714 | -s "found max fragment length extension" \ |
| 3715 | -s "server hello, max_fragment_length extension" \ |
| 3716 | -c "found max_fragment_length extension" \ |
| 3717 | -c "2345 bytes written in 2 fragments" \ |
| 3718 | -s "2048 bytes read" \ |
| 3719 | -s "297 bytes read" |
| 3720 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3721 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3722 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3723 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3724 | "$P_SRV debug_level=3 dtls=1" \ |
| 3725 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3726 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3727 | -c "Maximum input fragment length is 2048" \ |
| 3728 | -c "Maximum output fragment length is 2048" \ |
| 3729 | -s "Maximum input fragment length is 2048" \ |
| 3730 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3731 | -c "client hello, adding max_fragment_length extension" \ |
| 3732 | -s "found max fragment length extension" \ |
| 3733 | -s "server hello, max_fragment_length extension" \ |
| 3734 | -c "found max_fragment_length extension" \ |
| 3735 | -c "fragment larger than.*maximum" |
| 3736 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3737 | # Tests for renegotiation |
| 3738 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3739 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3740 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3741 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3742 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3743 | 0 \ |
| 3744 | -C "client hello, adding renegotiation extension" \ |
| 3745 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3746 | -S "found renegotiation extension" \ |
| 3747 | -s "server hello, secure renegotiation extension" \ |
| 3748 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3749 | -C "=> renegotiate" \ |
| 3750 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3751 | -S "write hello request" |
| 3752 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3753 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3754 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3755 | "$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] | 3756 | "$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] | 3757 | 0 \ |
| 3758 | -c "client hello, adding renegotiation extension" \ |
| 3759 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3760 | -s "found renegotiation extension" \ |
| 3761 | -s "server hello, secure renegotiation extension" \ |
| 3762 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3763 | -c "=> renegotiate" \ |
| 3764 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3765 | -S "write hello request" |
| 3766 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3767 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3768 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3769 | "$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] | 3770 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3771 | 0 \ |
| 3772 | -c "client hello, adding renegotiation extension" \ |
| 3773 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3774 | -s "found renegotiation extension" \ |
| 3775 | -s "server hello, secure renegotiation extension" \ |
| 3776 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3777 | -c "=> renegotiate" \ |
| 3778 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3779 | -s "write hello request" |
| 3780 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3781 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3782 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3783 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3784 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3785 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3786 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3787 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3788 | 0 \ |
| 3789 | -c "client hello, adding renegotiation extension" \ |
| 3790 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3791 | -s "found renegotiation extension" \ |
| 3792 | -s "server hello, secure renegotiation extension" \ |
| 3793 | -c "found renegotiation extension" \ |
| 3794 | -c "=> renegotiate" \ |
| 3795 | -s "=> renegotiate" \ |
| 3796 | -S "write hello request" \ |
| 3797 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3798 | |
| 3799 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3800 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3801 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3802 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3803 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3804 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3805 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3806 | 0 \ |
| 3807 | -c "client hello, adding renegotiation extension" \ |
| 3808 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3809 | -s "found renegotiation extension" \ |
| 3810 | -s "server hello, secure renegotiation extension" \ |
| 3811 | -c "found renegotiation extension" \ |
| 3812 | -c "=> renegotiate" \ |
| 3813 | -s "=> renegotiate" \ |
| 3814 | -s "write hello request" \ |
| 3815 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3816 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3817 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3818 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3819 | "$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] | 3820 | "$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] | 3821 | 0 \ |
| 3822 | -c "client hello, adding renegotiation extension" \ |
| 3823 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3824 | -s "found renegotiation extension" \ |
| 3825 | -s "server hello, secure renegotiation extension" \ |
| 3826 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3827 | -c "=> renegotiate" \ |
| 3828 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3829 | -s "write hello request" |
| 3830 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3831 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3832 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3833 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3834 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3835 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3836 | "$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" \ |
| 3837 | 0 \ |
| 3838 | -c "Maximum input fragment length is 2048" \ |
| 3839 | -c "Maximum output fragment length is 2048" \ |
| 3840 | -s "Maximum input fragment length is 2048" \ |
| 3841 | -s "Maximum output fragment length is 512" \ |
| 3842 | -c "client hello, adding max_fragment_length extension" \ |
| 3843 | -s "found max fragment length extension" \ |
| 3844 | -s "server hello, max_fragment_length extension" \ |
| 3845 | -c "found max_fragment_length extension" \ |
| 3846 | -c "client hello, adding renegotiation extension" \ |
| 3847 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3848 | -s "found renegotiation extension" \ |
| 3849 | -s "server hello, secure renegotiation extension" \ |
| 3850 | -c "found renegotiation extension" \ |
| 3851 | -c "=> renegotiate" \ |
| 3852 | -s "=> renegotiate" \ |
| 3853 | -s "write hello request" |
| 3854 | |
| 3855 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3856 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3857 | "$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] | 3858 | "$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] | 3859 | 1 \ |
| 3860 | -c "client hello, adding renegotiation extension" \ |
| 3861 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3862 | -S "found renegotiation extension" \ |
| 3863 | -s "server hello, secure renegotiation extension" \ |
| 3864 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3865 | -c "=> renegotiate" \ |
| 3866 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3867 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3868 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3869 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3870 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3871 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3872 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3873 | "$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] | 3874 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3875 | 0 \ |
| 3876 | -C "client hello, adding renegotiation extension" \ |
| 3877 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3878 | -S "found renegotiation extension" \ |
| 3879 | -s "server hello, secure renegotiation extension" \ |
| 3880 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3881 | -C "=> renegotiate" \ |
| 3882 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3883 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3884 | -S "SSL - An unexpected message was received from our peer" \ |
| 3885 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3886 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3887 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3888 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3889 | "$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] | 3890 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3891 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3892 | 0 \ |
| 3893 | -C "client hello, adding renegotiation extension" \ |
| 3894 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3895 | -S "found renegotiation extension" \ |
| 3896 | -s "server hello, secure renegotiation extension" \ |
| 3897 | -c "found renegotiation extension" \ |
| 3898 | -C "=> renegotiate" \ |
| 3899 | -S "=> renegotiate" \ |
| 3900 | -s "write hello request" \ |
| 3901 | -S "SSL - An unexpected message was received from our peer" \ |
| 3902 | -S "failed" |
| 3903 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3904 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3905 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3906 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3907 | "$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] | 3908 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3909 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3910 | 0 \ |
| 3911 | -C "client hello, adding renegotiation extension" \ |
| 3912 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3913 | -S "found renegotiation extension" \ |
| 3914 | -s "server hello, secure renegotiation extension" \ |
| 3915 | -c "found renegotiation extension" \ |
| 3916 | -C "=> renegotiate" \ |
| 3917 | -S "=> renegotiate" \ |
| 3918 | -s "write hello request" \ |
| 3919 | -S "SSL - An unexpected message was received from our peer" \ |
| 3920 | -S "failed" |
| 3921 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3922 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3923 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3924 | "$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] | 3925 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3926 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3927 | 0 \ |
| 3928 | -C "client hello, adding renegotiation extension" \ |
| 3929 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3930 | -S "found renegotiation extension" \ |
| 3931 | -s "server hello, secure renegotiation extension" \ |
| 3932 | -c "found renegotiation extension" \ |
| 3933 | -C "=> renegotiate" \ |
| 3934 | -S "=> renegotiate" \ |
| 3935 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3936 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3937 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3938 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3939 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3940 | "$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] | 3941 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3942 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3943 | 0 \ |
| 3944 | -c "client hello, adding renegotiation extension" \ |
| 3945 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3946 | -s "found renegotiation extension" \ |
| 3947 | -s "server hello, secure renegotiation extension" \ |
| 3948 | -c "found renegotiation extension" \ |
| 3949 | -c "=> renegotiate" \ |
| 3950 | -s "=> renegotiate" \ |
| 3951 | -s "write hello request" \ |
| 3952 | -S "SSL - An unexpected message was received from our peer" \ |
| 3953 | -S "failed" |
| 3954 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3955 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3956 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3957 | "$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] | 3958 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3959 | 0 \ |
| 3960 | -C "client hello, adding renegotiation extension" \ |
| 3961 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3962 | -S "found renegotiation extension" \ |
| 3963 | -s "server hello, secure renegotiation extension" \ |
| 3964 | -c "found renegotiation extension" \ |
| 3965 | -S "record counter limit reached: renegotiate" \ |
| 3966 | -C "=> renegotiate" \ |
| 3967 | -S "=> renegotiate" \ |
| 3968 | -S "write hello request" \ |
| 3969 | -S "SSL - An unexpected message was received from our peer" \ |
| 3970 | -S "failed" |
| 3971 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3972 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3973 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3974 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3975 | "$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] | 3976 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3977 | 0 \ |
| 3978 | -c "client hello, adding renegotiation extension" \ |
| 3979 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3980 | -s "found renegotiation extension" \ |
| 3981 | -s "server hello, secure renegotiation extension" \ |
| 3982 | -c "found renegotiation extension" \ |
| 3983 | -s "record counter limit reached: renegotiate" \ |
| 3984 | -c "=> renegotiate" \ |
| 3985 | -s "=> renegotiate" \ |
| 3986 | -s "write hello request" \ |
| 3987 | -S "SSL - An unexpected message was received from our peer" \ |
| 3988 | -S "failed" |
| 3989 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3990 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3991 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3992 | "$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] | 3993 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3994 | 0 \ |
| 3995 | -c "client hello, adding renegotiation extension" \ |
| 3996 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3997 | -s "found renegotiation extension" \ |
| 3998 | -s "server hello, secure renegotiation extension" \ |
| 3999 | -c "found renegotiation extension" \ |
| 4000 | -s "record counter limit reached: renegotiate" \ |
| 4001 | -c "=> renegotiate" \ |
| 4002 | -s "=> renegotiate" \ |
| 4003 | -s "write hello request" \ |
| 4004 | -S "SSL - An unexpected message was received from our peer" \ |
| 4005 | -S "failed" |
| 4006 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4007 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4008 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4009 | "$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] | 4010 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4011 | 0 \ |
| 4012 | -C "client hello, adding renegotiation extension" \ |
| 4013 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4014 | -S "found renegotiation extension" \ |
| 4015 | -s "server hello, secure renegotiation extension" \ |
| 4016 | -c "found renegotiation extension" \ |
| 4017 | -S "record counter limit reached: renegotiate" \ |
| 4018 | -C "=> renegotiate" \ |
| 4019 | -S "=> renegotiate" \ |
| 4020 | -S "write hello request" \ |
| 4021 | -S "SSL - An unexpected message was received from our peer" \ |
| 4022 | -S "failed" |
| 4023 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4024 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4025 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4026 | "$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] | 4027 | "$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] | 4028 | 0 \ |
| 4029 | -c "client hello, adding renegotiation extension" \ |
| 4030 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4031 | -s "found renegotiation extension" \ |
| 4032 | -s "server hello, secure renegotiation extension" \ |
| 4033 | -c "found renegotiation extension" \ |
| 4034 | -c "=> renegotiate" \ |
| 4035 | -s "=> renegotiate" \ |
| 4036 | -S "write hello request" |
| 4037 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4038 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4039 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4040 | "$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] | 4041 | "$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] | 4042 | 0 \ |
| 4043 | -c "client hello, adding renegotiation extension" \ |
| 4044 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4045 | -s "found renegotiation extension" \ |
| 4046 | -s "server hello, secure renegotiation extension" \ |
| 4047 | -c "found renegotiation extension" \ |
| 4048 | -c "=> renegotiate" \ |
| 4049 | -s "=> renegotiate" \ |
| 4050 | -s "write hello request" |
| 4051 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4052 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4053 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4054 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4055 | "$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] | 4056 | 0 \ |
| 4057 | -c "client hello, adding renegotiation extension" \ |
| 4058 | -c "found renegotiation extension" \ |
| 4059 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4060 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4061 | -C "error" \ |
| 4062 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4063 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4064 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4065 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4066 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 4067 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4068 | "$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] | 4069 | 0 \ |
| 4070 | -c "client hello, adding renegotiation extension" \ |
| 4071 | -c "found renegotiation extension" \ |
| 4072 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4073 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4074 | -C "error" \ |
| 4075 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4076 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4077 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4078 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4079 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 4080 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4081 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4082 | 1 \ |
| 4083 | -c "client hello, adding renegotiation extension" \ |
| 4084 | -C "found renegotiation extension" \ |
| 4085 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4086 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4087 | -c "error" \ |
| 4088 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4089 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4090 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4091 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4092 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 4093 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4094 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4095 | allow_legacy=0" \ |
| 4096 | 1 \ |
| 4097 | -c "client hello, adding renegotiation extension" \ |
| 4098 | -C "found renegotiation extension" \ |
| 4099 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4100 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4101 | -c "error" \ |
| 4102 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4103 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4104 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4105 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4106 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 4107 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4108 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4109 | allow_legacy=1" \ |
| 4110 | 0 \ |
| 4111 | -c "client hello, adding renegotiation extension" \ |
| 4112 | -C "found renegotiation extension" \ |
| 4113 | -c "=> renegotiate" \ |
| 4114 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4115 | -C "error" \ |
| 4116 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4117 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4118 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4119 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4120 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4121 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4122 | 0 \ |
| 4123 | -c "client hello, adding renegotiation extension" \ |
| 4124 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4125 | -s "found renegotiation extension" \ |
| 4126 | -s "server hello, secure renegotiation extension" \ |
| 4127 | -c "found renegotiation extension" \ |
| 4128 | -c "=> renegotiate" \ |
| 4129 | -s "=> renegotiate" \ |
| 4130 | -S "write hello request" |
| 4131 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4132 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4133 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4134 | "$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] | 4135 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4136 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4137 | 0 \ |
| 4138 | -c "client hello, adding renegotiation extension" \ |
| 4139 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4140 | -s "found renegotiation extension" \ |
| 4141 | -s "server hello, secure renegotiation extension" \ |
| 4142 | -c "found renegotiation extension" \ |
| 4143 | -c "=> renegotiate" \ |
| 4144 | -s "=> renegotiate" \ |
| 4145 | -s "write hello request" |
| 4146 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4147 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4148 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4149 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4150 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4151 | 0 \ |
| 4152 | -c "client hello, adding renegotiation extension" \ |
| 4153 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4154 | -s "found renegotiation extension" \ |
| 4155 | -s "server hello, secure renegotiation extension" \ |
| 4156 | -s "record counter limit reached: renegotiate" \ |
| 4157 | -c "=> renegotiate" \ |
| 4158 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4159 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4160 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4161 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4162 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4163 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4164 | "$G_SRV -u --mtu 4096" \ |
| 4165 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4166 | 0 \ |
| 4167 | -c "client hello, adding renegotiation extension" \ |
| 4168 | -c "found renegotiation extension" \ |
| 4169 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4170 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4171 | -C "error" \ |
| 4172 | -s "Extra-header:" |
| 4173 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4174 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4175 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4176 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4177 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4178 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4179 | "$P_CLI debug_level=3" \ |
| 4180 | 0 \ |
| 4181 | -c "found renegotiation extension" \ |
| 4182 | -C "error" \ |
| 4183 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4184 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4185 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4186 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4187 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4188 | "$P_CLI debug_level=3" \ |
| 4189 | 0 \ |
| 4190 | -C "found renegotiation extension" \ |
| 4191 | -C "error" \ |
| 4192 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4193 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4194 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4195 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4196 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4197 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4198 | 1 \ |
| 4199 | -C "found renegotiation extension" \ |
| 4200 | -c "error" \ |
| 4201 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4202 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4203 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4204 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4205 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4206 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4207 | 0 \ |
| 4208 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4209 | -s "server hello, secure renegotiation extension" |
| 4210 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4211 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4212 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4213 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4214 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4215 | 0 \ |
| 4216 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4217 | -S "server hello, secure renegotiation extension" |
| 4218 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4219 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4220 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4221 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4222 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4223 | 1 \ |
| 4224 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4225 | -S "server hello, secure renegotiation extension" |
| 4226 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4227 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4228 | |
| 4229 | requires_gnutls |
| 4230 | run_test "DER format: no trailing bytes" \ |
| 4231 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4232 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4233 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4234 | 0 \ |
| 4235 | -c "Handshake was completed" \ |
| 4236 | |
| 4237 | requires_gnutls |
| 4238 | run_test "DER format: with a trailing zero byte" \ |
| 4239 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4240 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4241 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4242 | 0 \ |
| 4243 | -c "Handshake was completed" \ |
| 4244 | |
| 4245 | requires_gnutls |
| 4246 | run_test "DER format: with a trailing random byte" \ |
| 4247 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4248 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4249 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4250 | 0 \ |
| 4251 | -c "Handshake was completed" \ |
| 4252 | |
| 4253 | requires_gnutls |
| 4254 | run_test "DER format: with 2 trailing random bytes" \ |
| 4255 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4256 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4257 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4258 | 0 \ |
| 4259 | -c "Handshake was completed" \ |
| 4260 | |
| 4261 | requires_gnutls |
| 4262 | run_test "DER format: with 4 trailing random bytes" \ |
| 4263 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4264 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4265 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4266 | 0 \ |
| 4267 | -c "Handshake was completed" \ |
| 4268 | |
| 4269 | requires_gnutls |
| 4270 | run_test "DER format: with 8 trailing random bytes" \ |
| 4271 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4272 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4273 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4274 | 0 \ |
| 4275 | -c "Handshake was completed" \ |
| 4276 | |
| 4277 | requires_gnutls |
| 4278 | run_test "DER format: with 9 trailing random bytes" \ |
| 4279 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4280 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4281 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4282 | 0 \ |
| 4283 | -c "Handshake was completed" \ |
| 4284 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4285 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4286 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4287 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4288 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4289 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4290 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4291 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4292 | 1 \ |
| 4293 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4294 | -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] | 4295 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4296 | -c "X509 - Certificate verification failed" |
| 4297 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4298 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4299 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4300 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4301 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4302 | 0 \ |
| 4303 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4304 | -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] | 4305 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4306 | -C "X509 - Certificate verification failed" |
| 4307 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4308 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4309 | "$P_SRV" \ |
| 4310 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4311 | 0 \ |
| 4312 | -c "x509_verify_cert() returned" \ |
| 4313 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4314 | -c "! Certificate verification flags"\ |
| 4315 | -C "! mbedtls_ssl_handshake returned" \ |
| 4316 | -C "X509 - Certificate verification failed" \ |
| 4317 | -C "SSL - No CA Chain is set, but required to operate" |
| 4318 | |
| 4319 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4320 | "$P_SRV" \ |
| 4321 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4322 | 1 \ |
| 4323 | -c "x509_verify_cert() returned" \ |
| 4324 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4325 | -c "! Certificate verification flags"\ |
| 4326 | -c "! mbedtls_ssl_handshake returned" \ |
| 4327 | -c "SSL - No CA Chain is set, but required to operate" |
| 4328 | |
| 4329 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4330 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4331 | # the client informs the server about the supported curves - it does, though, in the |
| 4332 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4333 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4334 | # different means to have the server ignoring the client's supported curve list. |
| 4335 | |
| 4336 | requires_config_enabled MBEDTLS_ECP_C |
| 4337 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4338 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4339 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4340 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4341 | 1 \ |
| 4342 | -c "bad certificate (EC key curve)"\ |
| 4343 | -c "! Certificate verification flags"\ |
| 4344 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4345 | |
| 4346 | requires_config_enabled MBEDTLS_ECP_C |
| 4347 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4348 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4349 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4350 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4351 | 1 \ |
| 4352 | -c "bad certificate (EC key curve)"\ |
| 4353 | -c "! Certificate verification flags"\ |
| 4354 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4355 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4356 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4357 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4358 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4359 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4360 | 0 \ |
| 4361 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4362 | -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] | 4363 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4364 | -C "X509 - Certificate verification failed" |
| 4365 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4366 | run_test "Authentication: client SHA256, server required" \ |
| 4367 | "$P_SRV auth_mode=required" \ |
| 4368 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4369 | key_file=data_files/server6.key \ |
| 4370 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4371 | 0 \ |
| 4372 | -c "Supported Signature Algorithm found: 4," \ |
| 4373 | -c "Supported Signature Algorithm found: 5," |
| 4374 | |
| 4375 | run_test "Authentication: client SHA384, server required" \ |
| 4376 | "$P_SRV auth_mode=required" \ |
| 4377 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4378 | key_file=data_files/server6.key \ |
| 4379 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4380 | 0 \ |
| 4381 | -c "Supported Signature Algorithm found: 4," \ |
| 4382 | -c "Supported Signature Algorithm found: 5," |
| 4383 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4384 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4385 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4386 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4387 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4388 | key_file=data_files/server5.key" \ |
| 4389 | 1 \ |
| 4390 | -S "skip write certificate request" \ |
| 4391 | -C "skip parse certificate request" \ |
| 4392 | -c "got a certificate request" \ |
| 4393 | -c "got no certificate to send" \ |
| 4394 | -S "x509_verify_cert() returned" \ |
| 4395 | -s "client has no certificate" \ |
| 4396 | -s "! mbedtls_ssl_handshake returned" \ |
| 4397 | -c "! mbedtls_ssl_handshake returned" \ |
| 4398 | -s "No client certification received from the client, but required by the authentication mode" |
| 4399 | |
| 4400 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4401 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4402 | "$P_CLI debug_level=3 crt_file=none \ |
| 4403 | key_file=data_files/server5.key" \ |
| 4404 | 1 \ |
| 4405 | -S "skip write certificate request" \ |
| 4406 | -C "skip parse certificate request" \ |
| 4407 | -c "got a certificate request" \ |
| 4408 | -c "= write certificate$" \ |
| 4409 | -C "skip write certificate$" \ |
| 4410 | -S "x509_verify_cert() returned" \ |
| 4411 | -s "client has no certificate" \ |
| 4412 | -s "! mbedtls_ssl_handshake returned" \ |
| 4413 | -c "! mbedtls_ssl_handshake returned" \ |
| 4414 | -s "No client certification received from the client, but required by the authentication mode" |
| 4415 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4416 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4417 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4418 | "$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] | 4419 | key_file=data_files/server5.key" \ |
| 4420 | 1 \ |
| 4421 | -S "skip write certificate request" \ |
| 4422 | -C "skip parse certificate request" \ |
| 4423 | -c "got a certificate request" \ |
| 4424 | -C "skip write certificate" \ |
| 4425 | -C "skip write certificate verify" \ |
| 4426 | -S "skip parse certificate verify" \ |
| 4427 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4428 | -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] | 4429 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4430 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4431 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4432 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4433 | # We don't check that the client receives the alert because it might |
| 4434 | # detect that its write end of the connection is closed and abort |
| 4435 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4436 | |
Gilles Peskine | 8c681b7 | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4437 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4438 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4439 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4440 | key_file=data_files/server5.key" \ |
| 4441 | 0 \ |
| 4442 | -S "skip write certificate request" \ |
| 4443 | -C "skip parse certificate request" \ |
| 4444 | -c "got a certificate request" \ |
| 4445 | -C "skip write certificate" \ |
| 4446 | -C "skip write certificate verify" \ |
| 4447 | -S "skip parse certificate verify" \ |
| 4448 | -S "x509_verify_cert() returned" \ |
| 4449 | -S "! The certificate is not correctly signed" \ |
| 4450 | -S "X509 - Certificate verification failed" |
| 4451 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4452 | run_test "Authentication: client cert not trusted, server required" \ |
| 4453 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4454 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4455 | key_file=data_files/server5.key" \ |
| 4456 | 1 \ |
| 4457 | -S "skip write certificate request" \ |
| 4458 | -C "skip parse certificate request" \ |
| 4459 | -c "got a certificate request" \ |
| 4460 | -C "skip write certificate" \ |
| 4461 | -C "skip write certificate verify" \ |
| 4462 | -S "skip parse certificate verify" \ |
| 4463 | -s "x509_verify_cert() returned" \ |
| 4464 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4465 | -s "! mbedtls_ssl_handshake returned" \ |
| 4466 | -c "! mbedtls_ssl_handshake returned" \ |
| 4467 | -s "X509 - Certificate verification failed" |
| 4468 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4469 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4470 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4471 | "$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] | 4472 | key_file=data_files/server5.key" \ |
| 4473 | 0 \ |
| 4474 | -S "skip write certificate request" \ |
| 4475 | -C "skip parse certificate request" \ |
| 4476 | -c "got a certificate request" \ |
| 4477 | -C "skip write certificate" \ |
| 4478 | -C "skip write certificate verify" \ |
| 4479 | -S "skip parse certificate verify" \ |
| 4480 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4481 | -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] | 4482 | -S "! mbedtls_ssl_handshake returned" \ |
| 4483 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4484 | -S "X509 - Certificate verification failed" |
| 4485 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4486 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4487 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4488 | "$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] | 4489 | key_file=data_files/server5.key" \ |
| 4490 | 0 \ |
| 4491 | -s "skip write certificate request" \ |
| 4492 | -C "skip parse certificate request" \ |
| 4493 | -c "got no certificate request" \ |
| 4494 | -c "skip write certificate" \ |
| 4495 | -c "skip write certificate verify" \ |
| 4496 | -s "skip parse certificate verify" \ |
| 4497 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4498 | -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] | 4499 | -S "! mbedtls_ssl_handshake returned" \ |
| 4500 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4501 | -S "X509 - Certificate verification failed" |
| 4502 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4503 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4504 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4505 | "$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] | 4506 | 0 \ |
| 4507 | -S "skip write certificate request" \ |
| 4508 | -C "skip parse certificate request" \ |
| 4509 | -c "got a certificate request" \ |
| 4510 | -C "skip write certificate$" \ |
| 4511 | -C "got no certificate to send" \ |
| 4512 | -S "SSLv3 client has no certificate" \ |
| 4513 | -c "skip write certificate verify" \ |
| 4514 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4515 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4516 | -S "! mbedtls_ssl_handshake returned" \ |
| 4517 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4518 | -S "X509 - Certificate verification failed" |
| 4519 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4520 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4521 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4522 | "$O_CLI" \ |
| 4523 | 0 \ |
| 4524 | -S "skip write certificate request" \ |
| 4525 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4526 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4527 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4528 | -S "X509 - Certificate verification failed" |
| 4529 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4530 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4531 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4532 | "$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] | 4533 | 0 \ |
| 4534 | -C "skip parse certificate request" \ |
| 4535 | -c "got a certificate request" \ |
| 4536 | -C "skip write certificate$" \ |
| 4537 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4538 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4539 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4540 | run_test "Authentication: client no cert, openssl server required" \ |
| 4541 | "$O_SRV -Verify 10" \ |
| 4542 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4543 | 1 \ |
| 4544 | -C "skip parse certificate request" \ |
| 4545 | -c "got a certificate request" \ |
| 4546 | -C "skip write certificate$" \ |
| 4547 | -c "skip write certificate verify" \ |
| 4548 | -c "! mbedtls_ssl_handshake returned" |
| 4549 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4550 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4551 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4552 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4553 | "$P_CLI debug_level=3 crt_file=none key_file=none min_version=ssl3" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4554 | 0 \ |
| 4555 | -S "skip write certificate request" \ |
| 4556 | -C "skip parse certificate request" \ |
| 4557 | -c "got a certificate request" \ |
| 4558 | -C "skip write certificate$" \ |
| 4559 | -c "skip write certificate verify" \ |
| 4560 | -c "got no certificate to send" \ |
| 4561 | -s "SSLv3 client has no certificate" \ |
| 4562 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4563 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4564 | -S "! mbedtls_ssl_handshake returned" \ |
| 4565 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4566 | -S "X509 - Certificate verification failed" |
| 4567 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4568 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4569 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4570 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4571 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4572 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4573 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4574 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4575 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4576 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4577 | # are in place so that the semantics are consistent with the test description. |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4578 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4579 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4580 | run_test "Authentication: server max_int chain, client default" \ |
| 4581 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4582 | key_file=data_files/dir-maxpath/09.key" \ |
| 4583 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4584 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4585 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4586 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4587 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4588 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4589 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4590 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4591 | key_file=data_files/dir-maxpath/10.key" \ |
| 4592 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4593 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4594 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4595 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4596 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4597 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4598 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4599 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4600 | key_file=data_files/dir-maxpath/10.key" \ |
| 4601 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4602 | auth_mode=optional" \ |
| 4603 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4604 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4605 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4606 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4607 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4608 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4609 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4610 | key_file=data_files/dir-maxpath/10.key" \ |
| 4611 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4612 | auth_mode=none" \ |
| 4613 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4614 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4615 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4616 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4617 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4618 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4619 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4620 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4621 | key_file=data_files/dir-maxpath/10.key" \ |
| 4622 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4623 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4624 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4625 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4626 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4627 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4628 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4629 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4630 | key_file=data_files/dir-maxpath/10.key" \ |
| 4631 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4632 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4633 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4634 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4635 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4636 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4637 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4638 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4639 | key_file=data_files/dir-maxpath/10.key" \ |
| 4640 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4641 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4642 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4643 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4644 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4645 | run_test "Authentication: client max_int chain, server required" \ |
| 4646 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4647 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4648 | key_file=data_files/dir-maxpath/09.key" \ |
| 4649 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4650 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4651 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4652 | # Tests for CA list in CertificateRequest messages |
| 4653 | |
| 4654 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4655 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4656 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4657 | key_file=data_files/server6.key" \ |
| 4658 | 0 \ |
| 4659 | -s "requested DN" |
| 4660 | |
| 4661 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4662 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4663 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4664 | key_file=data_files/server6.key" \ |
| 4665 | 0 \ |
| 4666 | -S "requested DN" |
| 4667 | |
| 4668 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4669 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4670 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4671 | key_file=data_files/server5.key" \ |
| 4672 | 1 \ |
| 4673 | -S "requested DN" \ |
| 4674 | -s "x509_verify_cert() returned" \ |
| 4675 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4676 | -s "! mbedtls_ssl_handshake returned" \ |
| 4677 | -c "! mbedtls_ssl_handshake returned" \ |
| 4678 | -s "X509 - Certificate verification failed" |
| 4679 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4680 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4681 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4682 | |
| 4683 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4684 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4685 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4686 | key_file=data_files/server5.key" \ |
| 4687 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4688 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4689 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4690 | -c "x509_verify_cert() returned" \ |
| 4691 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4692 | -c "! mbedtls_ssl_handshake returned" \ |
| 4693 | -c "X509 - Certificate verification failed" |
| 4694 | |
| 4695 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4696 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4697 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4698 | key_file=data_files/server5.key" \ |
| 4699 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4700 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4701 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4702 | -c "x509_verify_cert() returned" \ |
| 4703 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4704 | -C "! mbedtls_ssl_handshake returned" \ |
| 4705 | -C "X509 - Certificate verification failed" |
| 4706 | |
| 4707 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4708 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4709 | # the client informs the server about the supported curves - it does, though, in the |
| 4710 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4711 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4712 | # different means to have the server ignoring the client's supported curve list. |
| 4713 | |
| 4714 | requires_config_enabled MBEDTLS_ECP_C |
| 4715 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4716 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4717 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4718 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4719 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4720 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4721 | -c "use CA callback for X.509 CRT verification" \ |
| 4722 | -c "bad certificate (EC key curve)" \ |
| 4723 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4724 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4725 | |
| 4726 | requires_config_enabled MBEDTLS_ECP_C |
| 4727 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4728 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4729 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4730 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4731 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4732 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4733 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4734 | -c "bad certificate (EC key curve)"\ |
| 4735 | -c "! Certificate verification flags"\ |
| 4736 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4737 | |
| 4738 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4739 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4740 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4741 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4742 | key_file=data_files/server6.key \ |
| 4743 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4744 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4745 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4746 | -c "Supported Signature Algorithm found: 4," \ |
| 4747 | -c "Supported Signature Algorithm found: 5," |
| 4748 | |
| 4749 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4750 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4751 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4752 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4753 | key_file=data_files/server6.key \ |
| 4754 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4755 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4756 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4757 | -c "Supported Signature Algorithm found: 4," \ |
| 4758 | -c "Supported Signature Algorithm found: 5," |
| 4759 | |
| 4760 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4761 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4762 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4763 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4764 | key_file=data_files/server5.key" \ |
| 4765 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4766 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4767 | -S "skip write certificate request" \ |
| 4768 | -C "skip parse certificate request" \ |
| 4769 | -c "got a certificate request" \ |
| 4770 | -C "skip write certificate" \ |
| 4771 | -C "skip write certificate verify" \ |
| 4772 | -S "skip parse certificate verify" \ |
| 4773 | -s "x509_verify_cert() returned" \ |
| 4774 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4775 | -s "! mbedtls_ssl_handshake returned" \ |
| 4776 | -s "send alert level=2 message=48" \ |
| 4777 | -c "! mbedtls_ssl_handshake returned" \ |
| 4778 | -s "X509 - Certificate verification failed" |
| 4779 | # We don't check that the client receives the alert because it might |
| 4780 | # detect that its write end of the connection is closed and abort |
| 4781 | # before reading the alert message. |
| 4782 | |
| 4783 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4784 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4785 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4786 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4787 | key_file=data_files/server5.key" \ |
| 4788 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4789 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4790 | -S "skip write certificate request" \ |
| 4791 | -C "skip parse certificate request" \ |
| 4792 | -c "got a certificate request" \ |
| 4793 | -C "skip write certificate" \ |
| 4794 | -C "skip write certificate verify" \ |
| 4795 | -S "skip parse certificate verify" \ |
| 4796 | -s "x509_verify_cert() returned" \ |
| 4797 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4798 | -s "! mbedtls_ssl_handshake returned" \ |
| 4799 | -c "! mbedtls_ssl_handshake returned" \ |
| 4800 | -s "X509 - Certificate verification failed" |
| 4801 | |
| 4802 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4803 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4804 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4805 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4806 | key_file=data_files/server5.key" \ |
| 4807 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4808 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4809 | -S "skip write certificate request" \ |
| 4810 | -C "skip parse certificate request" \ |
| 4811 | -c "got a certificate request" \ |
| 4812 | -C "skip write certificate" \ |
| 4813 | -C "skip write certificate verify" \ |
| 4814 | -S "skip parse certificate verify" \ |
| 4815 | -s "x509_verify_cert() returned" \ |
| 4816 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4817 | -S "! mbedtls_ssl_handshake returned" \ |
| 4818 | -C "! mbedtls_ssl_handshake returned" \ |
| 4819 | -S "X509 - Certificate verification failed" |
| 4820 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4821 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4822 | requires_full_size_output_buffer |
| 4823 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4824 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4825 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4826 | key_file=data_files/dir-maxpath/09.key" \ |
| 4827 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4828 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4829 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4830 | -C "X509 - A fatal error occurred" |
| 4831 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4832 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4833 | requires_full_size_output_buffer |
| 4834 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4835 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4836 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4837 | key_file=data_files/dir-maxpath/10.key" \ |
| 4838 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4839 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4840 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4841 | -c "X509 - A fatal error occurred" |
| 4842 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4843 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4844 | requires_full_size_output_buffer |
| 4845 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4846 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4847 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4848 | key_file=data_files/dir-maxpath/10.key" \ |
| 4849 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4850 | debug_level=3 auth_mode=optional" \ |
| 4851 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4852 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4853 | -c "X509 - A fatal error occurred" |
| 4854 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4855 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4856 | requires_full_size_output_buffer |
| 4857 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4858 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4859 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4860 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4861 | key_file=data_files/dir-maxpath/10.key" \ |
| 4862 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4863 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4864 | -s "X509 - A fatal error occurred" |
| 4865 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4866 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4867 | requires_full_size_output_buffer |
| 4868 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4869 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4870 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4871 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4872 | key_file=data_files/dir-maxpath/10.key" \ |
| 4873 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4874 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4875 | -s "X509 - A fatal error occurred" |
| 4876 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4877 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4878 | requires_full_size_output_buffer |
| 4879 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4880 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4881 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4882 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4883 | key_file=data_files/dir-maxpath/09.key" \ |
| 4884 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4885 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4886 | -S "X509 - A fatal error occurred" |
| 4887 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4888 | # Tests for certificate selection based on SHA verson |
| 4889 | |
| 4890 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4891 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4892 | key_file=data_files/server5.key \ |
| 4893 | crt_file2=data_files/server5-sha1.crt \ |
| 4894 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 4895 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4896 | 0 \ |
| 4897 | -c "signed using.*ECDSA with SHA256" \ |
| 4898 | -C "signed using.*ECDSA with SHA1" |
| 4899 | |
| 4900 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4901 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4902 | key_file=data_files/server5.key \ |
| 4903 | crt_file2=data_files/server5-sha1.crt \ |
| 4904 | key_file2=data_files/server5.key" \ |
| 4905 | "$P_CLI force_version=tls1_1" \ |
| 4906 | 0 \ |
| 4907 | -C "signed using.*ECDSA with SHA256" \ |
| 4908 | -c "signed using.*ECDSA with SHA1" |
| 4909 | |
| 4910 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4911 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4912 | key_file=data_files/server5.key \ |
| 4913 | crt_file2=data_files/server5-sha1.crt \ |
| 4914 | key_file2=data_files/server5.key" \ |
| 4915 | "$P_CLI force_version=tls1" \ |
| 4916 | 0 \ |
| 4917 | -C "signed using.*ECDSA with SHA256" \ |
| 4918 | -c "signed using.*ECDSA with SHA1" |
| 4919 | |
| 4920 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4921 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4922 | key_file=data_files/server5.key \ |
| 4923 | crt_file2=data_files/server6.crt \ |
| 4924 | key_file2=data_files/server6.key" \ |
| 4925 | "$P_CLI force_version=tls1_1" \ |
| 4926 | 0 \ |
| 4927 | -c "serial number.*09" \ |
| 4928 | -c "signed using.*ECDSA with SHA256" \ |
| 4929 | -C "signed using.*ECDSA with SHA1" |
| 4930 | |
| 4931 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4932 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4933 | key_file=data_files/server6.key \ |
| 4934 | crt_file2=data_files/server5.crt \ |
| 4935 | key_file2=data_files/server5.key" \ |
| 4936 | "$P_CLI force_version=tls1_1" \ |
| 4937 | 0 \ |
| 4938 | -c "serial number.*0A" \ |
| 4939 | -c "signed using.*ECDSA with SHA256" \ |
| 4940 | -C "signed using.*ECDSA with SHA1" |
| 4941 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4942 | # tests for SNI |
| 4943 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4944 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4945 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4946 | 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] | 4947 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4948 | 0 \ |
| 4949 | -S "parse ServerName extension" \ |
| 4950 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4951 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4952 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4953 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4954 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4955 | 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] | 4956 | 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] | 4957 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4958 | 0 \ |
| 4959 | -s "parse ServerName extension" \ |
| 4960 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4961 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4962 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4963 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4964 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4965 | 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] | 4966 | 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] | 4967 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4968 | 0 \ |
| 4969 | -s "parse ServerName extension" \ |
| 4970 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4971 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4972 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4973 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4974 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4975 | 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] | 4976 | 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] | 4977 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4978 | 1 \ |
| 4979 | -s "parse ServerName extension" \ |
| 4980 | -s "ssl_sni_wrapper() returned" \ |
| 4981 | -s "mbedtls_ssl_handshake returned" \ |
| 4982 | -c "mbedtls_ssl_handshake returned" \ |
| 4983 | -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] | 4984 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4985 | run_test "SNI: client auth no override: optional" \ |
| 4986 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4987 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4988 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4989 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4990 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4991 | -S "skip write certificate request" \ |
| 4992 | -C "skip parse certificate request" \ |
| 4993 | -c "got a certificate request" \ |
| 4994 | -C "skip write certificate" \ |
| 4995 | -C "skip write certificate verify" \ |
| 4996 | -S "skip parse certificate verify" |
| 4997 | |
| 4998 | run_test "SNI: client auth override: none -> optional" \ |
| 4999 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5000 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5001 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5002 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5003 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5004 | -S "skip write certificate request" \ |
| 5005 | -C "skip parse certificate request" \ |
| 5006 | -c "got a certificate request" \ |
| 5007 | -C "skip write certificate" \ |
| 5008 | -C "skip write certificate verify" \ |
| 5009 | -S "skip parse certificate verify" |
| 5010 | |
| 5011 | run_test "SNI: client auth override: optional -> none" \ |
| 5012 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5013 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5014 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5015 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5016 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5017 | -s "skip write certificate request" \ |
| 5018 | -C "skip parse certificate request" \ |
| 5019 | -c "got no certificate request" \ |
| 5020 | -c "skip write certificate" \ |
| 5021 | -c "skip write certificate verify" \ |
| 5022 | -s "skip parse certificate verify" |
| 5023 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5024 | run_test "SNI: CA no override" \ |
| 5025 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5026 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5027 | ca_file=data_files/test-ca.crt \ |
| 5028 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5029 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5030 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5031 | 1 \ |
| 5032 | -S "skip write certificate request" \ |
| 5033 | -C "skip parse certificate request" \ |
| 5034 | -c "got a certificate request" \ |
| 5035 | -C "skip write certificate" \ |
| 5036 | -C "skip write certificate verify" \ |
| 5037 | -S "skip parse certificate verify" \ |
| 5038 | -s "x509_verify_cert() returned" \ |
| 5039 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5040 | -S "The certificate has been revoked (is on a CRL)" |
| 5041 | |
| 5042 | run_test "SNI: CA override" \ |
| 5043 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5044 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5045 | ca_file=data_files/test-ca.crt \ |
| 5046 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5047 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5048 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5049 | 0 \ |
| 5050 | -S "skip write certificate request" \ |
| 5051 | -C "skip parse certificate request" \ |
| 5052 | -c "got a certificate request" \ |
| 5053 | -C "skip write certificate" \ |
| 5054 | -C "skip write certificate verify" \ |
| 5055 | -S "skip parse certificate verify" \ |
| 5056 | -S "x509_verify_cert() returned" \ |
| 5057 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5058 | -S "The certificate has been revoked (is on a CRL)" |
| 5059 | |
| 5060 | run_test "SNI: CA override with CRL" \ |
| 5061 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5062 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5063 | ca_file=data_files/test-ca.crt \ |
| 5064 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5065 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5066 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5067 | 1 \ |
| 5068 | -S "skip write certificate request" \ |
| 5069 | -C "skip parse certificate request" \ |
| 5070 | -c "got a certificate request" \ |
| 5071 | -C "skip write certificate" \ |
| 5072 | -C "skip write certificate verify" \ |
| 5073 | -S "skip parse certificate verify" \ |
| 5074 | -s "x509_verify_cert() returned" \ |
| 5075 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5076 | -s "The certificate has been revoked (is on a CRL)" |
| 5077 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5078 | # Tests for SNI and DTLS |
| 5079 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5080 | run_test "SNI: DTLS, no SNI callback" \ |
| 5081 | "$P_SRV debug_level=3 dtls=1 \ |
| 5082 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5083 | "$P_CLI server_name=localhost dtls=1" \ |
| 5084 | 0 \ |
| 5085 | -S "parse ServerName extension" \ |
| 5086 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5087 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5088 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5089 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5090 | "$P_SRV debug_level=3 dtls=1 \ |
| 5091 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5092 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5093 | "$P_CLI server_name=localhost dtls=1" \ |
| 5094 | 0 \ |
| 5095 | -s "parse ServerName extension" \ |
| 5096 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5097 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5098 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5099 | run_test "SNI: DTLS, matching cert 2" \ |
| 5100 | "$P_SRV debug_level=3 dtls=1 \ |
| 5101 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5102 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5103 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5104 | 0 \ |
| 5105 | -s "parse ServerName extension" \ |
| 5106 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5107 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5108 | |
| 5109 | run_test "SNI: DTLS, no matching cert" \ |
| 5110 | "$P_SRV debug_level=3 dtls=1 \ |
| 5111 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5112 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5113 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5114 | 1 \ |
| 5115 | -s "parse ServerName extension" \ |
| 5116 | -s "ssl_sni_wrapper() returned" \ |
| 5117 | -s "mbedtls_ssl_handshake returned" \ |
| 5118 | -c "mbedtls_ssl_handshake returned" \ |
| 5119 | -c "SSL - A fatal alert message was received from our peer" |
| 5120 | |
| 5121 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5122 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5123 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5124 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5125 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5126 | 0 \ |
| 5127 | -S "skip write certificate request" \ |
| 5128 | -C "skip parse certificate request" \ |
| 5129 | -c "got a certificate request" \ |
| 5130 | -C "skip write certificate" \ |
| 5131 | -C "skip write certificate verify" \ |
| 5132 | -S "skip parse certificate verify" |
| 5133 | |
| 5134 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5135 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5136 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5137 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5138 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5139 | 0 \ |
| 5140 | -S "skip write certificate request" \ |
| 5141 | -C "skip parse certificate request" \ |
| 5142 | -c "got a certificate request" \ |
| 5143 | -C "skip write certificate" \ |
| 5144 | -C "skip write certificate verify" \ |
| 5145 | -S "skip parse certificate verify" |
| 5146 | |
| 5147 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5148 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5149 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5150 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5151 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5152 | 0 \ |
| 5153 | -s "skip write certificate request" \ |
| 5154 | -C "skip parse certificate request" \ |
| 5155 | -c "got no certificate request" \ |
| 5156 | -c "skip write certificate" \ |
| 5157 | -c "skip write certificate verify" \ |
| 5158 | -s "skip parse certificate verify" |
| 5159 | |
| 5160 | run_test "SNI: DTLS, CA no override" \ |
| 5161 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5162 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5163 | ca_file=data_files/test-ca.crt \ |
| 5164 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5165 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5166 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5167 | 1 \ |
| 5168 | -S "skip write certificate request" \ |
| 5169 | -C "skip parse certificate request" \ |
| 5170 | -c "got a certificate request" \ |
| 5171 | -C "skip write certificate" \ |
| 5172 | -C "skip write certificate verify" \ |
| 5173 | -S "skip parse certificate verify" \ |
| 5174 | -s "x509_verify_cert() returned" \ |
| 5175 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5176 | -S "The certificate has been revoked (is on a CRL)" |
| 5177 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5178 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5179 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5180 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5181 | ca_file=data_files/test-ca.crt \ |
| 5182 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5183 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5184 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5185 | 0 \ |
| 5186 | -S "skip write certificate request" \ |
| 5187 | -C "skip parse certificate request" \ |
| 5188 | -c "got a certificate request" \ |
| 5189 | -C "skip write certificate" \ |
| 5190 | -C "skip write certificate verify" \ |
| 5191 | -S "skip parse certificate verify" \ |
| 5192 | -S "x509_verify_cert() returned" \ |
| 5193 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5194 | -S "The certificate has been revoked (is on a CRL)" |
| 5195 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5196 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5197 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5198 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5199 | ca_file=data_files/test-ca.crt \ |
| 5200 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5201 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5202 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5203 | 1 \ |
| 5204 | -S "skip write certificate request" \ |
| 5205 | -C "skip parse certificate request" \ |
| 5206 | -c "got a certificate request" \ |
| 5207 | -C "skip write certificate" \ |
| 5208 | -C "skip write certificate verify" \ |
| 5209 | -S "skip parse certificate verify" \ |
| 5210 | -s "x509_verify_cert() returned" \ |
| 5211 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5212 | -s "The certificate has been revoked (is on a CRL)" |
| 5213 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5214 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5215 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5216 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5217 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5218 | "$P_CLI nbio=2 tickets=0" \ |
| 5219 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5220 | -S "mbedtls_ssl_handshake returned" \ |
| 5221 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5222 | -c "Read from server: .* bytes read" |
| 5223 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5224 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5225 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5226 | "$P_CLI nbio=2 tickets=0" \ |
| 5227 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5228 | -S "mbedtls_ssl_handshake returned" \ |
| 5229 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5230 | -c "Read from server: .* bytes read" |
| 5231 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5232 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5233 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5234 | "$P_CLI nbio=2 tickets=1" \ |
| 5235 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5236 | -S "mbedtls_ssl_handshake returned" \ |
| 5237 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5238 | -c "Read from server: .* bytes read" |
| 5239 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5240 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5241 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5242 | "$P_CLI nbio=2 tickets=1" \ |
| 5243 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5244 | -S "mbedtls_ssl_handshake returned" \ |
| 5245 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5246 | -c "Read from server: .* bytes read" |
| 5247 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5248 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5249 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5250 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5251 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5252 | -S "mbedtls_ssl_handshake returned" \ |
| 5253 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5254 | -c "Read from server: .* bytes read" |
| 5255 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5256 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5257 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5258 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5259 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5260 | -S "mbedtls_ssl_handshake returned" \ |
| 5261 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5262 | -c "Read from server: .* bytes read" |
| 5263 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5264 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5265 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5266 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5267 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5268 | -S "mbedtls_ssl_handshake returned" \ |
| 5269 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5270 | -c "Read from server: .* bytes read" |
| 5271 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5272 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5273 | |
| 5274 | run_test "Event-driven I/O: basic handshake" \ |
| 5275 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5276 | "$P_CLI event=1 tickets=0" \ |
| 5277 | 0 \ |
| 5278 | -S "mbedtls_ssl_handshake returned" \ |
| 5279 | -C "mbedtls_ssl_handshake returned" \ |
| 5280 | -c "Read from server: .* bytes read" |
| 5281 | |
| 5282 | run_test "Event-driven I/O: client auth" \ |
| 5283 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5284 | "$P_CLI event=1 tickets=0" \ |
| 5285 | 0 \ |
| 5286 | -S "mbedtls_ssl_handshake returned" \ |
| 5287 | -C "mbedtls_ssl_handshake returned" \ |
| 5288 | -c "Read from server: .* bytes read" |
| 5289 | |
| 5290 | run_test "Event-driven I/O: ticket" \ |
| 5291 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5292 | "$P_CLI event=1 tickets=1" \ |
| 5293 | 0 \ |
| 5294 | -S "mbedtls_ssl_handshake returned" \ |
| 5295 | -C "mbedtls_ssl_handshake returned" \ |
| 5296 | -c "Read from server: .* bytes read" |
| 5297 | |
| 5298 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5299 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5300 | "$P_CLI event=1 tickets=1" \ |
| 5301 | 0 \ |
| 5302 | -S "mbedtls_ssl_handshake returned" \ |
| 5303 | -C "mbedtls_ssl_handshake returned" \ |
| 5304 | -c "Read from server: .* bytes read" |
| 5305 | |
| 5306 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5307 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5308 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5309 | 0 \ |
| 5310 | -S "mbedtls_ssl_handshake returned" \ |
| 5311 | -C "mbedtls_ssl_handshake returned" \ |
| 5312 | -c "Read from server: .* bytes read" |
| 5313 | |
| 5314 | run_test "Event-driven I/O: ticket + resume" \ |
| 5315 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5316 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5317 | 0 \ |
| 5318 | -S "mbedtls_ssl_handshake returned" \ |
| 5319 | -C "mbedtls_ssl_handshake returned" \ |
| 5320 | -c "Read from server: .* bytes read" |
| 5321 | |
| 5322 | run_test "Event-driven I/O: session-id resume" \ |
| 5323 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5324 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5325 | 0 \ |
| 5326 | -S "mbedtls_ssl_handshake returned" \ |
| 5327 | -C "mbedtls_ssl_handshake returned" \ |
| 5328 | -c "Read from server: .* bytes read" |
| 5329 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5330 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5331 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5332 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5333 | 0 \ |
| 5334 | -c "Read from server: .* bytes read" |
| 5335 | |
| 5336 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5337 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5338 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5339 | 0 \ |
| 5340 | -c "Read from server: .* bytes read" |
| 5341 | |
| 5342 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5343 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5344 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5345 | 0 \ |
| 5346 | -c "Read from server: .* bytes read" |
| 5347 | |
| 5348 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5349 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5350 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5351 | 0 \ |
| 5352 | -c "Read from server: .* bytes read" |
| 5353 | |
| 5354 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5355 | "$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] | 5356 | "$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] | 5357 | 0 \ |
| 5358 | -c "Read from server: .* bytes read" |
| 5359 | |
| 5360 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5361 | "$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] | 5362 | "$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] | 5363 | 0 \ |
| 5364 | -c "Read from server: .* bytes read" |
| 5365 | |
| 5366 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5367 | "$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] | 5368 | "$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] | 5369 | 0 \ |
| 5370 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5371 | |
| 5372 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5373 | # During session resumption, the client will send its ApplicationData record |
| 5374 | # within the same datagram as the Finished messages. In this situation, the |
| 5375 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5376 | # because the ApplicationData request has already been queued internally. |
| 5377 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5378 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5379 | "$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] | 5380 | "$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] | 5381 | 0 \ |
| 5382 | -c "Read from server: .* bytes read" |
| 5383 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5384 | # Tests for version negotiation |
| 5385 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5387 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5388 | "$P_SRV" \ |
| 5389 | "$P_CLI" \ |
| 5390 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5391 | -S "mbedtls_ssl_handshake returned" \ |
| 5392 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5393 | -s "Protocol is TLSv1.2" \ |
| 5394 | -c "Protocol is TLSv1.2" |
| 5395 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5396 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5397 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5398 | "$P_SRV" \ |
| 5399 | "$P_CLI max_version=tls1_1" \ |
| 5400 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5401 | -S "mbedtls_ssl_handshake returned" \ |
| 5402 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5403 | -s "Protocol is TLSv1.1" \ |
| 5404 | -c "Protocol is TLSv1.1" |
| 5405 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5407 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5408 | "$P_SRV max_version=tls1_1" \ |
| 5409 | "$P_CLI" \ |
| 5410 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5411 | -S "mbedtls_ssl_handshake returned" \ |
| 5412 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5413 | -s "Protocol is TLSv1.1" \ |
| 5414 | -c "Protocol is TLSv1.1" |
| 5415 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5417 | run_test "Version check: cli+srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5418 | "$P_SRV max_version=tls1_1" \ |
| 5419 | "$P_CLI max_version=tls1_1" \ |
| 5420 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5421 | -S "mbedtls_ssl_handshake returned" \ |
| 5422 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5423 | -s "Protocol is TLSv1.1" \ |
| 5424 | -c "Protocol is TLSv1.1" |
| 5425 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5427 | run_test "Version check: cli max 1.1, srv min 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5428 | "$P_SRV min_version=tls1_1" \ |
| 5429 | "$P_CLI max_version=tls1_1" \ |
| 5430 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5431 | -S "mbedtls_ssl_handshake returned" \ |
| 5432 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5433 | -s "Protocol is TLSv1.1" \ |
| 5434 | -c "Protocol is TLSv1.1" |
| 5435 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5437 | run_test "Version check: cli min 1.1, srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5438 | "$P_SRV max_version=tls1_1" \ |
| 5439 | "$P_CLI min_version=tls1_1" \ |
| 5440 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5441 | -S "mbedtls_ssl_handshake returned" \ |
| 5442 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5443 | -s "Protocol is TLSv1.1" \ |
| 5444 | -c "Protocol is TLSv1.1" |
| 5445 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5446 | run_test "Version check: cli min 1.2, srv max 1.1 -> fail" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5447 | "$P_SRV max_version=tls1_1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5448 | "$P_CLI min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5449 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5450 | -s "mbedtls_ssl_handshake returned" \ |
| 5451 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5452 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5453 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5454 | run_test "Version check: srv min 1.2, cli max 1.1 -> fail" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5455 | "$P_SRV min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5456 | "$P_CLI max_version=tls1_1" \ |
| 5457 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5458 | -s "mbedtls_ssl_handshake returned" \ |
| 5459 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5460 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5461 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5462 | # Tests for ALPN extension |
| 5463 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5464 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5465 | "$P_SRV debug_level=3" \ |
| 5466 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5467 | 0 \ |
| 5468 | -C "client hello, adding alpn extension" \ |
| 5469 | -S "found alpn extension" \ |
| 5470 | -C "got an alert message, type: \\[2:120]" \ |
| 5471 | -S "server hello, adding alpn extension" \ |
| 5472 | -C "found alpn extension " \ |
| 5473 | -C "Application Layer Protocol is" \ |
| 5474 | -S "Application Layer Protocol is" |
| 5475 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5476 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5477 | "$P_SRV debug_level=3" \ |
| 5478 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5479 | 0 \ |
| 5480 | -c "client hello, adding alpn extension" \ |
| 5481 | -s "found alpn extension" \ |
| 5482 | -C "got an alert message, type: \\[2:120]" \ |
| 5483 | -S "server hello, adding alpn extension" \ |
| 5484 | -C "found alpn extension " \ |
| 5485 | -c "Application Layer Protocol is (none)" \ |
| 5486 | -S "Application Layer Protocol is" |
| 5487 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5488 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5489 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5490 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5491 | 0 \ |
| 5492 | -C "client hello, adding alpn extension" \ |
| 5493 | -S "found alpn extension" \ |
| 5494 | -C "got an alert message, type: \\[2:120]" \ |
| 5495 | -S "server hello, adding alpn extension" \ |
| 5496 | -C "found alpn extension " \ |
| 5497 | -C "Application Layer Protocol is" \ |
| 5498 | -s "Application Layer Protocol is (none)" |
| 5499 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5500 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5501 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5502 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5503 | 0 \ |
| 5504 | -c "client hello, adding alpn extension" \ |
| 5505 | -s "found alpn extension" \ |
| 5506 | -C "got an alert message, type: \\[2:120]" \ |
| 5507 | -s "server hello, adding alpn extension" \ |
| 5508 | -c "found alpn extension" \ |
| 5509 | -c "Application Layer Protocol is abc" \ |
| 5510 | -s "Application Layer Protocol is abc" |
| 5511 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5512 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5513 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5514 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5515 | 0 \ |
| 5516 | -c "client hello, adding alpn extension" \ |
| 5517 | -s "found alpn extension" \ |
| 5518 | -C "got an alert message, type: \\[2:120]" \ |
| 5519 | -s "server hello, adding alpn extension" \ |
| 5520 | -c "found alpn extension" \ |
| 5521 | -c "Application Layer Protocol is abc" \ |
| 5522 | -s "Application Layer Protocol is abc" |
| 5523 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5524 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5525 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5526 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5527 | 0 \ |
| 5528 | -c "client hello, adding alpn extension" \ |
| 5529 | -s "found alpn extension" \ |
| 5530 | -C "got an alert message, type: \\[2:120]" \ |
| 5531 | -s "server hello, adding alpn extension" \ |
| 5532 | -c "found alpn extension" \ |
| 5533 | -c "Application Layer Protocol is 1234" \ |
| 5534 | -s "Application Layer Protocol is 1234" |
| 5535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5536 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5537 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5538 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5539 | 1 \ |
| 5540 | -c "client hello, adding alpn extension" \ |
| 5541 | -s "found alpn extension" \ |
| 5542 | -c "got an alert message, type: \\[2:120]" \ |
| 5543 | -S "server hello, adding alpn extension" \ |
| 5544 | -C "found alpn extension" \ |
| 5545 | -C "Application Layer Protocol is 1234" \ |
| 5546 | -S "Application Layer Protocol is 1234" |
| 5547 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5548 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5549 | # Tests for keyUsage in leaf certificates, part 1: |
| 5550 | # server-side certificate/suite selection |
| 5551 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5552 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5553 | "$P_SRV key_file=data_files/server2.key \ |
| 5554 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5555 | "$P_CLI" \ |
| 5556 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5557 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5558 | |
| 5559 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5560 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5561 | "$P_SRV key_file=data_files/server2.key \ |
| 5562 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5563 | "$P_CLI" \ |
| 5564 | 0 \ |
| 5565 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5566 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5567 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5568 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5569 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5570 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5571 | 1 \ |
| 5572 | -C "Ciphersuite is " |
| 5573 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5574 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5575 | "$P_SRV key_file=data_files/server5.key \ |
| 5576 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5577 | "$P_CLI" \ |
| 5578 | 0 \ |
| 5579 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5580 | |
| 5581 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5582 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5583 | "$P_SRV key_file=data_files/server5.key \ |
| 5584 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5585 | "$P_CLI" \ |
| 5586 | 0 \ |
| 5587 | -c "Ciphersuite is TLS-ECDH-" |
| 5588 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5589 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5590 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5591 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5592 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5593 | 1 \ |
| 5594 | -C "Ciphersuite is " |
| 5595 | |
| 5596 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5597 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5598 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5599 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5600 | "$O_SRV -key data_files/server2.key \ |
| 5601 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5602 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5603 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5604 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5605 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5606 | -C "Processing of the Certificate handshake message failed" \ |
| 5607 | -c "Ciphersuite is TLS-" |
| 5608 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5609 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5610 | "$O_SRV -key data_files/server2.key \ |
| 5611 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5612 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5613 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5614 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5615 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5616 | -C "Processing of the Certificate handshake message failed" \ |
| 5617 | -c "Ciphersuite is TLS-" |
| 5618 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5619 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5620 | "$O_SRV -key data_files/server2.key \ |
| 5621 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5622 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5623 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5624 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5625 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5626 | -C "Processing of the Certificate handshake message failed" \ |
| 5627 | -c "Ciphersuite is TLS-" |
| 5628 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5629 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5630 | "$O_SRV -key data_files/server2.key \ |
| 5631 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5632 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5633 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5634 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5635 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5636 | -c "Processing of the Certificate handshake message failed" \ |
| 5637 | -C "Ciphersuite is TLS-" |
| 5638 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5639 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5640 | "$O_SRV -key data_files/server2.key \ |
| 5641 | -cert data_files/server2.ku-ke.crt" \ |
| 5642 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5643 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5644 | 0 \ |
| 5645 | -c "bad certificate (usage extensions)" \ |
| 5646 | -C "Processing of the Certificate handshake message failed" \ |
| 5647 | -c "Ciphersuite is TLS-" \ |
| 5648 | -c "! Usage does not match the keyUsage extension" |
| 5649 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5650 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5651 | "$O_SRV -key data_files/server2.key \ |
| 5652 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5653 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5654 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5655 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5656 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5657 | -C "Processing of the Certificate handshake message failed" \ |
| 5658 | -c "Ciphersuite is TLS-" |
| 5659 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5660 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5661 | "$O_SRV -key data_files/server2.key \ |
| 5662 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5663 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5664 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5665 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5666 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5667 | -c "Processing of the Certificate handshake message failed" \ |
| 5668 | -C "Ciphersuite is TLS-" |
| 5669 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5670 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5671 | "$O_SRV -key data_files/server2.key \ |
| 5672 | -cert data_files/server2.ku-ds.crt" \ |
| 5673 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5674 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5675 | 0 \ |
| 5676 | -c "bad certificate (usage extensions)" \ |
| 5677 | -C "Processing of the Certificate handshake message failed" \ |
| 5678 | -c "Ciphersuite is TLS-" \ |
| 5679 | -c "! Usage does not match the keyUsage extension" |
| 5680 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5681 | # Tests for keyUsage in leaf certificates, part 3: |
| 5682 | # server-side checking of client cert |
| 5683 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5684 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5685 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5686 | "$O_CLI -key data_files/server2.key \ |
| 5687 | -cert data_files/server2.ku-ds.crt" \ |
| 5688 | 0 \ |
| 5689 | -S "bad certificate (usage extensions)" \ |
| 5690 | -S "Processing of the Certificate handshake message failed" |
| 5691 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5692 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5693 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5694 | "$O_CLI -key data_files/server2.key \ |
| 5695 | -cert data_files/server2.ku-ke.crt" \ |
| 5696 | 0 \ |
| 5697 | -s "bad certificate (usage extensions)" \ |
| 5698 | -S "Processing of the Certificate handshake message failed" |
| 5699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5700 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5701 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5702 | "$O_CLI -key data_files/server2.key \ |
| 5703 | -cert data_files/server2.ku-ke.crt" \ |
| 5704 | 1 \ |
| 5705 | -s "bad certificate (usage extensions)" \ |
| 5706 | -s "Processing of the Certificate handshake message failed" |
| 5707 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5708 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5709 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5710 | "$O_CLI -key data_files/server5.key \ |
| 5711 | -cert data_files/server5.ku-ds.crt" \ |
| 5712 | 0 \ |
| 5713 | -S "bad certificate (usage extensions)" \ |
| 5714 | -S "Processing of the Certificate handshake message failed" |
| 5715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5716 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5717 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5718 | "$O_CLI -key data_files/server5.key \ |
| 5719 | -cert data_files/server5.ku-ka.crt" \ |
| 5720 | 0 \ |
| 5721 | -s "bad certificate (usage extensions)" \ |
| 5722 | -S "Processing of the Certificate handshake message failed" |
| 5723 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5724 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5725 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5726 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5727 | "$P_SRV key_file=data_files/server5.key \ |
| 5728 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5729 | "$P_CLI" \ |
| 5730 | 0 |
| 5731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5732 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5733 | "$P_SRV key_file=data_files/server5.key \ |
| 5734 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5735 | "$P_CLI" \ |
| 5736 | 0 |
| 5737 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5738 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5739 | "$P_SRV key_file=data_files/server5.key \ |
| 5740 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5741 | "$P_CLI" \ |
| 5742 | 0 |
| 5743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5744 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5745 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5746 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5747 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5748 | 1 |
| 5749 | |
| 5750 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5751 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5752 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5753 | "$O_SRV -key data_files/server5.key \ |
| 5754 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5755 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5756 | 0 \ |
| 5757 | -C "bad certificate (usage extensions)" \ |
| 5758 | -C "Processing of the Certificate handshake message failed" \ |
| 5759 | -c "Ciphersuite is TLS-" |
| 5760 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5761 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5762 | "$O_SRV -key data_files/server5.key \ |
| 5763 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5764 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5765 | 0 \ |
| 5766 | -C "bad certificate (usage extensions)" \ |
| 5767 | -C "Processing of the Certificate handshake message failed" \ |
| 5768 | -c "Ciphersuite is TLS-" |
| 5769 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5770 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5771 | "$O_SRV -key data_files/server5.key \ |
| 5772 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5773 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5774 | 0 \ |
| 5775 | -C "bad certificate (usage extensions)" \ |
| 5776 | -C "Processing of the Certificate handshake message failed" \ |
| 5777 | -c "Ciphersuite is TLS-" |
| 5778 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5779 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5780 | "$O_SRV -key data_files/server5.key \ |
| 5781 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5782 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5783 | 1 \ |
| 5784 | -c "bad certificate (usage extensions)" \ |
| 5785 | -c "Processing of the Certificate handshake message failed" \ |
| 5786 | -C "Ciphersuite is TLS-" |
| 5787 | |
| 5788 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5790 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5791 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5792 | "$O_CLI -key data_files/server5.key \ |
| 5793 | -cert data_files/server5.eku-cli.crt" \ |
| 5794 | 0 \ |
| 5795 | -S "bad certificate (usage extensions)" \ |
| 5796 | -S "Processing of the Certificate handshake message failed" |
| 5797 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5798 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5799 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5800 | "$O_CLI -key data_files/server5.key \ |
| 5801 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5802 | 0 \ |
| 5803 | -S "bad certificate (usage extensions)" \ |
| 5804 | -S "Processing of the Certificate handshake message failed" |
| 5805 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5806 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5807 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5808 | "$O_CLI -key data_files/server5.key \ |
| 5809 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5810 | 0 \ |
| 5811 | -S "bad certificate (usage extensions)" \ |
| 5812 | -S "Processing of the Certificate handshake message failed" |
| 5813 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5814 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5815 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5816 | "$O_CLI -key data_files/server5.key \ |
| 5817 | -cert data_files/server5.eku-cs.crt" \ |
| 5818 | 0 \ |
| 5819 | -s "bad certificate (usage extensions)" \ |
| 5820 | -S "Processing of the Certificate handshake message failed" |
| 5821 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5822 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5823 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5824 | "$O_CLI -key data_files/server5.key \ |
| 5825 | -cert data_files/server5.eku-cs.crt" \ |
| 5826 | 1 \ |
| 5827 | -s "bad certificate (usage extensions)" \ |
| 5828 | -s "Processing of the Certificate handshake message failed" |
| 5829 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5830 | # Tests for DHM parameters loading |
| 5831 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5832 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5833 | "$P_SRV" \ |
| 5834 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5835 | debug_level=3" \ |
| 5836 | 0 \ |
| 5837 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5838 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5839 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5840 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5841 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5842 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5843 | debug_level=3" \ |
| 5844 | 0 \ |
| 5845 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5846 | -c "value of 'DHM: G ' (2 bits)" |
| 5847 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5848 | # Tests for DHM client-side size checking |
| 5849 | |
| 5850 | run_test "DHM size: server default, client default, OK" \ |
| 5851 | "$P_SRV" \ |
| 5852 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5853 | debug_level=1" \ |
| 5854 | 0 \ |
| 5855 | -C "DHM prime too short:" |
| 5856 | |
| 5857 | run_test "DHM size: server default, client 2048, OK" \ |
| 5858 | "$P_SRV" \ |
| 5859 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5860 | debug_level=1 dhmlen=2048" \ |
| 5861 | 0 \ |
| 5862 | -C "DHM prime too short:" |
| 5863 | |
| 5864 | run_test "DHM size: server 1024, client default, OK" \ |
| 5865 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5866 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5867 | debug_level=1" \ |
| 5868 | 0 \ |
| 5869 | -C "DHM prime too short:" |
| 5870 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5871 | run_test "DHM size: server 999, client 999, OK" \ |
| 5872 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5873 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5874 | debug_level=1 dhmlen=999" \ |
| 5875 | 0 \ |
| 5876 | -C "DHM prime too short:" |
| 5877 | |
| 5878 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5879 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5880 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5881 | debug_level=1 dhmlen=1000" \ |
| 5882 | 0 \ |
| 5883 | -C "DHM prime too short:" |
| 5884 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5885 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5886 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5887 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5888 | debug_level=1" \ |
| 5889 | 1 \ |
| 5890 | -c "DHM prime too short:" |
| 5891 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5892 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5893 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5894 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5895 | debug_level=1 dhmlen=1001" \ |
| 5896 | 1 \ |
| 5897 | -c "DHM prime too short:" |
| 5898 | |
| 5899 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5900 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5901 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5902 | debug_level=1 dhmlen=1000" \ |
| 5903 | 1 \ |
| 5904 | -c "DHM prime too short:" |
| 5905 | |
| 5906 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5907 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5908 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5909 | debug_level=1 dhmlen=999" \ |
| 5910 | 1 \ |
| 5911 | -c "DHM prime too short:" |
| 5912 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5913 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5914 | "$P_SRV" \ |
| 5915 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5916 | debug_level=1 dhmlen=2049" \ |
| 5917 | 1 \ |
| 5918 | -c "DHM prime too short:" |
| 5919 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5920 | # Tests for PSK callback |
| 5921 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5922 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5923 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5924 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5925 | psk_identity=foo psk=abc123" \ |
| 5926 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5927 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5928 | -S "SSL - Unknown identity received" \ |
| 5929 | -S "SSL - Verification of the message MAC failed" |
| 5930 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5931 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5932 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5933 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5934 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5935 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5936 | 0 \ |
| 5937 | -c "skip PMS generation for opaque PSK"\ |
| 5938 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5939 | -C "session hash for extended master secret"\ |
| 5940 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5941 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5942 | -S "SSL - Unknown identity received" \ |
| 5943 | -S "SSL - Verification of the message MAC failed" |
| 5944 | |
| 5945 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5946 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5947 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5948 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5949 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5950 | 0 \ |
| 5951 | -c "skip PMS generation for opaque PSK"\ |
| 5952 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5953 | -C "session hash for extended master secret"\ |
| 5954 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5955 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5956 | -S "SSL - Unknown identity received" \ |
| 5957 | -S "SSL - Verification of the message MAC failed" |
| 5958 | |
| 5959 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5960 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5961 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5962 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5963 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5964 | 0 \ |
| 5965 | -c "skip PMS generation for opaque PSK"\ |
| 5966 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5967 | -c "session hash for extended master secret"\ |
| 5968 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5969 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5970 | -S "SSL - Unknown identity received" \ |
| 5971 | -S "SSL - Verification of the message MAC failed" |
| 5972 | |
| 5973 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5974 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5975 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5976 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5977 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5978 | 0 \ |
| 5979 | -c "skip PMS generation for opaque PSK"\ |
| 5980 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5981 | -c "session hash for extended master secret"\ |
| 5982 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5983 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5984 | -S "SSL - Unknown identity received" \ |
| 5985 | -S "SSL - Verification of the message MAC failed" |
| 5986 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5987 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5988 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5989 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 5990 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5991 | psk_identity=foo psk=abc123" \ |
| 5992 | 0 \ |
| 5993 | -C "skip PMS generation for opaque PSK"\ |
| 5994 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5995 | -C "session hash for extended master secret"\ |
| 5996 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5997 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5998 | -S "SSL - Unknown identity received" \ |
| 5999 | -S "SSL - Verification of the message MAC failed" |
| 6000 | |
| 6001 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6002 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6003 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
| 6004 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6005 | psk_identity=foo psk=abc123" \ |
| 6006 | 0 \ |
| 6007 | -C "skip PMS generation for opaque PSK"\ |
| 6008 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6009 | -C "session hash for extended master secret"\ |
| 6010 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6011 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6012 | -S "SSL - Unknown identity received" \ |
| 6013 | -S "SSL - Verification of the message MAC failed" |
| 6014 | |
| 6015 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6016 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6017 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6018 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6019 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6020 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6021 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6022 | -c "session hash for extended master secret"\ |
| 6023 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6024 | -C "skip PMS generation for opaque PSK"\ |
| 6025 | -s "skip PMS generation for opaque PSK"\ |
| 6026 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6027 | -S "SSL - Unknown identity received" \ |
| 6028 | -S "SSL - Verification of the message MAC failed" |
| 6029 | |
| 6030 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6031 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6032 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6033 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6034 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6035 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6036 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6037 | -c "session hash for extended master secret"\ |
| 6038 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6039 | -C "skip PMS generation for opaque PSK"\ |
| 6040 | -s "skip PMS generation for opaque PSK"\ |
| 6041 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6042 | -S "SSL - Unknown identity received" \ |
| 6043 | -S "SSL - Verification of the message MAC failed" |
| 6044 | |
| 6045 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6046 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6047 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6048 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6049 | psk_identity=def psk=beef" \ |
| 6050 | 0 \ |
| 6051 | -C "skip PMS generation for opaque PSK"\ |
| 6052 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6053 | -C "session hash for extended master secret"\ |
| 6054 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6055 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6056 | -S "SSL - Unknown identity received" \ |
| 6057 | -S "SSL - Verification of the message MAC failed" |
| 6058 | |
| 6059 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6060 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6061 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
| 6062 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6063 | psk_identity=def psk=beef" \ |
| 6064 | 0 \ |
| 6065 | -C "skip PMS generation for opaque PSK"\ |
| 6066 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6067 | -C "session hash for extended master secret"\ |
| 6068 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6069 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6070 | -S "SSL - Unknown identity received" \ |
| 6071 | -S "SSL - Verification of the message MAC failed" |
| 6072 | |
| 6073 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6074 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6075 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6076 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6077 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6078 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6079 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6080 | -c "session hash for extended master secret"\ |
| 6081 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6082 | -C "skip PMS generation for opaque PSK"\ |
| 6083 | -s "skip PMS generation for opaque PSK"\ |
| 6084 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6085 | -S "SSL - Unknown identity received" \ |
| 6086 | -S "SSL - Verification of the message MAC failed" |
| 6087 | |
| 6088 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6089 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6090 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6091 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6092 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6093 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6094 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6095 | -c "session hash for extended master secret"\ |
| 6096 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6097 | -C "skip PMS generation for opaque PSK"\ |
| 6098 | -s "skip PMS generation for opaque PSK"\ |
| 6099 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6100 | -S "SSL - Unknown identity received" \ |
| 6101 | -S "SSL - Verification of the message MAC failed" |
| 6102 | |
| 6103 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6104 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6105 | "$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=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6106 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6107 | psk_identity=def psk=beef" \ |
| 6108 | 0 \ |
| 6109 | -C "skip PMS generation for opaque PSK"\ |
| 6110 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6111 | -C "session hash for extended master secret"\ |
| 6112 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6113 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6114 | -S "SSL - Unknown identity received" \ |
| 6115 | -S "SSL - Verification of the message MAC failed" |
| 6116 | |
| 6117 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6118 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6119 | "$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=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6120 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6121 | psk_identity=def psk=beef" \ |
| 6122 | 0 \ |
| 6123 | -C "skip PMS generation for opaque PSK"\ |
| 6124 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6125 | -C "session hash for extended master secret"\ |
| 6126 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6127 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6128 | -S "SSL - Unknown identity received" \ |
| 6129 | -S "SSL - Verification of the message MAC failed" |
| 6130 | |
| 6131 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6132 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6133 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6134 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6135 | psk_identity=def psk=beef" \ |
| 6136 | 0 \ |
| 6137 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6138 | -C "session hash for extended master secret"\ |
| 6139 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6140 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6141 | -S "SSL - Unknown identity received" \ |
| 6142 | -S "SSL - Verification of the message MAC failed" |
| 6143 | |
| 6144 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6145 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6146 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6147 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6148 | psk_identity=def psk=beef" \ |
| 6149 | 0 \ |
| 6150 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6151 | -C "session hash for extended master secret"\ |
| 6152 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6153 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6154 | -S "SSL - Unknown identity received" \ |
| 6155 | -S "SSL - Verification of the message MAC failed" |
| 6156 | |
| 6157 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6158 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6159 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 6160 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6161 | psk_identity=def psk=beef" \ |
| 6162 | 1 \ |
| 6163 | -s "SSL - Verification of the message MAC failed" |
| 6164 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6165 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6166 | "$P_SRV" \ |
| 6167 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6168 | psk_identity=foo psk=abc123" \ |
| 6169 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6170 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6171 | -S "SSL - Unknown identity received" \ |
| 6172 | -S "SSL - Verification of the message MAC failed" |
| 6173 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6174 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6175 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6176 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6177 | psk_identity=foo psk=abc123" \ |
| 6178 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6179 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6180 | -s "SSL - Unknown identity received" \ |
| 6181 | -S "SSL - Verification of the message MAC failed" |
| 6182 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6183 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6184 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6185 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6186 | psk_identity=abc psk=dead" \ |
| 6187 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6188 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6189 | -S "SSL - Unknown identity received" \ |
| 6190 | -S "SSL - Verification of the message MAC failed" |
| 6191 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6192 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6193 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6194 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6195 | psk_identity=def psk=beef" \ |
| 6196 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6197 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6198 | -S "SSL - Unknown identity received" \ |
| 6199 | -S "SSL - Verification of the message MAC failed" |
| 6200 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6201 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6202 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6203 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6204 | psk_identity=ghi psk=beef" \ |
| 6205 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6206 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6207 | -s "SSL - Unknown identity received" \ |
| 6208 | -S "SSL - Verification of the message MAC failed" |
| 6209 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6210 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6211 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6212 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6213 | psk_identity=abc psk=beef" \ |
| 6214 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6215 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6216 | -S "SSL - Unknown identity received" \ |
| 6217 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6218 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6219 | # Tests for EC J-PAKE |
| 6220 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6221 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6222 | run_test "ECJPAKE: client not configured" \ |
| 6223 | "$P_SRV debug_level=3" \ |
| 6224 | "$P_CLI debug_level=3" \ |
| 6225 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6226 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6227 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6228 | -S "found ecjpake kkpp extension" \ |
| 6229 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6230 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6231 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6232 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6233 | -S "None of the common ciphersuites is usable" |
| 6234 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6235 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6236 | run_test "ECJPAKE: server not configured" \ |
| 6237 | "$P_SRV debug_level=3" \ |
| 6238 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6239 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6240 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6241 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6242 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6243 | -s "found ecjpake kkpp extension" \ |
| 6244 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6245 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6246 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6247 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6248 | -s "None of the common ciphersuites is usable" |
| 6249 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6250 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6251 | run_test "ECJPAKE: working, TLS" \ |
| 6252 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6253 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6254 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6255 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6256 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6257 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6258 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6259 | -s "found ecjpake kkpp extension" \ |
| 6260 | -S "skip ecjpake kkpp extension" \ |
| 6261 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6262 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6263 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6264 | -S "None of the common ciphersuites is usable" \ |
| 6265 | -S "SSL - Verification of the message MAC failed" |
| 6266 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6267 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6268 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6269 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6270 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6271 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6272 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6273 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6274 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6275 | -s "SSL - Verification of the message MAC failed" |
| 6276 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6277 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6278 | run_test "ECJPAKE: working, DTLS" \ |
| 6279 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6280 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6281 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6282 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6283 | -c "re-using cached ecjpake parameters" \ |
| 6284 | -S "SSL - Verification of the message MAC failed" |
| 6285 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6286 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6287 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6288 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6289 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6290 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6291 | 0 \ |
| 6292 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6293 | -S "SSL - Verification of the message MAC failed" |
| 6294 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6295 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6296 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6297 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6298 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6299 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6300 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6301 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6302 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6303 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6304 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6305 | # for tests with configs/config-thread.h |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6306 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6307 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6308 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6309 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6310 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6311 | 0 |
| 6312 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6313 | # Tests for ciphersuites per version |
| 6314 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6315 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6316 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6317 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6318 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6319 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6320 | "$P_CLI force_version=ssl3" \ |
| 6321 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6322 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6323 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6324 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 6325 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6326 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6327 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6328 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 6329 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6330 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6331 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6332 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6334 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6335 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6336 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6337 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6338 | "$P_CLI force_version=tls1_1" \ |
| 6339 | 0 \ |
| 6340 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 6341 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6343 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6344 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6345 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6346 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6347 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6348 | 0 \ |
| 6349 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 6350 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6351 | # Test for ClientHello without extensions |
| 6352 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6353 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6354 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6355 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6356 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6357 | 0 \ |
| 6358 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6359 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6360 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6361 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6362 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6363 | "$P_SRV" \ |
| 6364 | "$P_CLI request_size=100" \ |
| 6365 | 0 \ |
| 6366 | -s "Read from client: 100 bytes read$" |
| 6367 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6368 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6369 | "$P_SRV" \ |
| 6370 | "$P_CLI request_size=500" \ |
| 6371 | 0 \ |
| 6372 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6373 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6374 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6375 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6376 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6377 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6378 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6379 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6380 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6381 | 0 \ |
| 6382 | -s "Read from client: 1 bytes read" |
| 6383 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6384 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6385 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6386 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6387 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6388 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6389 | 0 \ |
| 6390 | -s "Read from client: 1 bytes read" |
| 6391 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6392 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6393 | "$P_SRV" \ |
| 6394 | "$P_CLI request_size=1 force_version=tls1 \ |
| 6395 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6396 | 0 \ |
| 6397 | -s "Read from client: 1 bytes read" |
| 6398 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6399 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6400 | "$P_SRV" \ |
| 6401 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 6402 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6403 | 0 \ |
| 6404 | -s "Read from client: 1 bytes read" |
| 6405 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6406 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6407 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6408 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6409 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6410 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6411 | 0 \ |
| 6412 | -s "Read from client: 1 bytes read" |
| 6413 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6414 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6415 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6416 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6417 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6418 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6419 | 0 \ |
| 6420 | -s "Read from client: 1 bytes read" |
| 6421 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6422 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6423 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6424 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6425 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6426 | 0 \ |
| 6427 | -s "Read from client: 1 bytes read" |
| 6428 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6429 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6430 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6431 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6432 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6433 | 0 \ |
| 6434 | -s "Read from client: 1 bytes read" |
| 6435 | |
| 6436 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6437 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6438 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6439 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6440 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6441 | 0 \ |
| 6442 | -s "Read from client: 1 bytes read" |
| 6443 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6444 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6445 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6446 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6447 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6448 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6449 | 0 \ |
| 6450 | -s "Read from client: 1 bytes read" |
| 6451 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6452 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6453 | "$P_SRV" \ |
| 6454 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6455 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6456 | 0 \ |
| 6457 | -s "Read from client: 1 bytes read" |
| 6458 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6459 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6460 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6461 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6462 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6463 | 0 \ |
| 6464 | -s "Read from client: 1 bytes read" |
| 6465 | |
| 6466 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6467 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6468 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6469 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6470 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6471 | 0 \ |
| 6472 | -s "Read from client: 1 bytes read" |
| 6473 | |
| 6474 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6475 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6476 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6477 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6478 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 6479 | 0 \ |
| 6480 | -s "Read from client: 1 bytes read" |
| 6481 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6482 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6483 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6484 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6485 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6486 | 0 \ |
| 6487 | -s "Read from client: 1 bytes read" |
| 6488 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6489 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6490 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6491 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6492 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6493 | 0 \ |
| 6494 | -s "Read from client: 1 bytes read" |
| 6495 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6496 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6497 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6498 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6499 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6500 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6501 | 0 \ |
| 6502 | -s "Read from client: 1 bytes read" |
| 6503 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6504 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6505 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6506 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6507 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6508 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6509 | 0 \ |
| 6510 | -s "Read from client: 1 bytes read" |
| 6511 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6512 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6513 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6514 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6515 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6516 | 0 \ |
| 6517 | -s "Read from client: 1 bytes read" |
| 6518 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6519 | 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] | 6520 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6521 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6522 | 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] | 6523 | 0 \ |
| 6524 | -s "Read from client: 1 bytes read" |
| 6525 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6526 | 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] | 6527 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6528 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6529 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6530 | 0 \ |
| 6531 | -s "Read from client: 1 bytes read" |
| 6532 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6533 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6534 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6535 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6536 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6537 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6538 | 0 \ |
| 6539 | -s "Read from client: 1 bytes read" |
| 6540 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6541 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6542 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6543 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6544 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6545 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6546 | 0 \ |
| 6547 | -s "Read from client: 1 bytes read" |
| 6548 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6549 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6550 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6551 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6552 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6553 | 0 \ |
| 6554 | -s "Read from client: 1 bytes read" |
| 6555 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6556 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6557 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6558 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6559 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6560 | 0 \ |
| 6561 | -s "Read from client: 1 bytes read" |
| 6562 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6563 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6564 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6565 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6566 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6567 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6568 | 0 \ |
| 6569 | -s "Read from client: 1 bytes read" |
| 6570 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6571 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6572 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6573 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6574 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6575 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6576 | 0 \ |
| 6577 | -s "Read from client: 1 bytes read" |
| 6578 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6579 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6580 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6581 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6582 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6583 | 0 \ |
| 6584 | -s "Read from client: 1 bytes read" |
| 6585 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6586 | 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] | 6587 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6588 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6589 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6590 | 0 \ |
| 6591 | -s "Read from client: 1 bytes read" |
| 6592 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6593 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6594 | |
| 6595 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6596 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6597 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6598 | "$P_CLI dtls=1 request_size=1 \ |
| 6599 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6600 | 0 \ |
| 6601 | -s "Read from client: 1 bytes read" |
| 6602 | |
| 6603 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6604 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6605 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6606 | "$P_CLI dtls=1 request_size=1 \ |
| 6607 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6608 | 0 \ |
| 6609 | -s "Read from client: 1 bytes read" |
| 6610 | |
| 6611 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6612 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6613 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6614 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6615 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6616 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6617 | 0 \ |
| 6618 | -s "Read from client: 1 bytes read" |
| 6619 | |
| 6620 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6621 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6622 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6623 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6624 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6625 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6626 | 0 \ |
| 6627 | -s "Read from client: 1 bytes read" |
| 6628 | |
| 6629 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6630 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6631 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6632 | "$P_CLI dtls=1 request_size=1 \ |
| 6633 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6634 | 0 \ |
| 6635 | -s "Read from client: 1 bytes read" |
| 6636 | |
| 6637 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6638 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6639 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6640 | "$P_CLI dtls=1 request_size=1 \ |
| 6641 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6642 | 0 \ |
| 6643 | -s "Read from client: 1 bytes read" |
| 6644 | |
| 6645 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6646 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6647 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6648 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6649 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6650 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6651 | 0 \ |
| 6652 | -s "Read from client: 1 bytes read" |
| 6653 | |
| 6654 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6655 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6656 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6657 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6658 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6659 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6660 | 0 \ |
| 6661 | -s "Read from client: 1 bytes read" |
| 6662 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6663 | # Tests for small server packets |
| 6664 | |
| 6665 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6666 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6667 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6668 | "$P_CLI force_version=ssl3 \ |
| 6669 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6670 | 0 \ |
| 6671 | -c "Read from server: 1 bytes read" |
| 6672 | |
| 6673 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6674 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6675 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6676 | "$P_CLI force_version=ssl3 \ |
| 6677 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6678 | 0 \ |
| 6679 | -c "Read from server: 1 bytes read" |
| 6680 | |
| 6681 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6682 | "$P_SRV response_size=1" \ |
| 6683 | "$P_CLI force_version=tls1 \ |
| 6684 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6685 | 0 \ |
| 6686 | -c "Read from server: 1 bytes read" |
| 6687 | |
| 6688 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6689 | "$P_SRV response_size=1" \ |
| 6690 | "$P_CLI force_version=tls1 etm=0 \ |
| 6691 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6692 | 0 \ |
| 6693 | -c "Read from server: 1 bytes read" |
| 6694 | |
| 6695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6696 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6697 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6698 | "$P_CLI force_version=tls1 \ |
| 6699 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6700 | 0 \ |
| 6701 | -c "Read from server: 1 bytes read" |
| 6702 | |
| 6703 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6704 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6705 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6706 | "$P_CLI force_version=tls1 \ |
| 6707 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6708 | 0 \ |
| 6709 | -c "Read from server: 1 bytes read" |
| 6710 | |
| 6711 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6712 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6713 | "$P_CLI force_version=tls1 \ |
| 6714 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6715 | 0 \ |
| 6716 | -c "Read from server: 1 bytes read" |
| 6717 | |
| 6718 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6719 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6720 | "$P_CLI force_version=tls1 \ |
| 6721 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6722 | 0 \ |
| 6723 | -c "Read from server: 1 bytes read" |
| 6724 | |
| 6725 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6726 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6727 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6728 | "$P_CLI force_version=tls1 \ |
| 6729 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6730 | 0 \ |
| 6731 | -c "Read from server: 1 bytes read" |
| 6732 | |
| 6733 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6734 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6735 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6736 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6737 | trunc_hmac=1 etm=0" \ |
| 6738 | 0 \ |
| 6739 | -c "Read from server: 1 bytes read" |
| 6740 | |
| 6741 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6742 | "$P_SRV response_size=1" \ |
| 6743 | "$P_CLI force_version=tls1_1 \ |
| 6744 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6745 | 0 \ |
| 6746 | -c "Read from server: 1 bytes read" |
| 6747 | |
| 6748 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6749 | "$P_SRV response_size=1" \ |
| 6750 | "$P_CLI force_version=tls1_1 \ |
| 6751 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6752 | 0 \ |
| 6753 | -c "Read from server: 1 bytes read" |
| 6754 | |
| 6755 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6756 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6757 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6758 | "$P_CLI force_version=tls1_1 \ |
| 6759 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6760 | 0 \ |
| 6761 | -c "Read from server: 1 bytes read" |
| 6762 | |
| 6763 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6764 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6765 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6766 | "$P_CLI force_version=tls1_1 \ |
| 6767 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6768 | 0 \ |
| 6769 | -c "Read from server: 1 bytes read" |
| 6770 | |
| 6771 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6772 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6773 | "$P_CLI force_version=tls1_1 \ |
| 6774 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6775 | 0 \ |
| 6776 | -c "Read from server: 1 bytes read" |
| 6777 | |
| 6778 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6779 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6780 | "$P_CLI force_version=tls1_1 \ |
| 6781 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6782 | 0 \ |
| 6783 | -c "Read from server: 1 bytes read" |
| 6784 | |
| 6785 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6786 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6787 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6788 | "$P_CLI force_version=tls1_1 \ |
| 6789 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6790 | 0 \ |
| 6791 | -c "Read from server: 1 bytes read" |
| 6792 | |
| 6793 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6794 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6795 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6796 | "$P_CLI force_version=tls1_1 \ |
| 6797 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6798 | 0 \ |
| 6799 | -c "Read from server: 1 bytes read" |
| 6800 | |
| 6801 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6802 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6803 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6804 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6805 | 0 \ |
| 6806 | -c "Read from server: 1 bytes read" |
| 6807 | |
| 6808 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6809 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6810 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6811 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6812 | 0 \ |
| 6813 | -c "Read from server: 1 bytes read" |
| 6814 | |
| 6815 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6816 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6817 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6818 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6819 | 0 \ |
| 6820 | -c "Read from server: 1 bytes read" |
| 6821 | |
| 6822 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6823 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6824 | "$P_SRV response_size=1 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6825 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6826 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6827 | 0 \ |
| 6828 | -c "Read from server: 1 bytes read" |
| 6829 | |
| 6830 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6831 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6832 | "$P_SRV response_size=1 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6833 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6834 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6835 | 0 \ |
| 6836 | -c "Read from server: 1 bytes read" |
| 6837 | |
| 6838 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6839 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6840 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6841 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6842 | 0 \ |
| 6843 | -c "Read from server: 1 bytes read" |
| 6844 | |
| 6845 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6846 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6847 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6848 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6849 | 0 \ |
| 6850 | -c "Read from server: 1 bytes read" |
| 6851 | |
| 6852 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6853 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6854 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6855 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6856 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6857 | 0 \ |
| 6858 | -c "Read from server: 1 bytes read" |
| 6859 | |
| 6860 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6861 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6862 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6863 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6864 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6865 | 0 \ |
| 6866 | -c "Read from server: 1 bytes read" |
| 6867 | |
| 6868 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6869 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6870 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6871 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6872 | 0 \ |
| 6873 | -c "Read from server: 1 bytes read" |
| 6874 | |
| 6875 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6876 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6877 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6878 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6879 | 0 \ |
| 6880 | -c "Read from server: 1 bytes read" |
| 6881 | |
| 6882 | # Tests for small server packets in DTLS |
| 6883 | |
| 6884 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6885 | run_test "Small server packet DTLS 1.0" \ |
| 6886 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6887 | "$P_CLI dtls=1 \ |
| 6888 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6889 | 0 \ |
| 6890 | -c "Read from server: 1 bytes read" |
| 6891 | |
| 6892 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6893 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6894 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6895 | "$P_CLI dtls=1 \ |
| 6896 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6897 | 0 \ |
| 6898 | -c "Read from server: 1 bytes read" |
| 6899 | |
| 6900 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6901 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6902 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6903 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6904 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6905 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6906 | 0 \ |
| 6907 | -c "Read from server: 1 bytes read" |
| 6908 | |
| 6909 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6910 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6911 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6912 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6913 | "$P_CLI dtls=1 \ |
| 6914 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6915 | 0 \ |
| 6916 | -c "Read from server: 1 bytes read" |
| 6917 | |
| 6918 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6919 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6920 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6921 | "$P_CLI dtls=1 \ |
| 6922 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6923 | 0 \ |
| 6924 | -c "Read from server: 1 bytes read" |
| 6925 | |
| 6926 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6927 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6928 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6929 | "$P_CLI dtls=1 \ |
| 6930 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6931 | 0 \ |
| 6932 | -c "Read from server: 1 bytes read" |
| 6933 | |
| 6934 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6935 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6936 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6937 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 trunc_hmac=1" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6938 | "$P_CLI dtls=1 \ |
| 6939 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6940 | 0 \ |
| 6941 | -c "Read from server: 1 bytes read" |
| 6942 | |
| 6943 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6944 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6945 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6946 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 trunc_hmac=1 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6947 | "$P_CLI dtls=1 \ |
| 6948 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6949 | 0 \ |
| 6950 | -c "Read from server: 1 bytes read" |
| 6951 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6952 | # A test for extensions in SSLv3 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6953 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6954 | requires_max_content_len 4096 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6955 | run_test "SSLv3 with extensions, server side" \ |
| 6956 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6957 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6958 | 0 \ |
| 6959 | -S "dumping 'client hello extensions'" \ |
| 6960 | -S "server hello, total extension length:" |
| 6961 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6962 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6963 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6964 | # How many fragments do we expect to write $1 bytes? |
| 6965 | fragments_for_write() { |
| 6966 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6967 | } |
| 6968 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6969 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6970 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6971 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6972 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6973 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6974 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6975 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6976 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6977 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6978 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6979 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6980 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6981 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6982 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6983 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6984 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6985 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6986 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6987 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6988 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6989 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6990 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6991 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6992 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6993 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6994 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6995 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6996 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6997 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6998 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6999 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7000 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7001 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7002 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7003 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7004 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7005 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7006 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7007 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7008 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7009 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7010 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7011 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7012 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7013 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7014 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7015 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7016 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7017 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7018 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7019 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7020 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7021 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7022 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7023 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7024 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7025 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7026 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7027 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7028 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7029 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7030 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7031 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7032 | |
| 7033 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7034 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7035 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7036 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7037 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7038 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7039 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7040 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7041 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7042 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7043 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7044 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7045 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7046 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7047 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7048 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7049 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7050 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7051 | "$P_SRV" \ |
| 7052 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 7053 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7054 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7055 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7056 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7057 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7058 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7059 | "$P_SRV" \ |
| 7060 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 7061 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7062 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7063 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7064 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7065 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7066 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7067 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7068 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7069 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7070 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7071 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7072 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7073 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7074 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7075 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7076 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7077 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7078 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7079 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7080 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7081 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7082 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7083 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 7084 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7085 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7086 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7087 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7088 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7089 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7090 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7091 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7092 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7093 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7094 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7095 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7096 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7097 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7098 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7099 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7100 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7101 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7102 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7103 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7104 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7105 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7106 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7107 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7108 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7109 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7110 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7111 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7112 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7113 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7114 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7115 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7116 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7117 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7118 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7119 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7120 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7121 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7122 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7123 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7124 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7125 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7126 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7127 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7128 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7129 | 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] | 7130 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7131 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7132 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7133 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7134 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7135 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7136 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7137 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7138 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7139 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7140 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7141 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7142 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7143 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7144 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7145 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7146 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7147 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7148 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7149 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7150 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7151 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7152 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7153 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7154 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7155 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7156 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7157 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7158 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7159 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7160 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7161 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7162 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7163 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7164 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7165 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7166 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7167 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7168 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7169 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7170 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7171 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7172 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7173 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7174 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7175 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7176 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7177 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7178 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7179 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7180 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7181 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7182 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7183 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7184 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7185 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7186 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7187 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7188 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7189 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7190 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7191 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7192 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7193 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7194 | 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] | 7195 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7196 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7197 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7198 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7199 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7200 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7201 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7202 | # Test for large server packets |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7203 | # 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] | 7204 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 7205 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 7206 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7207 | "$P_CLI force_version=ssl3 \ |
| 7208 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7209 | 0 \ |
| 7210 | -c "Read from server: 16384 bytes read" |
| 7211 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 7212 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 7213 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 7214 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 7215 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 7216 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 7217 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7218 | 0 \ |
| 7219 | -c "Read from server: 1 bytes read"\ |
| 7220 | -c "16383 bytes read"\ |
| 7221 | -C "Read from server: 16384 bytes read" |
| 7222 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7223 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 7224 | "$P_SRV response_size=16384" \ |
| 7225 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7226 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7227 | 0 \ |
| 7228 | -c "Read from server: 1 bytes read"\ |
| 7229 | -c "16383 bytes read"\ |
| 7230 | -C "Read from server: 16384 bytes read" |
| 7231 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7232 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 7233 | "$P_SRV response_size=16384" \ |
| 7234 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 7235 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7236 | 0 \ |
| 7237 | -c "Read from server: 1 bytes read"\ |
| 7238 | -c "16383 bytes read"\ |
| 7239 | -C "Read from server: 16384 bytes read" |
| 7240 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7241 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7242 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 7243 | "$P_SRV response_size=16384" \ |
| 7244 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7245 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7246 | trunc_hmac=1" \ |
| 7247 | 0 \ |
| 7248 | -c "Read from server: 1 bytes read"\ |
| 7249 | -c "16383 bytes read"\ |
| 7250 | -C "Read from server: 16384 bytes read" |
| 7251 | |
| 7252 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7253 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 7254 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7255 | "$P_CLI force_version=tls1 \ |
| 7256 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7257 | trunc_hmac=1" \ |
| 7258 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7259 | -s "16384 bytes written in 1 fragments" \ |
| 7260 | -c "Read from server: 16384 bytes read" |
| 7261 | |
| 7262 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 7263 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7264 | "$P_CLI force_version=tls1 \ |
| 7265 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7266 | 0 \ |
| 7267 | -s "16384 bytes written in 1 fragments" \ |
| 7268 | -c "Read from server: 16384 bytes read" |
| 7269 | |
| 7270 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 7271 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7272 | "$P_CLI force_version=tls1 \ |
| 7273 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7274 | 0 \ |
| 7275 | -s "16384 bytes written in 1 fragments" \ |
| 7276 | -c "Read from server: 16384 bytes read" |
| 7277 | |
| 7278 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7279 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 7280 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7281 | "$P_CLI force_version=tls1 \ |
| 7282 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7283 | 0 \ |
| 7284 | -s "16384 bytes written in 1 fragments" \ |
| 7285 | -c "Read from server: 16384 bytes read" |
| 7286 | |
| 7287 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7288 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 7289 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7290 | "$P_CLI force_version=tls1 \ |
| 7291 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7292 | 0 \ |
| 7293 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7294 | -c "Read from server: 16384 bytes read" |
| 7295 | |
| 7296 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 7297 | "$P_SRV response_size=16384" \ |
| 7298 | "$P_CLI force_version=tls1_1 \ |
| 7299 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7300 | 0 \ |
| 7301 | -c "Read from server: 16384 bytes read" |
| 7302 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7303 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 7304 | "$P_SRV response_size=16384" \ |
| 7305 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 7306 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7307 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7308 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7309 | -c "Read from server: 16384 bytes read" |
| 7310 | |
| 7311 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7312 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 7313 | "$P_SRV response_size=16384" \ |
| 7314 | "$P_CLI force_version=tls1_1 \ |
| 7315 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7316 | trunc_hmac=1" \ |
| 7317 | 0 \ |
| 7318 | -c "Read from server: 16384 bytes read" |
| 7319 | |
| 7320 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7321 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 7322 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 7323 | "$P_CLI force_version=tls1_1 \ |
| 7324 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7325 | 0 \ |
| 7326 | -s "16384 bytes written in 1 fragments" \ |
| 7327 | -c "Read from server: 16384 bytes read" |
| 7328 | |
| 7329 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 7330 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7331 | "$P_CLI force_version=tls1_1 \ |
| 7332 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7333 | 0 \ |
| 7334 | -c "Read from server: 16384 bytes read" |
| 7335 | |
| 7336 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 7337 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7338 | "$P_CLI force_version=tls1_1 \ |
| 7339 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7340 | 0 \ |
| 7341 | -s "16384 bytes written in 1 fragments" \ |
| 7342 | -c "Read from server: 16384 bytes read" |
| 7343 | |
| 7344 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7345 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 7346 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7347 | "$P_CLI force_version=tls1_1 \ |
| 7348 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7349 | trunc_hmac=1" \ |
| 7350 | 0 \ |
| 7351 | -c "Read from server: 16384 bytes read" |
| 7352 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7353 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 7354 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7355 | "$P_CLI force_version=tls1_1 \ |
| 7356 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7357 | 0 \ |
| 7358 | -s "16384 bytes written in 1 fragments" \ |
| 7359 | -c "Read from server: 16384 bytes read" |
| 7360 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7361 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 7362 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7363 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7364 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7365 | 0 \ |
| 7366 | -c "Read from server: 16384 bytes read" |
| 7367 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7368 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 7369 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7370 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7371 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7372 | 0 \ |
| 7373 | -s "16384 bytes written in 1 fragments" \ |
| 7374 | -c "Read from server: 16384 bytes read" |
| 7375 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7376 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 7377 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7378 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7379 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 7380 | 0 \ |
| 7381 | -c "Read from server: 16384 bytes read" |
| 7382 | |
| 7383 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7384 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 7385 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7386 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7387 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7388 | trunc_hmac=1" \ |
| 7389 | 0 \ |
| 7390 | -c "Read from server: 16384 bytes read" |
| 7391 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7392 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 7393 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7394 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7395 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7396 | 0 \ |
| 7397 | -s "16384 bytes written in 1 fragments" \ |
| 7398 | -c "Read from server: 16384 bytes read" |
| 7399 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7400 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 7401 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7402 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7403 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7404 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7405 | -s "16384 bytes written in 1 fragments" \ |
| 7406 | -c "Read from server: 16384 bytes read" |
| 7407 | |
| 7408 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 7409 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7410 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7411 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7412 | 0 \ |
| 7413 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7414 | -c "Read from server: 16384 bytes read" |
| 7415 | |
| 7416 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7417 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 7418 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7419 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7420 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7421 | trunc_hmac=1" \ |
| 7422 | 0 \ |
| 7423 | -c "Read from server: 16384 bytes read" |
| 7424 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7425 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7426 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7427 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7428 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7429 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7430 | 0 \ |
| 7431 | -s "16384 bytes written in 1 fragments" \ |
| 7432 | -c "Read from server: 16384 bytes read" |
| 7433 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7434 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 7435 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7436 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7437 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7438 | 0 \ |
| 7439 | -c "Read from server: 16384 bytes read" |
| 7440 | |
| 7441 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 7442 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7443 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7444 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7445 | 0 \ |
| 7446 | -c "Read from server: 16384 bytes read" |
| 7447 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7448 | # Tests for restartable ECC |
| 7449 | |
| 7450 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7451 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7452 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7453 | "$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] | 7454 | 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] | 7455 | debug_level=1" \ |
| 7456 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7457 | -C "x509_verify_cert.*4b00" \ |
| 7458 | -C "mbedtls_pk_verify.*4b00" \ |
| 7459 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7460 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7461 | |
| 7462 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7463 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7464 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7465 | "$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] | 7466 | 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] | 7467 | debug_level=1 ec_max_ops=0" \ |
| 7468 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7469 | -C "x509_verify_cert.*4b00" \ |
| 7470 | -C "mbedtls_pk_verify.*4b00" \ |
| 7471 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7472 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7473 | |
| 7474 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7475 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7476 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7477 | "$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] | 7478 | 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] | 7479 | debug_level=1 ec_max_ops=65535" \ |
| 7480 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7481 | -C "x509_verify_cert.*4b00" \ |
| 7482 | -C "mbedtls_pk_verify.*4b00" \ |
| 7483 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7484 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7485 | |
| 7486 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7487 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7488 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7489 | "$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] | 7490 | 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] | 7491 | debug_level=1 ec_max_ops=1000" \ |
| 7492 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7493 | -c "x509_verify_cert.*4b00" \ |
| 7494 | -c "mbedtls_pk_verify.*4b00" \ |
| 7495 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7496 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7497 | |
| 7498 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7499 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7500 | "$P_SRV auth_mode=required \ |
| 7501 | crt_file=data_files/server5-badsign.crt \ |
| 7502 | key_file=data_files/server5.key" \ |
| 7503 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7504 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7505 | debug_level=1 ec_max_ops=1000" \ |
| 7506 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7507 | -c "x509_verify_cert.*4b00" \ |
| 7508 | -C "mbedtls_pk_verify.*4b00" \ |
| 7509 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7510 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7511 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7512 | -c "! mbedtls_ssl_handshake returned" \ |
| 7513 | -c "X509 - Certificate verification failed" |
| 7514 | |
| 7515 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7516 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7517 | "$P_SRV auth_mode=required \ |
| 7518 | crt_file=data_files/server5-badsign.crt \ |
| 7519 | key_file=data_files/server5.key" \ |
| 7520 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7521 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7522 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7523 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7524 | -c "x509_verify_cert.*4b00" \ |
| 7525 | -c "mbedtls_pk_verify.*4b00" \ |
| 7526 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7527 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7528 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7529 | -C "! mbedtls_ssl_handshake returned" \ |
| 7530 | -C "X509 - Certificate verification failed" |
| 7531 | |
| 7532 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7533 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7534 | "$P_SRV auth_mode=required \ |
| 7535 | crt_file=data_files/server5-badsign.crt \ |
| 7536 | key_file=data_files/server5.key" \ |
| 7537 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7538 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7539 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7540 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7541 | -C "x509_verify_cert.*4b00" \ |
| 7542 | -c "mbedtls_pk_verify.*4b00" \ |
| 7543 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7544 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7545 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7546 | -C "! mbedtls_ssl_handshake returned" \ |
| 7547 | -C "X509 - Certificate verification failed" |
| 7548 | |
| 7549 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7550 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7551 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7552 | "$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] | 7553 | 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] | 7554 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7555 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7556 | -c "x509_verify_cert.*4b00" \ |
| 7557 | -c "mbedtls_pk_verify.*4b00" \ |
| 7558 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7559 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7560 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7561 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7562 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7563 | "$P_SRV" \ |
| 7564 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7565 | debug_level=1 ec_max_ops=1000" \ |
| 7566 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7567 | -c "x509_verify_cert.*4b00" \ |
| 7568 | -c "mbedtls_pk_verify.*4b00" \ |
| 7569 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7570 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7571 | |
| 7572 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7573 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 7574 | "$P_SRV psk=abc123" \ |
| 7575 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7576 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7577 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7578 | -C "x509_verify_cert.*4b00" \ |
| 7579 | -C "mbedtls_pk_verify.*4b00" \ |
| 7580 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7581 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7582 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7583 | # Tests of asynchronous private key support in SSL |
| 7584 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7585 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7586 | run_test "SSL async private: sign, delay=0" \ |
| 7587 | "$P_SRV \ |
| 7588 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7589 | "$P_CLI" \ |
| 7590 | 0 \ |
| 7591 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7592 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7593 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7594 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7595 | run_test "SSL async private: sign, delay=1" \ |
| 7596 | "$P_SRV \ |
| 7597 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7598 | "$P_CLI" \ |
| 7599 | 0 \ |
| 7600 | -s "Async sign callback: using key slot " \ |
| 7601 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7602 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7603 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7604 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7605 | run_test "SSL async private: sign, delay=2" \ |
| 7606 | "$P_SRV \ |
| 7607 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7608 | "$P_CLI" \ |
| 7609 | 0 \ |
| 7610 | -s "Async sign callback: using key slot " \ |
| 7611 | -U "Async sign callback: using key slot " \ |
| 7612 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7613 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7614 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7615 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7616 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7617 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7618 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7620 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7621 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7622 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7623 | "$P_CLI force_version=tls1_1" \ |
| 7624 | 0 \ |
| 7625 | -s "Async sign callback: using key slot " \ |
| 7626 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7627 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7628 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7629 | run_test "SSL async private: sign, SNI" \ |
| 7630 | "$P_SRV debug_level=3 \ |
| 7631 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7632 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7633 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7634 | "$P_CLI server_name=polarssl.example" \ |
| 7635 | 0 \ |
| 7636 | -s "Async sign callback: using key slot " \ |
| 7637 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7638 | -s "parse ServerName extension" \ |
| 7639 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7640 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7641 | |
| 7642 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7643 | run_test "SSL async private: decrypt, delay=0" \ |
| 7644 | "$P_SRV \ |
| 7645 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7646 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7647 | 0 \ |
| 7648 | -s "Async decrypt callback: using key slot " \ |
| 7649 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7650 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7651 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7652 | run_test "SSL async private: decrypt, delay=1" \ |
| 7653 | "$P_SRV \ |
| 7654 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7655 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7656 | 0 \ |
| 7657 | -s "Async decrypt callback: using key slot " \ |
| 7658 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7659 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7660 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7661 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7662 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7663 | "$P_SRV psk=abc123 \ |
| 7664 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7665 | "$P_CLI psk=abc123 \ |
| 7666 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7667 | 0 \ |
| 7668 | -s "Async decrypt callback: using key slot " \ |
| 7669 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7670 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7671 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7672 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7673 | "$P_SRV psk=abc123 \ |
| 7674 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7675 | "$P_CLI psk=abc123 \ |
| 7676 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7677 | 0 \ |
| 7678 | -s "Async decrypt callback: using key slot " \ |
| 7679 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7680 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7681 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7682 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7683 | run_test "SSL async private: sign callback not present" \ |
| 7684 | "$P_SRV \ |
| 7685 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7686 | "$P_CLI; [ \$? -eq 1 ] && |
| 7687 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7688 | 0 \ |
| 7689 | -S "Async sign callback" \ |
| 7690 | -s "! mbedtls_ssl_handshake returned" \ |
| 7691 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7692 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7693 | -s "Successful connection" |
| 7694 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7695 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7696 | run_test "SSL async private: decrypt callback not present" \ |
| 7697 | "$P_SRV debug_level=1 \ |
| 7698 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7699 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7700 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7701 | 0 \ |
| 7702 | -S "Async decrypt callback" \ |
| 7703 | -s "! mbedtls_ssl_handshake returned" \ |
| 7704 | -s "got no RSA private key" \ |
| 7705 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7706 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7707 | |
| 7708 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7709 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7710 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7711 | "$P_SRV \ |
| 7712 | async_operations=s async_private_delay1=1 \ |
| 7713 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7714 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7715 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7716 | 0 \ |
| 7717 | -s "Async sign callback: using key slot 0," \ |
| 7718 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7719 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7720 | |
| 7721 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7722 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7723 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7724 | "$P_SRV \ |
| 7725 | async_operations=s async_private_delay2=1 \ |
| 7726 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7727 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7728 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7729 | 0 \ |
| 7730 | -s "Async sign callback: using key slot 0," \ |
| 7731 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7732 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7733 | |
| 7734 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7735 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7736 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7737 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7738 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7739 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7740 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7741 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7742 | 0 \ |
| 7743 | -s "Async sign callback: using key slot 1," \ |
| 7744 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7745 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7746 | |
| 7747 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7748 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7749 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7750 | "$P_SRV \ |
| 7751 | async_operations=s async_private_delay1=1 \ |
| 7752 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7753 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7754 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7755 | 0 \ |
| 7756 | -s "Async sign callback: no key matches this certificate." |
| 7757 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7758 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7759 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7760 | "$P_SRV \ |
| 7761 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7762 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7763 | "$P_CLI" \ |
| 7764 | 1 \ |
| 7765 | -s "Async sign callback: injected error" \ |
| 7766 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7767 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7768 | -s "! mbedtls_ssl_handshake returned" |
| 7769 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7770 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7771 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7772 | "$P_SRV \ |
| 7773 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7774 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7775 | "$P_CLI" \ |
| 7776 | 1 \ |
| 7777 | -s "Async sign callback: using key slot " \ |
| 7778 | -S "Async resume" \ |
| 7779 | -s "Async cancel" |
| 7780 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7781 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7782 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7783 | "$P_SRV \ |
| 7784 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7785 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7786 | "$P_CLI" \ |
| 7787 | 1 \ |
| 7788 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7789 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7790 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7791 | -s "! mbedtls_ssl_handshake returned" |
| 7792 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7793 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7794 | run_test "SSL async private: decrypt, error in start" \ |
| 7795 | "$P_SRV \ |
| 7796 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7797 | async_private_error=1" \ |
| 7798 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7799 | 1 \ |
| 7800 | -s "Async decrypt callback: injected error" \ |
| 7801 | -S "Async resume" \ |
| 7802 | -S "Async cancel" \ |
| 7803 | -s "! mbedtls_ssl_handshake returned" |
| 7804 | |
| 7805 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7806 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7807 | "$P_SRV \ |
| 7808 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7809 | async_private_error=2" \ |
| 7810 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7811 | 1 \ |
| 7812 | -s "Async decrypt callback: using key slot " \ |
| 7813 | -S "Async resume" \ |
| 7814 | -s "Async cancel" |
| 7815 | |
| 7816 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7817 | run_test "SSL async private: decrypt, error in resume" \ |
| 7818 | "$P_SRV \ |
| 7819 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7820 | async_private_error=3" \ |
| 7821 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7822 | 1 \ |
| 7823 | -s "Async decrypt callback: using key slot " \ |
| 7824 | -s "Async resume callback: decrypt done but injected error" \ |
| 7825 | -S "Async cancel" \ |
| 7826 | -s "! mbedtls_ssl_handshake returned" |
| 7827 | |
| 7828 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7829 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7830 | "$P_SRV \ |
| 7831 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7832 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7833 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7834 | 0 \ |
| 7835 | -s "Async cancel" \ |
| 7836 | -s "! mbedtls_ssl_handshake returned" \ |
| 7837 | -s "Async resume" \ |
| 7838 | -s "Successful connection" |
| 7839 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7840 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7841 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7842 | "$P_SRV \ |
| 7843 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7844 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7845 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7846 | 0 \ |
| 7847 | -s "! mbedtls_ssl_handshake returned" \ |
| 7848 | -s "Async resume" \ |
| 7849 | -s "Successful connection" |
| 7850 | |
| 7851 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7852 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7853 | 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] | 7854 | "$P_SRV \ |
| 7855 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7856 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7857 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7858 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7859 | [ \$? -eq 1 ] && |
| 7860 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7861 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7862 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7863 | -S "Async resume" \ |
| 7864 | -s "Async cancel" \ |
| 7865 | -s "! mbedtls_ssl_handshake returned" \ |
| 7866 | -s "Async sign callback: no key matches this certificate." \ |
| 7867 | -s "Successful connection" |
| 7868 | |
| 7869 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7870 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7871 | 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] | 7872 | "$P_SRV \ |
| 7873 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7874 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7875 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7876 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7877 | [ \$? -eq 1 ] && |
| 7878 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7879 | 0 \ |
| 7880 | -s "Async resume" \ |
| 7881 | -s "! mbedtls_ssl_handshake returned" \ |
| 7882 | -s "Async sign callback: no key matches this certificate." \ |
| 7883 | -s "Successful connection" |
| 7884 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7885 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7886 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7887 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7888 | "$P_SRV \ |
| 7889 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7890 | exchanges=2 renegotiation=1" \ |
| 7891 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7892 | 0 \ |
| 7893 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7894 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7895 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7896 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7897 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7898 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7899 | "$P_SRV \ |
| 7900 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7901 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7902 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7903 | 0 \ |
| 7904 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7905 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7906 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7907 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7908 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7909 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7910 | "$P_SRV \ |
| 7911 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7912 | exchanges=2 renegotiation=1" \ |
| 7913 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7914 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7915 | 0 \ |
| 7916 | -s "Async decrypt callback: using key slot " \ |
| 7917 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7918 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7919 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7920 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7921 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7922 | "$P_SRV \ |
| 7923 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7924 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7925 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7926 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7927 | 0 \ |
| 7928 | -s "Async decrypt callback: using key slot " \ |
| 7929 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7930 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7931 | # Tests for ECC extensions (rfc 4492) |
| 7932 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7933 | requires_config_enabled MBEDTLS_AES_C |
| 7934 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7935 | requires_config_enabled MBEDTLS_SHA256_C |
| 7936 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7937 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7938 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7939 | "$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] | 7940 | 0 \ |
| 7941 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7942 | -C "client hello, adding supported_point_formats extension" \ |
| 7943 | -S "found supported elliptic curves extension" \ |
| 7944 | -S "found supported point formats extension" |
| 7945 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7946 | requires_config_enabled MBEDTLS_AES_C |
| 7947 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7948 | requires_config_enabled MBEDTLS_SHA256_C |
| 7949 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7950 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7951 | "$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] | 7952 | "$P_CLI debug_level=3" \ |
| 7953 | 0 \ |
| 7954 | -C "found supported_point_formats extension" \ |
| 7955 | -S "server hello, supported_point_formats extension" |
| 7956 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7957 | requires_config_enabled MBEDTLS_AES_C |
| 7958 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7959 | requires_config_enabled MBEDTLS_SHA256_C |
| 7960 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7961 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7962 | "$P_SRV debug_level=3" \ |
| 7963 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7964 | 0 \ |
| 7965 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7966 | -c "client hello, adding supported_point_formats extension" \ |
| 7967 | -s "found supported elliptic curves extension" \ |
| 7968 | -s "found supported point formats extension" |
| 7969 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7970 | requires_config_enabled MBEDTLS_AES_C |
| 7971 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7972 | requires_config_enabled MBEDTLS_SHA256_C |
| 7973 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7974 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7975 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7976 | "$P_CLI debug_level=3" \ |
| 7977 | 0 \ |
| 7978 | -c "found supported_point_formats extension" \ |
| 7979 | -s "server hello, supported_point_formats extension" |
| 7980 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7981 | # Tests for DTLS HelloVerifyRequest |
| 7982 | |
| 7983 | run_test "DTLS cookie: enabled" \ |
| 7984 | "$P_SRV dtls=1 debug_level=2" \ |
| 7985 | "$P_CLI dtls=1 debug_level=2" \ |
| 7986 | 0 \ |
| 7987 | -s "cookie verification failed" \ |
| 7988 | -s "cookie verification passed" \ |
| 7989 | -S "cookie verification skipped" \ |
| 7990 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7991 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7992 | -S "SSL - The requested feature is not available" |
| 7993 | |
| 7994 | run_test "DTLS cookie: disabled" \ |
| 7995 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7996 | "$P_CLI dtls=1 debug_level=2" \ |
| 7997 | 0 \ |
| 7998 | -S "cookie verification failed" \ |
| 7999 | -S "cookie verification passed" \ |
| 8000 | -s "cookie verification skipped" \ |
| 8001 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8002 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8003 | -S "SSL - The requested feature is not available" |
| 8004 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8005 | run_test "DTLS cookie: default (failing)" \ |
| 8006 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8007 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8008 | 1 \ |
| 8009 | -s "cookie verification failed" \ |
| 8010 | -S "cookie verification passed" \ |
| 8011 | -S "cookie verification skipped" \ |
| 8012 | -C "received hello verify request" \ |
| 8013 | -S "hello verification requested" \ |
| 8014 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8015 | |
| 8016 | requires_ipv6 |
| 8017 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8018 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8019 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8020 | 0 \ |
| 8021 | -s "cookie verification failed" \ |
| 8022 | -s "cookie verification passed" \ |
| 8023 | -S "cookie verification skipped" \ |
| 8024 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8025 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8026 | -S "SSL - The requested feature is not available" |
| 8027 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8028 | run_test "DTLS cookie: enabled, nbio" \ |
| 8029 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 8030 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8031 | 0 \ |
| 8032 | -s "cookie verification failed" \ |
| 8033 | -s "cookie verification passed" \ |
| 8034 | -S "cookie verification skipped" \ |
| 8035 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8036 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8037 | -S "SSL - The requested feature is not available" |
| 8038 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8039 | # Tests for client reconnecting from the same port with DTLS |
| 8040 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8041 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8042 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8043 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8044 | "$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] | 8045 | 0 \ |
| 8046 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8047 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8048 | -S "Client initiated reconnection from same port" |
| 8049 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8050 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8051 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8052 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8053 | "$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] | 8054 | 0 \ |
| 8055 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8056 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8057 | -s "Client initiated reconnection from same port" |
| 8058 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8059 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 8060 | 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] | 8061 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 8062 | "$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] | 8063 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8064 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8065 | -s "Client initiated reconnection from same port" |
| 8066 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8067 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 8068 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 8069 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 8070 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 8071 | 0 \ |
| 8072 | -S "The operation timed out" \ |
| 8073 | -s "Client initiated reconnection from same port" |
| 8074 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8075 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 8076 | "$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] | 8077 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 8078 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8079 | -s "The operation timed out" \ |
| 8080 | -S "Client initiated reconnection from same port" |
| 8081 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 8082 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 8083 | -p "$P_PXY inject_clihlo=1" \ |
| 8084 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 8085 | "$P_CLI dtls=1 exchanges=2" \ |
| 8086 | 0 \ |
| 8087 | -s "possible client reconnect from the same port" \ |
| 8088 | -S "Client initiated reconnection from same port" |
| 8089 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8090 | # Tests for various cases of client authentication with DTLS |
| 8091 | # (focused on handshake flows and message parsing) |
| 8092 | |
| 8093 | run_test "DTLS client auth: required" \ |
| 8094 | "$P_SRV dtls=1 auth_mode=required" \ |
| 8095 | "$P_CLI dtls=1" \ |
| 8096 | 0 \ |
| 8097 | -s "Verifying peer X.509 certificate... ok" |
| 8098 | |
| 8099 | run_test "DTLS client auth: optional, client has no cert" \ |
| 8100 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 8101 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 8102 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8103 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8104 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8105 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8106 | "$P_SRV dtls=1 auth_mode=none" \ |
| 8107 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 8108 | 0 \ |
| 8109 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8110 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8111 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 8112 | run_test "DTLS wrong PSK: badmac alert" \ |
| 8113 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 8114 | "$P_CLI dtls=1 psk=abc124" \ |
| 8115 | 1 \ |
| 8116 | -s "SSL - Verification of the message MAC failed" \ |
| 8117 | -c "SSL - A fatal alert message was received from our peer" |
| 8118 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8119 | # Tests for receiving fragmented handshake messages with DTLS |
| 8120 | |
| 8121 | requires_gnutls |
| 8122 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 8123 | "$G_SRV -u --mtu 2048 -a" \ |
| 8124 | "$P_CLI dtls=1 debug_level=2" \ |
| 8125 | 0 \ |
| 8126 | -C "found fragmented DTLS handshake message" \ |
| 8127 | -C "error" |
| 8128 | |
| 8129 | requires_gnutls |
| 8130 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 8131 | "$G_SRV -u --mtu 512" \ |
| 8132 | "$P_CLI dtls=1 debug_level=2" \ |
| 8133 | 0 \ |
| 8134 | -c "found fragmented DTLS handshake message" \ |
| 8135 | -C "error" |
| 8136 | |
| 8137 | requires_gnutls |
| 8138 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8139 | "$G_SRV -u --mtu 128" \ |
| 8140 | "$P_CLI dtls=1 debug_level=2" \ |
| 8141 | 0 \ |
| 8142 | -c "found fragmented DTLS handshake message" \ |
| 8143 | -C "error" |
| 8144 | |
| 8145 | requires_gnutls |
| 8146 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8147 | "$G_SRV -u --mtu 128" \ |
| 8148 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8149 | 0 \ |
| 8150 | -c "found fragmented DTLS handshake message" \ |
| 8151 | -C "error" |
| 8152 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8153 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8154 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8155 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8156 | "$G_SRV -u --mtu 256" \ |
| 8157 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8158 | 0 \ |
| 8159 | -c "found fragmented DTLS handshake message" \ |
| 8160 | -c "client hello, adding renegotiation extension" \ |
| 8161 | -c "found renegotiation extension" \ |
| 8162 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8163 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8164 | -C "error" \ |
| 8165 | -s "Extra-header:" |
| 8166 | |
| 8167 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8168 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8169 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8170 | "$G_SRV -u --mtu 256" \ |
| 8171 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8172 | 0 \ |
| 8173 | -c "found fragmented DTLS handshake message" \ |
| 8174 | -c "client hello, adding renegotiation extension" \ |
| 8175 | -c "found renegotiation extension" \ |
| 8176 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8177 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8178 | -C "error" \ |
| 8179 | -s "Extra-header:" |
| 8180 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8181 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8182 | "$O_SRV -dtls1 -mtu 2048" \ |
| 8183 | "$P_CLI dtls=1 debug_level=2" \ |
| 8184 | 0 \ |
| 8185 | -C "found fragmented DTLS handshake message" \ |
| 8186 | -C "error" |
| 8187 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8188 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 8189 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8190 | "$P_CLI dtls=1 debug_level=2" \ |
| 8191 | 0 \ |
| 8192 | -c "found fragmented DTLS handshake message" \ |
| 8193 | -C "error" |
| 8194 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8195 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8196 | "$O_SRV -dtls1 -mtu 256" \ |
| 8197 | "$P_CLI dtls=1 debug_level=2" \ |
| 8198 | 0 \ |
| 8199 | -c "found fragmented DTLS handshake message" \ |
| 8200 | -C "error" |
| 8201 | |
| 8202 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 8203 | "$O_SRV -dtls1 -mtu 256" \ |
| 8204 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8205 | 0 \ |
| 8206 | -c "found fragmented DTLS handshake message" \ |
| 8207 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8208 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8209 | # Tests for sending fragmented handshake messages with DTLS |
| 8210 | # |
| 8211 | # Use client auth when we need the client to send large messages, |
| 8212 | # and use large cert chains on both sides too (the long chains we have all use |
| 8213 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 8214 | # Sizes reached (UDP payload): |
| 8215 | # - 2037B for server certificate |
| 8216 | # - 1542B for client certificate |
| 8217 | # - 1013B for newsessionticket |
| 8218 | # - all others below 512B |
| 8219 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 8220 | |
| 8221 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8222 | requires_config_enabled MBEDTLS_RSA_C |
| 8223 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8224 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8225 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8226 | run_test "DTLS fragmenting: none (for reference)" \ |
| 8227 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8228 | crt_file=data_files/server7_int-ca.crt \ |
| 8229 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8230 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8231 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8232 | "$P_CLI dtls=1 debug_level=2 \ |
| 8233 | crt_file=data_files/server8_int-ca2.crt \ |
| 8234 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8235 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8236 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8237 | 0 \ |
| 8238 | -S "found fragmented DTLS handshake message" \ |
| 8239 | -C "found fragmented DTLS handshake message" \ |
| 8240 | -C "error" |
| 8241 | |
| 8242 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8243 | requires_config_enabled MBEDTLS_RSA_C |
| 8244 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8245 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8246 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8247 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8248 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8249 | crt_file=data_files/server7_int-ca.crt \ |
| 8250 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8251 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8252 | max_frag_len=1024" \ |
| 8253 | "$P_CLI dtls=1 debug_level=2 \ |
| 8254 | crt_file=data_files/server8_int-ca2.crt \ |
| 8255 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8256 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8257 | max_frag_len=2048" \ |
| 8258 | 0 \ |
| 8259 | -S "found fragmented DTLS handshake message" \ |
| 8260 | -c "found fragmented DTLS handshake message" \ |
| 8261 | -C "error" |
| 8262 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8263 | # With the MFL extension, the server has no way of forcing |
| 8264 | # the client to not exceed a certain MTU; hence, the following |
| 8265 | # test can't be replicated with an MTU proxy such as the one |
| 8266 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8267 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8268 | requires_config_enabled MBEDTLS_RSA_C |
| 8269 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8270 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8271 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8272 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8273 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8274 | crt_file=data_files/server7_int-ca.crt \ |
| 8275 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8276 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8277 | max_frag_len=512" \ |
| 8278 | "$P_CLI dtls=1 debug_level=2 \ |
| 8279 | crt_file=data_files/server8_int-ca2.crt \ |
| 8280 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8281 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8282 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8283 | 0 \ |
| 8284 | -S "found fragmented DTLS handshake message" \ |
| 8285 | -c "found fragmented DTLS handshake message" \ |
| 8286 | -C "error" |
| 8287 | |
| 8288 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8289 | requires_config_enabled MBEDTLS_RSA_C |
| 8290 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8291 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8292 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8293 | 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] | 8294 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8295 | crt_file=data_files/server7_int-ca.crt \ |
| 8296 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8297 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8298 | max_frag_len=2048" \ |
| 8299 | "$P_CLI dtls=1 debug_level=2 \ |
| 8300 | crt_file=data_files/server8_int-ca2.crt \ |
| 8301 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8302 | hs_timeout=2500-60000 \ |
| 8303 | max_frag_len=1024" \ |
| 8304 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8305 | -S "found fragmented DTLS handshake message" \ |
| 8306 | -c "found fragmented DTLS handshake message" \ |
| 8307 | -C "error" |
| 8308 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8309 | # While not required by the standard defining the MFL extension |
| 8310 | # (according to which it only applies to records, not to datagrams), |
| 8311 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8312 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8313 | # to the peer. |
| 8314 | # The next test checks that no datagrams significantly larger than the |
| 8315 | # negotiated MFL are sent. |
| 8316 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8317 | requires_config_enabled MBEDTLS_RSA_C |
| 8318 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8319 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8320 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8321 | 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] | 8322 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8323 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8324 | crt_file=data_files/server7_int-ca.crt \ |
| 8325 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8326 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8327 | max_frag_len=2048" \ |
| 8328 | "$P_CLI dtls=1 debug_level=2 \ |
| 8329 | crt_file=data_files/server8_int-ca2.crt \ |
| 8330 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8331 | hs_timeout=2500-60000 \ |
| 8332 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8333 | 0 \ |
| 8334 | -S "found fragmented DTLS handshake message" \ |
| 8335 | -c "found fragmented DTLS handshake message" \ |
| 8336 | -C "error" |
| 8337 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8338 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8339 | requires_config_enabled MBEDTLS_RSA_C |
| 8340 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8341 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8342 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8343 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8344 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8345 | crt_file=data_files/server7_int-ca.crt \ |
| 8346 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8347 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8348 | max_frag_len=2048" \ |
| 8349 | "$P_CLI dtls=1 debug_level=2 \ |
| 8350 | crt_file=data_files/server8_int-ca2.crt \ |
| 8351 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8352 | hs_timeout=2500-60000 \ |
| 8353 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8354 | 0 \ |
| 8355 | -s "found fragmented DTLS handshake message" \ |
| 8356 | -c "found fragmented DTLS handshake message" \ |
| 8357 | -C "error" |
| 8358 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8359 | # While not required by the standard defining the MFL extension |
| 8360 | # (according to which it only applies to records, not to datagrams), |
| 8361 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8362 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8363 | # to the peer. |
| 8364 | # The next test checks that no datagrams significantly larger than the |
| 8365 | # negotiated MFL are sent. |
| 8366 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8367 | requires_config_enabled MBEDTLS_RSA_C |
| 8368 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8369 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8370 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8371 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8372 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8373 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8374 | crt_file=data_files/server7_int-ca.crt \ |
| 8375 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8376 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8377 | max_frag_len=2048" \ |
| 8378 | "$P_CLI dtls=1 debug_level=2 \ |
| 8379 | crt_file=data_files/server8_int-ca2.crt \ |
| 8380 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8381 | hs_timeout=2500-60000 \ |
| 8382 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8383 | 0 \ |
| 8384 | -s "found fragmented DTLS handshake message" \ |
| 8385 | -c "found fragmented DTLS handshake message" \ |
| 8386 | -C "error" |
| 8387 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8388 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8389 | requires_config_enabled MBEDTLS_RSA_C |
| 8390 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8391 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8392 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8393 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8394 | crt_file=data_files/server7_int-ca.crt \ |
| 8395 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8396 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8397 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8398 | "$P_CLI dtls=1 debug_level=2 \ |
| 8399 | crt_file=data_files/server8_int-ca2.crt \ |
| 8400 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8401 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8402 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8403 | 0 \ |
| 8404 | -S "found fragmented DTLS handshake message" \ |
| 8405 | -C "found fragmented DTLS handshake message" \ |
| 8406 | -C "error" |
| 8407 | |
| 8408 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8409 | requires_config_enabled MBEDTLS_RSA_C |
| 8410 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8411 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8412 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8413 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8414 | crt_file=data_files/server7_int-ca.crt \ |
| 8415 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8416 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8417 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8418 | "$P_CLI dtls=1 debug_level=2 \ |
| 8419 | crt_file=data_files/server8_int-ca2.crt \ |
| 8420 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8421 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8422 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8423 | 0 \ |
| 8424 | -s "found fragmented DTLS handshake message" \ |
| 8425 | -C "found fragmented DTLS handshake message" \ |
| 8426 | -C "error" |
| 8427 | |
| 8428 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8429 | requires_config_enabled MBEDTLS_RSA_C |
| 8430 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8431 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8432 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8433 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8434 | crt_file=data_files/server7_int-ca.crt \ |
| 8435 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8436 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8437 | mtu=512" \ |
| 8438 | "$P_CLI dtls=1 debug_level=2 \ |
| 8439 | crt_file=data_files/server8_int-ca2.crt \ |
| 8440 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8441 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8442 | mtu=2048" \ |
| 8443 | 0 \ |
| 8444 | -S "found fragmented DTLS handshake message" \ |
| 8445 | -c "found fragmented DTLS handshake message" \ |
| 8446 | -C "error" |
| 8447 | |
| 8448 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8449 | requires_config_enabled MBEDTLS_RSA_C |
| 8450 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8451 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8452 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8453 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8454 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8455 | crt_file=data_files/server7_int-ca.crt \ |
| 8456 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8457 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8458 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8459 | "$P_CLI dtls=1 debug_level=2 \ |
| 8460 | crt_file=data_files/server8_int-ca2.crt \ |
| 8461 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8462 | hs_timeout=2500-60000 \ |
| 8463 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8464 | 0 \ |
| 8465 | -s "found fragmented DTLS handshake message" \ |
| 8466 | -c "found fragmented DTLS handshake message" \ |
| 8467 | -C "error" |
| 8468 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8469 | # 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] | 8470 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8471 | requires_config_enabled MBEDTLS_RSA_C |
| 8472 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8473 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8474 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8475 | requires_config_enabled MBEDTLS_AES_C |
| 8476 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8477 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8478 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8479 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8480 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8481 | crt_file=data_files/server7_int-ca.crt \ |
| 8482 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8483 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8484 | mtu=512" \ |
| 8485 | "$P_CLI dtls=1 debug_level=2 \ |
| 8486 | crt_file=data_files/server8_int-ca2.crt \ |
| 8487 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8488 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8489 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8490 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8491 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8492 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8493 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8494 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8495 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8496 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8497 | # 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] | 8498 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8499 | # retransmissions, but in some cases (like both the server and client using |
| 8500 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8501 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8502 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8503 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8504 | requires_config_enabled MBEDTLS_RSA_C |
| 8505 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8506 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8507 | requires_config_enabled MBEDTLS_AES_C |
| 8508 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8509 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8510 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8511 | -p "$P_PXY mtu=508" \ |
| 8512 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8513 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8514 | key_file=data_files/server7.key \ |
| 8515 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8516 | "$P_CLI dtls=1 debug_level=2 \ |
| 8517 | crt_file=data_files/server8_int-ca2.crt \ |
| 8518 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8519 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8520 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8521 | 0 \ |
| 8522 | -s "found fragmented DTLS handshake message" \ |
| 8523 | -c "found fragmented DTLS handshake message" \ |
| 8524 | -C "error" |
| 8525 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8526 | # 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] | 8527 | only_with_valgrind |
| 8528 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8529 | requires_config_enabled MBEDTLS_RSA_C |
| 8530 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8531 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8532 | requires_config_enabled MBEDTLS_AES_C |
| 8533 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8534 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8535 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8536 | -p "$P_PXY mtu=508" \ |
| 8537 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8538 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8539 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8540 | hs_timeout=250-10000" \ |
| 8541 | "$P_CLI dtls=1 debug_level=2 \ |
| 8542 | crt_file=data_files/server8_int-ca2.crt \ |
| 8543 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8544 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8545 | hs_timeout=250-10000" \ |
| 8546 | 0 \ |
| 8547 | -s "found fragmented DTLS handshake message" \ |
| 8548 | -c "found fragmented DTLS handshake message" \ |
| 8549 | -C "error" |
| 8550 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8551 | # 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] | 8552 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8553 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8554 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8555 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8556 | requires_config_enabled MBEDTLS_RSA_C |
| 8557 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8558 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8559 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8560 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8561 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8562 | crt_file=data_files/server7_int-ca.crt \ |
| 8563 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8564 | hs_timeout=10000-60000 \ |
| 8565 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8566 | "$P_CLI dtls=1 debug_level=2 \ |
| 8567 | crt_file=data_files/server8_int-ca2.crt \ |
| 8568 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8569 | hs_timeout=10000-60000 \ |
| 8570 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8571 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8572 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8573 | -s "found fragmented DTLS handshake message" \ |
| 8574 | -c "found fragmented DTLS handshake message" \ |
| 8575 | -C "error" |
| 8576 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8577 | # 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] | 8578 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8579 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8580 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8581 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8582 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8583 | requires_config_enabled MBEDTLS_RSA_C |
| 8584 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8585 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8586 | requires_config_enabled MBEDTLS_AES_C |
| 8587 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8588 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8589 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8590 | -p "$P_PXY mtu=512" \ |
| 8591 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8592 | crt_file=data_files/server7_int-ca.crt \ |
| 8593 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8594 | hs_timeout=10000-60000 \ |
| 8595 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8596 | "$P_CLI dtls=1 debug_level=2 \ |
| 8597 | crt_file=data_files/server8_int-ca2.crt \ |
| 8598 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8599 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8600 | hs_timeout=10000-60000 \ |
| 8601 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8602 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8603 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8604 | -s "found fragmented DTLS handshake message" \ |
| 8605 | -c "found fragmented DTLS handshake message" \ |
| 8606 | -C "error" |
| 8607 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8608 | not_with_valgrind # spurious autoreduction due to timeout |
| 8609 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8610 | requires_config_enabled MBEDTLS_RSA_C |
| 8611 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8612 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8613 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8614 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8615 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8616 | crt_file=data_files/server7_int-ca.crt \ |
| 8617 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8618 | hs_timeout=10000-60000 \ |
| 8619 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8620 | "$P_CLI dtls=1 debug_level=2 \ |
| 8621 | crt_file=data_files/server8_int-ca2.crt \ |
| 8622 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8623 | hs_timeout=10000-60000 \ |
| 8624 | mtu=1024 nbio=2" \ |
| 8625 | 0 \ |
| 8626 | -S "autoreduction" \ |
| 8627 | -s "found fragmented DTLS handshake message" \ |
| 8628 | -c "found fragmented DTLS handshake message" \ |
| 8629 | -C "error" |
| 8630 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8631 | # 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] | 8632 | not_with_valgrind # spurious autoreduction due to timeout |
| 8633 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8634 | requires_config_enabled MBEDTLS_RSA_C |
| 8635 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8636 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8637 | requires_config_enabled MBEDTLS_AES_C |
| 8638 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8639 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8640 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8641 | -p "$P_PXY mtu=512" \ |
| 8642 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8643 | crt_file=data_files/server7_int-ca.crt \ |
| 8644 | key_file=data_files/server7.key \ |
| 8645 | hs_timeout=10000-60000 \ |
| 8646 | mtu=512 nbio=2" \ |
| 8647 | "$P_CLI dtls=1 debug_level=2 \ |
| 8648 | crt_file=data_files/server8_int-ca2.crt \ |
| 8649 | key_file=data_files/server8.key \ |
| 8650 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8651 | hs_timeout=10000-60000 \ |
| 8652 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8653 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8654 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8655 | -s "found fragmented DTLS handshake message" \ |
| 8656 | -c "found fragmented DTLS handshake message" \ |
| 8657 | -C "error" |
| 8658 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8659 | # 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] | 8660 | # This ensures things still work after session_reset(). |
| 8661 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8662 | # Since we don't support reading fragmented ClientHello yet, |
| 8663 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8664 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8665 | # An autoreduction on the client-side might happen if the server is |
| 8666 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8667 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8668 | # resumed listening, which would result in a spurious autoreduction. |
| 8669 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8670 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8671 | requires_config_enabled MBEDTLS_RSA_C |
| 8672 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8673 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8674 | requires_config_enabled MBEDTLS_AES_C |
| 8675 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8676 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8677 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8678 | -p "$P_PXY mtu=1450" \ |
| 8679 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8680 | crt_file=data_files/server7_int-ca.crt \ |
| 8681 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8682 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8683 | mtu=1450" \ |
| 8684 | "$P_CLI dtls=1 debug_level=2 \ |
| 8685 | crt_file=data_files/server8_int-ca2.crt \ |
| 8686 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8687 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8688 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8689 | 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] | 8690 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8691 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8692 | -s "found fragmented DTLS handshake message" \ |
| 8693 | -c "found fragmented DTLS handshake message" \ |
| 8694 | -C "error" |
| 8695 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8696 | # An autoreduction on the client-side might happen if the server is |
| 8697 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8698 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8699 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8700 | requires_config_enabled MBEDTLS_RSA_C |
| 8701 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8702 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8703 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8704 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8705 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8706 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8707 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8708 | -p "$P_PXY mtu=512" \ |
| 8709 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8710 | crt_file=data_files/server7_int-ca.crt \ |
| 8711 | key_file=data_files/server7.key \ |
| 8712 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8713 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8714 | mtu=512" \ |
| 8715 | "$P_CLI dtls=1 debug_level=2 \ |
| 8716 | crt_file=data_files/server8_int-ca2.crt \ |
| 8717 | key_file=data_files/server8.key \ |
| 8718 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8719 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8720 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8721 | mtu=512" \ |
| 8722 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8723 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8724 | -s "found fragmented DTLS handshake message" \ |
| 8725 | -c "found fragmented DTLS handshake message" \ |
| 8726 | -C "error" |
| 8727 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8728 | # An autoreduction on the client-side might happen if the server is |
| 8729 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8730 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8731 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8732 | requires_config_enabled MBEDTLS_RSA_C |
| 8733 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8734 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8735 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8736 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8737 | requires_config_enabled MBEDTLS_AES_C |
| 8738 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8739 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8740 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8741 | -p "$P_PXY mtu=512" \ |
| 8742 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8743 | crt_file=data_files/server7_int-ca.crt \ |
| 8744 | key_file=data_files/server7.key \ |
| 8745 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8746 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8747 | mtu=512" \ |
| 8748 | "$P_CLI dtls=1 debug_level=2 \ |
| 8749 | crt_file=data_files/server8_int-ca2.crt \ |
| 8750 | key_file=data_files/server8.key \ |
| 8751 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8752 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8753 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8754 | mtu=512" \ |
| 8755 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8756 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8757 | -s "found fragmented DTLS handshake message" \ |
| 8758 | -c "found fragmented DTLS handshake message" \ |
| 8759 | -C "error" |
| 8760 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8761 | # An autoreduction on the client-side might happen if the server is |
| 8762 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8763 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8764 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8765 | requires_config_enabled MBEDTLS_RSA_C |
| 8766 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8767 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8768 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8770 | requires_config_enabled MBEDTLS_AES_C |
| 8771 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8772 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8773 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8774 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8775 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8776 | crt_file=data_files/server7_int-ca.crt \ |
| 8777 | key_file=data_files/server7.key \ |
| 8778 | exchanges=2 renegotiation=1 \ |
| 8779 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8780 | hs_timeout=10000-60000 \ |
| 8781 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8782 | "$P_CLI dtls=1 debug_level=2 \ |
| 8783 | crt_file=data_files/server8_int-ca2.crt \ |
| 8784 | key_file=data_files/server8.key \ |
| 8785 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8786 | hs_timeout=10000-60000 \ |
| 8787 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8788 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8789 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8790 | -s "found fragmented DTLS handshake message" \ |
| 8791 | -c "found fragmented DTLS handshake message" \ |
| 8792 | -C "error" |
| 8793 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8794 | # An autoreduction on the client-side might happen if the server is |
| 8795 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8796 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8797 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8798 | requires_config_enabled MBEDTLS_RSA_C |
| 8799 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8800 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8801 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8802 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8803 | requires_config_enabled MBEDTLS_AES_C |
| 8804 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8805 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8806 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8807 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8808 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8809 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8810 | crt_file=data_files/server7_int-ca.crt \ |
| 8811 | key_file=data_files/server7.key \ |
| 8812 | exchanges=2 renegotiation=1 \ |
| 8813 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8814 | hs_timeout=10000-60000 \ |
| 8815 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8816 | "$P_CLI dtls=1 debug_level=2 \ |
| 8817 | crt_file=data_files/server8_int-ca2.crt \ |
| 8818 | key_file=data_files/server8.key \ |
| 8819 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8820 | hs_timeout=10000-60000 \ |
| 8821 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8822 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8823 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8824 | -s "found fragmented DTLS handshake message" \ |
| 8825 | -c "found fragmented DTLS handshake message" \ |
| 8826 | -C "error" |
| 8827 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8828 | # An autoreduction on the client-side might happen if the server is |
| 8829 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8830 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8831 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8832 | requires_config_enabled MBEDTLS_RSA_C |
| 8833 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8834 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8835 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8836 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8837 | requires_config_enabled MBEDTLS_AES_C |
| 8838 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8839 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8840 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8841 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8842 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8843 | crt_file=data_files/server7_int-ca.crt \ |
| 8844 | key_file=data_files/server7.key \ |
| 8845 | exchanges=2 renegotiation=1 \ |
| 8846 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8847 | hs_timeout=10000-60000 \ |
| 8848 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8849 | "$P_CLI dtls=1 debug_level=2 \ |
| 8850 | crt_file=data_files/server8_int-ca2.crt \ |
| 8851 | key_file=data_files/server8.key \ |
| 8852 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8853 | hs_timeout=10000-60000 \ |
| 8854 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8855 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8856 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8857 | -s "found fragmented DTLS handshake message" \ |
| 8858 | -c "found fragmented DTLS handshake message" \ |
| 8859 | -C "error" |
| 8860 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8861 | # 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] | 8862 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8863 | requires_config_enabled MBEDTLS_RSA_C |
| 8864 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8865 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8866 | requires_config_enabled MBEDTLS_AES_C |
| 8867 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8868 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8869 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8870 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8871 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8872 | "$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] | 8873 | crt_file=data_files/server7_int-ca.crt \ |
| 8874 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8875 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8876 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8877 | crt_file=data_files/server8_int-ca2.crt \ |
| 8878 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8879 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8880 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8881 | 0 \ |
| 8882 | -s "found fragmented DTLS handshake message" \ |
| 8883 | -c "found fragmented DTLS handshake message" \ |
| 8884 | -C "error" |
| 8885 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8886 | # 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] | 8887 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8888 | requires_config_enabled MBEDTLS_RSA_C |
| 8889 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8890 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8891 | requires_config_enabled MBEDTLS_AES_C |
| 8892 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8893 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8894 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8895 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8896 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8897 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8898 | crt_file=data_files/server7_int-ca.crt \ |
| 8899 | key_file=data_files/server7.key \ |
| 8900 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8901 | "$P_CLI dtls=1 debug_level=2 \ |
| 8902 | crt_file=data_files/server8_int-ca2.crt \ |
| 8903 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8904 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8905 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8906 | 0 \ |
| 8907 | -s "found fragmented DTLS handshake message" \ |
| 8908 | -c "found fragmented DTLS handshake message" \ |
| 8909 | -C "error" |
| 8910 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8911 | # interop tests for DTLS fragmentating with reliable connection |
| 8912 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8913 | # here and below we just want to test that the we fragment in a way that |
| 8914 | # pleases other implementations, so we don't need the peer to fragment |
| 8915 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8916 | requires_config_enabled MBEDTLS_RSA_C |
| 8917 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8918 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8919 | requires_gnutls |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8920 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8921 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8922 | "$G_SRV -u" \ |
| 8923 | "$P_CLI dtls=1 debug_level=2 \ |
| 8924 | crt_file=data_files/server8_int-ca2.crt \ |
| 8925 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8926 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8927 | 0 \ |
| 8928 | -c "fragmenting handshake message" \ |
| 8929 | -C "error" |
| 8930 | |
| 8931 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8932 | requires_config_enabled MBEDTLS_RSA_C |
| 8933 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8935 | requires_gnutls |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8936 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8937 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8938 | "$G_SRV -u" \ |
| 8939 | "$P_CLI dtls=1 debug_level=2 \ |
| 8940 | crt_file=data_files/server8_int-ca2.crt \ |
| 8941 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8942 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8943 | 0 \ |
| 8944 | -c "fragmenting handshake message" \ |
| 8945 | -C "error" |
| 8946 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8947 | # We use --insecure for the GnuTLS client because it expects |
| 8948 | # the hostname / IP it connects to to be the name used in the |
| 8949 | # certificate obtained from the server. Here, however, it |
| 8950 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8951 | # as the server name in the certificate. This will make the |
| 8952 | # certifiate validation fail, but passing --insecure makes |
| 8953 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8954 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8955 | requires_config_enabled MBEDTLS_RSA_C |
| 8956 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8958 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8959 | requires_not_i686 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8960 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8961 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8962 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8963 | crt_file=data_files/server7_int-ca.crt \ |
| 8964 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8965 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8966 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8967 | 0 \ |
| 8968 | -s "fragmenting handshake message" |
| 8969 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8970 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8971 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8972 | requires_config_enabled MBEDTLS_RSA_C |
| 8973 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8975 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8976 | requires_not_i686 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8977 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8978 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8979 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8980 | crt_file=data_files/server7_int-ca.crt \ |
| 8981 | key_file=data_files/server7.key \ |
| 8982 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8983 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8984 | 0 \ |
| 8985 | -s "fragmenting handshake message" |
| 8986 | |
| 8987 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8988 | requires_config_enabled MBEDTLS_RSA_C |
| 8989 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8991 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8992 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8993 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8994 | "$P_CLI dtls=1 debug_level=2 \ |
| 8995 | crt_file=data_files/server8_int-ca2.crt \ |
| 8996 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8997 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8998 | 0 \ |
| 8999 | -c "fragmenting handshake message" \ |
| 9000 | -C "error" |
| 9001 | |
| 9002 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9003 | requires_config_enabled MBEDTLS_RSA_C |
| 9004 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9005 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9006 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9007 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 9008 | "$O_SRV -dtls1 -verify 10" \ |
| 9009 | "$P_CLI dtls=1 debug_level=2 \ |
| 9010 | crt_file=data_files/server8_int-ca2.crt \ |
| 9011 | key_file=data_files/server8.key \ |
| 9012 | mtu=512 force_version=dtls1" \ |
| 9013 | 0 \ |
| 9014 | -c "fragmenting handshake message" \ |
| 9015 | -C "error" |
| 9016 | |
| 9017 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9018 | requires_config_enabled MBEDTLS_RSA_C |
| 9019 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9021 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9022 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9023 | "$P_SRV dtls=1 debug_level=2 \ |
| 9024 | crt_file=data_files/server7_int-ca.crt \ |
| 9025 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9026 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9027 | "$O_CLI -dtls1_2" \ |
| 9028 | 0 \ |
| 9029 | -s "fragmenting handshake message" |
| 9030 | |
| 9031 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9032 | requires_config_enabled MBEDTLS_RSA_C |
| 9033 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9034 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9035 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9036 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 9037 | "$P_SRV dtls=1 debug_level=2 \ |
| 9038 | crt_file=data_files/server7_int-ca.crt \ |
| 9039 | key_file=data_files/server7.key \ |
| 9040 | mtu=512 force_version=dtls1" \ |
| 9041 | "$O_CLI -dtls1" \ |
| 9042 | 0 \ |
| 9043 | -s "fragmenting handshake message" |
| 9044 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9045 | # interop tests for DTLS fragmentating with unreliable connection |
| 9046 | # |
| 9047 | # again we just want to test that the we fragment in a way that |
| 9048 | # pleases other implementations, so we don't need the peer to fragment |
| 9049 | requires_gnutls_next |
| 9050 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9051 | requires_config_enabled MBEDTLS_RSA_C |
| 9052 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9054 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9055 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9056 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9057 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9058 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9059 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9060 | crt_file=data_files/server8_int-ca2.crt \ |
| 9061 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9062 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9063 | 0 \ |
| 9064 | -c "fragmenting handshake message" \ |
| 9065 | -C "error" |
| 9066 | |
| 9067 | requires_gnutls_next |
| 9068 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9069 | requires_config_enabled MBEDTLS_RSA_C |
| 9070 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9072 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9073 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9074 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 9075 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9076 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9077 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9078 | crt_file=data_files/server8_int-ca2.crt \ |
| 9079 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9080 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9081 | 0 \ |
| 9082 | -c "fragmenting handshake message" \ |
| 9083 | -C "error" |
| 9084 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9085 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9086 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9087 | requires_config_enabled MBEDTLS_RSA_C |
| 9088 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9090 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9091 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9092 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9093 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9094 | "$P_SRV dtls=1 debug_level=2 \ |
| 9095 | crt_file=data_files/server7_int-ca.crt \ |
| 9096 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9097 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9098 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9099 | 0 \ |
| 9100 | -s "fragmenting handshake message" |
| 9101 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9102 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9103 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9104 | requires_config_enabled MBEDTLS_RSA_C |
| 9105 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 9107 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9108 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9109 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 9110 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9111 | "$P_SRV dtls=1 debug_level=2 \ |
| 9112 | crt_file=data_files/server7_int-ca.crt \ |
| 9113 | key_file=data_files/server7.key \ |
| 9114 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9115 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9116 | 0 \ |
| 9117 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9118 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9119 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 9120 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9121 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9122 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9123 | ## (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] | 9124 | skip_next_test |
| 9125 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9126 | requires_config_enabled MBEDTLS_RSA_C |
| 9127 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9129 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9130 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9131 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9132 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9133 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9134 | "$P_CLI dtls=1 debug_level=2 \ |
| 9135 | crt_file=data_files/server8_int-ca2.crt \ |
| 9136 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9137 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9138 | 0 \ |
| 9139 | -c "fragmenting handshake message" \ |
| 9140 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9141 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9142 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9143 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9144 | requires_config_enabled MBEDTLS_RSA_C |
| 9145 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9147 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9148 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9149 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 9150 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9151 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9152 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9153 | crt_file=data_files/server8_int-ca2.crt \ |
| 9154 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9155 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9156 | 0 \ |
| 9157 | -c "fragmenting handshake message" \ |
| 9158 | -C "error" |
| 9159 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9160 | skip_next_test |
| 9161 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9162 | requires_config_enabled MBEDTLS_RSA_C |
| 9163 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9164 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9165 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9166 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9167 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9168 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9169 | "$P_SRV dtls=1 debug_level=2 \ |
| 9170 | crt_file=data_files/server7_int-ca.crt \ |
| 9171 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9172 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9173 | "$O_CLI -dtls1_2" \ |
| 9174 | 0 \ |
| 9175 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9176 | |
| 9177 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 9178 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9179 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9180 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9181 | requires_config_enabled MBEDTLS_RSA_C |
| 9182 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9184 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9185 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9186 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 9187 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9188 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9189 | crt_file=data_files/server7_int-ca.crt \ |
| 9190 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9191 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9192 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9193 | 0 \ |
| 9194 | -s "fragmenting handshake message" |
| 9195 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9196 | # Tests for DTLS-SRTP (RFC 5764) |
| 9197 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9198 | run_test "DTLS-SRTP all profiles supported" \ |
| 9199 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9200 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9201 | 0 \ |
| 9202 | -s "found use_srtp extension" \ |
| 9203 | -s "found srtp profile" \ |
| 9204 | -s "selected srtp profile" \ |
| 9205 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9206 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9207 | -c "client hello, adding use_srtp extension" \ |
| 9208 | -c "found use_srtp extension" \ |
| 9209 | -c "found srtp profile" \ |
| 9210 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9211 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9212 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9213 | -C "error" |
| 9214 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9215 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9216 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9217 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9218 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9219 | "$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] | 9220 | 0 \ |
| 9221 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9222 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9223 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9224 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9225 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9226 | -c "client hello, adding use_srtp extension" \ |
| 9227 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9228 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9229 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9230 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9231 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9232 | -C "error" |
| 9233 | |
| 9234 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9235 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9236 | "$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] | 9237 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9238 | 0 \ |
| 9239 | -s "found use_srtp extension" \ |
| 9240 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9241 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9242 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9243 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9244 | -c "client hello, adding use_srtp extension" \ |
| 9245 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9246 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9247 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9248 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9249 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9250 | -C "error" |
| 9251 | |
| 9252 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9253 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9254 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9255 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9256 | 0 \ |
| 9257 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9258 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9259 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9260 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9261 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9262 | -c "client hello, adding use_srtp extension" \ |
| 9263 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9264 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9265 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9266 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9267 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9268 | -C "error" |
| 9269 | |
| 9270 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9271 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9272 | "$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] | 9273 | "$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] | 9274 | 0 \ |
| 9275 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9276 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9277 | -S "selected srtp profile" \ |
| 9278 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9279 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9280 | -c "client hello, adding use_srtp extension" \ |
| 9281 | -C "found use_srtp extension" \ |
| 9282 | -C "found srtp profile" \ |
| 9283 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9284 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9285 | -C "error" |
| 9286 | |
| 9287 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9288 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9289 | "$P_SRV dtls=1 debug_level=3" \ |
| 9290 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9291 | 0 \ |
| 9292 | -s "found use_srtp extension" \ |
| 9293 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9294 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9295 | -c "client hello, adding use_srtp extension" \ |
| 9296 | -C "found use_srtp extension" \ |
| 9297 | -C "found srtp profile" \ |
| 9298 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9299 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9300 | -C "error" |
| 9301 | |
| 9302 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9303 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 9304 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 9305 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9306 | 0 \ |
| 9307 | -s "found use_srtp extension" \ |
| 9308 | -s "found srtp profile" \ |
| 9309 | -s "selected srtp profile" \ |
| 9310 | -s "server hello, adding use_srtp extension" \ |
| 9311 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9312 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9313 | -c "client hello, adding use_srtp extension" \ |
| 9314 | -c "found use_srtp extension" \ |
| 9315 | -c "found srtp profile" \ |
| 9316 | -c "selected srtp profile" \ |
| 9317 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9318 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9319 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9320 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9321 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9322 | -C "error" |
| 9323 | |
| 9324 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9325 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 9326 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9327 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9328 | 0 \ |
| 9329 | -s "found use_srtp extension" \ |
| 9330 | -s "found srtp profile" \ |
| 9331 | -s "selected srtp profile" \ |
| 9332 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9333 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9334 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9335 | -S "dumping 'using mki' (8 bytes)" \ |
| 9336 | -c "client hello, adding use_srtp extension" \ |
| 9337 | -c "found use_srtp extension" \ |
| 9338 | -c "found srtp profile" \ |
| 9339 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9340 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9341 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9342 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9343 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9344 | -C "dumping 'received mki' (8 bytes)" \ |
| 9345 | -C "error" |
| 9346 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9347 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9348 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 9349 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9350 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9351 | 0 \ |
| 9352 | -s "found use_srtp extension" \ |
| 9353 | -s "found srtp profile" \ |
| 9354 | -s "selected srtp profile" \ |
| 9355 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9356 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9357 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9358 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 9359 | |
| 9360 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9361 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 9362 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9363 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9364 | 0 \ |
| 9365 | -s "found use_srtp extension" \ |
| 9366 | -s "found srtp profile" \ |
| 9367 | -s "selected srtp profile" \ |
| 9368 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9369 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9370 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9371 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9372 | |
| 9373 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9374 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 9375 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9376 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9377 | 0 \ |
| 9378 | -s "found use_srtp extension" \ |
| 9379 | -s "found srtp profile" \ |
| 9380 | -s "selected srtp profile" \ |
| 9381 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9382 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9383 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9384 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9385 | |
| 9386 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9387 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 9388 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9389 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9390 | 0 \ |
| 9391 | -s "found use_srtp extension" \ |
| 9392 | -s "found srtp profile" \ |
| 9393 | -s "selected srtp profile" \ |
| 9394 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9395 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9396 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9397 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9398 | |
| 9399 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9400 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 9401 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9402 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9403 | 0 \ |
| 9404 | -s "found use_srtp extension" \ |
| 9405 | -s "found srtp profile" \ |
| 9406 | -s "selected srtp profile" \ |
| 9407 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9408 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9409 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9410 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9411 | |
| 9412 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9413 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 9414 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9415 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9416 | 0 \ |
| 9417 | -s "found use_srtp extension" \ |
| 9418 | -s "found srtp profile" \ |
| 9419 | -S "selected srtp profile" \ |
| 9420 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9421 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9422 | -C "SRTP Extension negotiated, profile" |
| 9423 | |
| 9424 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9425 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 9426 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9427 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9428 | 0 \ |
| 9429 | -s "found use_srtp extension" \ |
| 9430 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9431 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9432 | -C "SRTP Extension negotiated, profile" |
| 9433 | |
| 9434 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9435 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9436 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9437 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9438 | 0 \ |
| 9439 | -c "client hello, adding use_srtp extension" \ |
| 9440 | -c "found use_srtp extension" \ |
| 9441 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9442 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9443 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9444 | -C "error" |
| 9445 | |
| 9446 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9447 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9448 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9449 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9450 | 0 \ |
| 9451 | -c "client hello, adding use_srtp extension" \ |
| 9452 | -c "found use_srtp extension" \ |
| 9453 | -c "found srtp profile" \ |
| 9454 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9455 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9456 | -C "error" |
| 9457 | |
| 9458 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9459 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9460 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9461 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9462 | 0 \ |
| 9463 | -c "client hello, adding use_srtp extension" \ |
| 9464 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9465 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9466 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9467 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9468 | -C "error" |
| 9469 | |
| 9470 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9471 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9472 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9473 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9474 | 0 \ |
| 9475 | -c "client hello, adding use_srtp extension" \ |
| 9476 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9477 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9478 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9479 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9480 | -C "error" |
| 9481 | |
| 9482 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9483 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9484 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9485 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9486 | 0 \ |
| 9487 | -c "client hello, adding use_srtp extension" \ |
| 9488 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9489 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9490 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9491 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9492 | -C "error" |
| 9493 | |
| 9494 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9495 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9496 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9497 | "$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] | 9498 | 0 \ |
| 9499 | -c "client hello, adding use_srtp extension" \ |
| 9500 | -C "found use_srtp extension" \ |
| 9501 | -C "found srtp profile" \ |
| 9502 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9503 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9504 | -C "error" |
| 9505 | |
| 9506 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9507 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9508 | "$O_SRV -dtls1" \ |
| 9509 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9510 | 0 \ |
| 9511 | -c "client hello, adding use_srtp extension" \ |
| 9512 | -C "found use_srtp extension" \ |
| 9513 | -C "found srtp profile" \ |
| 9514 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9515 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9516 | -C "error" |
| 9517 | |
| 9518 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9519 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9520 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9521 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9522 | 0 \ |
| 9523 | -c "client hello, adding use_srtp extension" \ |
| 9524 | -c "found use_srtp extension" \ |
| 9525 | -c "found srtp profile" \ |
| 9526 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9527 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9528 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9529 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9530 | -C "dumping 'received mki' (8 bytes)" \ |
| 9531 | -C "error" |
| 9532 | |
| 9533 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9534 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9535 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9536 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9537 | "$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] | 9538 | 0 \ |
| 9539 | -s "found use_srtp extension" \ |
| 9540 | -s "found srtp profile" \ |
| 9541 | -s "selected srtp profile" \ |
| 9542 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9543 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9544 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9545 | |
| 9546 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9547 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9548 | 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] | 9549 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9550 | "$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] | 9551 | 0 \ |
| 9552 | -s "found use_srtp extension" \ |
| 9553 | -s "found srtp profile" \ |
| 9554 | -s "selected srtp profile" \ |
| 9555 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9556 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9557 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9558 | |
| 9559 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9560 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9561 | 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] | 9562 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9563 | "$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] | 9564 | 0 \ |
| 9565 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9566 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9567 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9568 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9569 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9570 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9571 | |
| 9572 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9573 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9574 | 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] | 9575 | "$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] | 9576 | "$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] | 9577 | 0 \ |
| 9578 | -s "found use_srtp extension" \ |
| 9579 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9580 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9581 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9582 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9583 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9584 | |
| 9585 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9586 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9587 | 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] | 9588 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9589 | "$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] | 9590 | 0 \ |
| 9591 | -s "found use_srtp extension" \ |
| 9592 | -s "found srtp profile" \ |
| 9593 | -s "selected srtp profile" \ |
| 9594 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9595 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9596 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9597 | |
| 9598 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9599 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9600 | 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] | 9601 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9602 | "$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] | 9603 | 0 \ |
| 9604 | -s "found use_srtp extension" \ |
| 9605 | -s "found srtp profile" \ |
| 9606 | -S "selected srtp profile" \ |
| 9607 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9608 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9609 | -C "SRTP profile:" |
| 9610 | |
| 9611 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9612 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9613 | 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] | 9614 | "$P_SRV dtls=1 debug_level=3" \ |
| 9615 | "$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] | 9616 | 0 \ |
| 9617 | -s "found use_srtp extension" \ |
| 9618 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9619 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9620 | -C "SRTP profile:" |
| 9621 | |
| 9622 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9623 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9624 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9625 | "$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" \ |
| 9626 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9627 | 0 \ |
| 9628 | -c "client hello, adding use_srtp extension" \ |
| 9629 | -c "found use_srtp extension" \ |
| 9630 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9631 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9632 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9633 | -C "error" |
| 9634 | |
| 9635 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9636 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9637 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9638 | "$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" \ |
| 9639 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9640 | 0 \ |
| 9641 | -c "client hello, adding use_srtp extension" \ |
| 9642 | -c "found use_srtp extension" \ |
| 9643 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9644 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9645 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9646 | -C "error" |
| 9647 | |
| 9648 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9649 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9650 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9651 | "$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" \ |
| 9652 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9653 | 0 \ |
| 9654 | -c "client hello, adding use_srtp extension" \ |
| 9655 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9656 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9657 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9658 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9659 | -C "error" |
| 9660 | |
| 9661 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9662 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9663 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9664 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9665 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9666 | 0 \ |
| 9667 | -c "client hello, adding use_srtp extension" \ |
| 9668 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9669 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9670 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9671 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9672 | -C "error" |
| 9673 | |
| 9674 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9675 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9676 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9677 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9678 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9679 | 0 \ |
| 9680 | -c "client hello, adding use_srtp extension" \ |
| 9681 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9682 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9683 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9684 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9685 | -C "error" |
| 9686 | |
| 9687 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9688 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9689 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9690 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9691 | "$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] | 9692 | 0 \ |
| 9693 | -c "client hello, adding use_srtp extension" \ |
| 9694 | -C "found use_srtp extension" \ |
| 9695 | -C "found srtp profile" \ |
| 9696 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9697 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9698 | -C "error" |
| 9699 | |
| 9700 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9701 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9702 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9703 | "$G_SRV -u" \ |
| 9704 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9705 | 0 \ |
| 9706 | -c "client hello, adding use_srtp extension" \ |
| 9707 | -C "found use_srtp extension" \ |
| 9708 | -C "found srtp profile" \ |
| 9709 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9710 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9711 | -C "error" |
| 9712 | |
| 9713 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9714 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9715 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9716 | "$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" \ |
| 9717 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9718 | 0 \ |
| 9719 | -c "client hello, adding use_srtp extension" \ |
| 9720 | -c "found use_srtp extension" \ |
| 9721 | -c "found srtp profile" \ |
| 9722 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9723 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9724 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9725 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9726 | -c "dumping 'received mki' (8 bytes)" \ |
| 9727 | -C "error" |
| 9728 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9729 | # Tests for specific things with "unreliable" UDP connection |
| 9730 | |
| 9731 | not_with_valgrind # spurious resend due to timeout |
| 9732 | run_test "DTLS proxy: reference" \ |
| 9733 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9734 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9735 | "$P_CLI dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9736 | 0 \ |
| 9737 | -C "replayed record" \ |
| 9738 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9739 | -C "Buffer record from epoch" \ |
| 9740 | -S "Buffer record from epoch" \ |
| 9741 | -C "ssl_buffer_message" \ |
| 9742 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9743 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9744 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9745 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9746 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9747 | -c "HTTP/1.0 200 OK" |
| 9748 | |
| 9749 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9750 | run_test "DTLS proxy: duplicate every packet" \ |
| 9751 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9752 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9753 | "$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] | 9754 | 0 \ |
| 9755 | -c "replayed record" \ |
| 9756 | -s "replayed record" \ |
| 9757 | -c "record from another epoch" \ |
| 9758 | -s "record from another epoch" \ |
| 9759 | -S "resend" \ |
| 9760 | -s "Extra-header:" \ |
| 9761 | -c "HTTP/1.0 200 OK" |
| 9762 | |
| 9763 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9764 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9765 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9766 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9767 | 0 \ |
| 9768 | -c "replayed record" \ |
| 9769 | -S "replayed record" \ |
| 9770 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9771 | -s "record from another epoch" \ |
| 9772 | -c "resend" \ |
| 9773 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9774 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9775 | -c "HTTP/1.0 200 OK" |
| 9776 | |
| 9777 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9778 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9779 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9780 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9781 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9782 | -c "next record in same datagram" \ |
| 9783 | -s "next record in same datagram" |
| 9784 | |
| 9785 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9786 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9787 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9788 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9789 | 0 \ |
| 9790 | -c "next record in same datagram" \ |
| 9791 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9792 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9793 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9794 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9795 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9796 | "$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] | 9797 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9798 | -c "discarding invalid record (mac)" \ |
| 9799 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9800 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9801 | -c "HTTP/1.0 200 OK" \ |
| 9802 | -S "too many records with bad MAC" \ |
| 9803 | -S "Verification of the message MAC failed" |
| 9804 | |
| 9805 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9806 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9807 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9808 | "$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] | 9809 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9810 | -C "discarding invalid record (mac)" \ |
| 9811 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9812 | -S "Extra-header:" \ |
| 9813 | -C "HTTP/1.0 200 OK" \ |
| 9814 | -s "too many records with bad MAC" \ |
| 9815 | -s "Verification of the message MAC failed" |
| 9816 | |
| 9817 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9818 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9819 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9820 | "$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] | 9821 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9822 | -c "discarding invalid record (mac)" \ |
| 9823 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9824 | -s "Extra-header:" \ |
| 9825 | -c "HTTP/1.0 200 OK" \ |
| 9826 | -S "too many records with bad MAC" \ |
| 9827 | -S "Verification of the message MAC failed" |
| 9828 | |
| 9829 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9830 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9831 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9832 | "$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] | 9833 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9834 | -c "discarding invalid record (mac)" \ |
| 9835 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9836 | -s "Extra-header:" \ |
| 9837 | -c "HTTP/1.0 200 OK" \ |
| 9838 | -s "too many records with bad MAC" \ |
| 9839 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9840 | |
| 9841 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9842 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9843 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9844 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9845 | 0 \ |
| 9846 | -c "record from another epoch" \ |
| 9847 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9848 | -s "Extra-header:" \ |
| 9849 | -c "HTTP/1.0 200 OK" |
| 9850 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9851 | # Tests for reordering support with DTLS |
| 9852 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9853 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9854 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9855 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9856 | hs_timeout=2500-60000" \ |
| 9857 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9858 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9859 | 0 \ |
| 9860 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9861 | -c "Next handshake message has been buffered - load"\ |
| 9862 | -S "Buffering HS message" \ |
| 9863 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9864 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9865 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9866 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9867 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9868 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9869 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9870 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9871 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9872 | hs_timeout=2500-60000" \ |
| 9873 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9874 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9875 | 0 \ |
| 9876 | -c "Buffering HS message" \ |
| 9877 | -c "found fragmented DTLS handshake message"\ |
| 9878 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9879 | -c "Next handshake message has been buffered - load"\ |
| 9880 | -S "Buffering HS message" \ |
| 9881 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9882 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9883 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9884 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9885 | -S "Remember CCS message" |
| 9886 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9887 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9888 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9889 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9890 | # while keeping the ServerKeyExchange. |
| 9891 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 9892 | 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] | 9893 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9894 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9895 | hs_timeout=2500-60000" \ |
| 9896 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9897 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9898 | 0 \ |
| 9899 | -c "Buffering HS message" \ |
| 9900 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9901 | -C "attempt to make space by freeing buffered messages" \ |
| 9902 | -S "Buffering HS message" \ |
| 9903 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9904 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9905 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9906 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9907 | -S "Remember CCS message" |
| 9908 | |
| 9909 | # The size constraints ensure that the delayed certificate message can't |
| 9910 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9911 | # when dropping it first. |
| 9912 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9913 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 9914 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9915 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9916 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9917 | hs_timeout=2500-60000" \ |
| 9918 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9919 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9920 | 0 \ |
| 9921 | -c "Buffering HS message" \ |
| 9922 | -c "attempt to make space by freeing buffered future messages" \ |
| 9923 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9924 | -S "Buffering HS message" \ |
| 9925 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9926 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9927 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9928 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9929 | -S "Remember CCS message" |
| 9930 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9931 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9932 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9933 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9934 | hs_timeout=2500-60000" \ |
| 9935 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9936 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9937 | 0 \ |
| 9938 | -C "Buffering HS message" \ |
| 9939 | -C "Next handshake message has been buffered - load"\ |
| 9940 | -s "Buffering HS message" \ |
| 9941 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9942 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9943 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9944 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9945 | -S "Remember CCS message" |
| 9946 | |
| 9947 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9948 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9949 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9950 | hs_timeout=2500-60000" \ |
| 9951 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9952 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9953 | 0 \ |
| 9954 | -C "Buffering HS message" \ |
| 9955 | -C "Next handshake message has been buffered - load"\ |
| 9956 | -S "Buffering HS message" \ |
| 9957 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9958 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9959 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9960 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9961 | -S "Remember CCS message" |
| 9962 | |
| 9963 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9964 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9965 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9966 | hs_timeout=2500-60000" \ |
| 9967 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9968 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9969 | 0 \ |
| 9970 | -C "Buffering HS message" \ |
| 9971 | -C "Next handshake message has been buffered - load"\ |
| 9972 | -S "Buffering HS message" \ |
| 9973 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9974 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9975 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9976 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9977 | -s "Remember CCS message" |
| 9978 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9979 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9980 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9981 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9982 | hs_timeout=2500-60000" \ |
| 9983 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9984 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9985 | 0 \ |
| 9986 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9987 | -s "Found buffered record from current epoch - load" \ |
| 9988 | -c "Buffer record from epoch 1" \ |
| 9989 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9990 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9991 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9992 | # from the server are delayed, so that the encrypted Finished message |
| 9993 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9994 | # in afterwards, the encrypted Finished message must be freed in order |
| 9995 | # to make space for the NewSessionTicket to be reassembled. |
| 9996 | # This works only in very particular circumstances: |
| 9997 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9998 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9999 | # the encrypted Finished message. |
| 10000 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10001 | # needs to be fragmented. |
| 10002 | # - All messages sent by the server must be small enough to be either sent |
| 10003 | # without fragmentation or be reassembled within the bounds of |
| 10004 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10005 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10006 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10007 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10008 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10009 | -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] | 10010 | "$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] | 10011 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10012 | 0 \ |
| 10013 | -s "Buffer record from epoch 1" \ |
| 10014 | -s "Found buffered record from current epoch - load" \ |
| 10015 | -c "Buffer record from epoch 1" \ |
| 10016 | -C "Found buffered record from current epoch - load" \ |
| 10017 | -c "Enough space available after freeing future epoch record" |
| 10018 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10019 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10020 | |
| 10021 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10022 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10023 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10024 | "$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] | 10025 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10026 | "$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] | 10027 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10028 | 0 \ |
| 10029 | -s "Extra-header:" \ |
| 10030 | -c "HTTP/1.0 200 OK" |
| 10031 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10032 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10033 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10034 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10035 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10036 | "$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] | 10037 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10038 | 0 \ |
| 10039 | -s "Extra-header:" \ |
| 10040 | -c "HTTP/1.0 200 OK" |
| 10041 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10042 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10043 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10044 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10045 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10046 | "$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] | 10047 | 0 \ |
| 10048 | -s "Extra-header:" \ |
| 10049 | -c "HTTP/1.0 200 OK" |
| 10050 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10051 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10052 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10053 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10054 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10055 | "$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] | 10056 | 0 \ |
| 10057 | -s "Extra-header:" \ |
| 10058 | -c "HTTP/1.0 200 OK" |
| 10059 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10060 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10061 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10062 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10063 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10064 | "$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] | 10065 | 0 \ |
| 10066 | -s "Extra-header:" \ |
| 10067 | -c "HTTP/1.0 200 OK" |
| 10068 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10069 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10070 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 10071 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10072 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 10073 | "$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] | 10074 | 0 \ |
| 10075 | -s "Extra-header:" \ |
| 10076 | -c "HTTP/1.0 200 OK" |
| 10077 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10078 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10079 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 10080 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10081 | "$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] | 10082 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10083 | "$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] | 10084 | 0 \ |
| 10085 | -s "Extra-header:" \ |
| 10086 | -c "HTTP/1.0 200 OK" |
| 10087 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10088 | client_needs_more_time 4 |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10089 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10090 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10091 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10092 | "$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] | 10093 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10094 | "$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] | 10095 | 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] | 10096 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10097 | 0 \ |
| 10098 | -s "a session has been resumed" \ |
| 10099 | -c "a session has been resumed" \ |
| 10100 | -s "Extra-header:" \ |
| 10101 | -c "HTTP/1.0 200 OK" |
| 10102 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10103 | client_needs_more_time 4 |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10104 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10105 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 10106 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10107 | "$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] | 10108 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10109 | "$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] | 10110 | 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] | 10111 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 10112 | 0 \ |
| 10113 | -s "a session has been resumed" \ |
| 10114 | -c "a session has been resumed" \ |
| 10115 | -s "Extra-header:" \ |
| 10116 | -c "HTTP/1.0 200 OK" |
| 10117 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10118 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10119 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10120 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10121 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10122 | "$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] | 10123 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10124 | "$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] | 10125 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10126 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10127 | 0 \ |
| 10128 | -c "=> renegotiate" \ |
| 10129 | -s "=> renegotiate" \ |
| 10130 | -s "Extra-header:" \ |
| 10131 | -c "HTTP/1.0 200 OK" |
| 10132 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10133 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10134 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10135 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10136 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10137 | "$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] | 10138 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10139 | "$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] | 10140 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10141 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10142 | 0 \ |
| 10143 | -c "=> renegotiate" \ |
| 10144 | -s "=> renegotiate" \ |
| 10145 | -s "Extra-header:" \ |
| 10146 | -c "HTTP/1.0 200 OK" |
| 10147 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10148 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10149 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10150 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10151 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10152 | "$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] | 10153 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10154 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10155 | "$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] | 10156 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10157 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10158 | 0 \ |
| 10159 | -c "=> renegotiate" \ |
| 10160 | -s "=> renegotiate" \ |
| 10161 | -s "Extra-header:" \ |
| 10162 | -c "HTTP/1.0 200 OK" |
| 10163 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10164 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10165 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10166 | 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] | 10167 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10168 | "$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] | 10169 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10170 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10171 | "$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] | 10172 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10173 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10174 | 0 \ |
| 10175 | -c "=> renegotiate" \ |
| 10176 | -s "=> renegotiate" \ |
| 10177 | -s "Extra-header:" \ |
| 10178 | -c "HTTP/1.0 200 OK" |
| 10179 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10180 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 10181 | ## all versions installed on the CI machines), reported here: |
| 10182 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 10183 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 10184 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 10185 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10186 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10187 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10188 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10189 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10190 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10191 | "$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] | 10192 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10193 | -c "HTTP/1.0 200 OK" |
| 10194 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10195 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10196 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10197 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10198 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10199 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10200 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10201 | "$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] | 10202 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10203 | -c "HTTP/1.0 200 OK" |
| 10204 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10205 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10206 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10207 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10208 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10209 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10210 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10211 | "$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] | 10212 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10213 | -c "HTTP/1.0 200 OK" |
| 10214 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10215 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10216 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10217 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10218 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10219 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 10220 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10221 | "$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] | 10222 | 0 \ |
| 10223 | -s "Extra-header:" \ |
| 10224 | -c "Extra-header:" |
| 10225 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10226 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10227 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10228 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10229 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 10230 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10231 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10232 | "$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] | 10233 | 0 \ |
| 10234 | -s "Extra-header:" \ |
| 10235 | -c "Extra-header:" |
| 10236 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10237 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10238 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10239 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10240 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 10241 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10242 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10243 | "$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] | 10244 | 0 \ |
| 10245 | -s "Extra-header:" \ |
| 10246 | -c "Extra-header:" |
| 10247 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10248 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 10249 | run_test "export keys functionality" \ |
| 10250 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 10251 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 10252 | 0 \ |
| 10253 | -s "exported maclen is " \ |
| 10254 | -s "exported keylen is " \ |
| 10255 | -s "exported ivlen is " \ |
| 10256 | -c "exported maclen is " \ |
| 10257 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 10258 | -c "exported ivlen is " \ |
| 10259 | -c "EAP-TLS key material is:"\ |
| 10260 | -s "EAP-TLS key material is:"\ |
| 10261 | -c "EAP-TLS IV is:" \ |
| 10262 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10263 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10264 | # Test heap memory usage after handshake |
| 10265 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 10266 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 10267 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10268 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10269 | run_tests_memory_after_hanshake |
| 10270 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10271 | # Final report |
| 10272 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10273 | echo "------------------------------------------------------------------------" |
| 10274 | |
| 10275 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10276 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10277 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10278 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10279 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 10280 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 10281 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10282 | |
| 10283 | exit $FAILS |